OINO TS
    Preparing search index...

    Class OINODbAbstract

    Base class for database abstraction, implementing methods for connecting, making queries and parsing/formatting data between SQL and serialization formats.

    Hierarchy

    • unknown
      • OINODb
    Index

    Constructors

    Properties

    isConnected: boolean = false
    isValidated: boolean = false
    name: string

    Name of the database

    Methods

    • Handle a column schema request. Supports GET (fetch column schema), POST (add column) and DELETE (drop column). PUT is not supported and throws.

      Parameters

      • method: string

        HTTP method of the request (GET, POST, DELETE)

      • tableName: string

        name of the table

      • columnName: string

        name of the column (for GET/DELETE)

      • Optionalbody: string

        request body as JSON string (for POST)

      Returns Promise<OINODbSchemaResult>

    • Handle a table schema request. Supports GET (fetch schema), POST (create table) and DELETE (drop table). PUT is not supported and throws.

      Parameters

      • method: string

        HTTP method of the request (GET, POST, DELETE)

      • tableName: string

        name of the table

      • Optionalbody: string

        request body as JSON string (for POST)

      Returns Promise<OINODbSchemaResult>

    • Resolve the optimal native (SQL) type for a serialized field schema. Must throw if the requested internal type / parameter combination is not supported by the database.

      Parameters

      • schema: OINODataFieldSchema

        serialized field schema

      Returns string

    • Get the schema fields of a table as OINODataFields (without any API-level field filtering).

      Parameters

      • tableName: string

        name of the table

      Returns Promise<OINODataField[]>

    • Initialize a data model for an API by fetching the schema fields (via getSchemaFields) and applying API-level field filtering and date-handling parameters.

      Parameters

      • api: OINODbApi

        api which data model to initialize.

      Returns Promise<void>

    • Print a column name using database specific SQL escaping.

      Parameters

      • sqlColumn: string

        name of the column

      Returns string

    • Print SQL ADD COLUMN statement.

      Parameters

      • tableName: string

        name of the table

      • field: OINODataField

        field to add

      Returns string

    • Print SQL CREATE TABLE statement.

      Parameters

      • tableName: string

        name of the table

      • fields: OINODataField[]

        fields of the table

      Returns string

    • Print SQL DROP COLUMN statement.

      Parameters

      • tableName: string

        name of the table

      • columnName: string

        name of the column

      Returns string

    • Print SQL DROP TABLE statement.

      Parameters

      • tableName: string

        name of the table

      Returns string

    • Print SQL select statement with DB specific formatting.

      Parameters

      • tableName: string

        The name of the table to select from.

      • columns: string

        The columns to be selected.

      • values: string

        The values to be inserted.

      • OptionalreturnIdFields: string[]

        the id fields to return if returnIds is true (if supported by the database)

      Returns string

    • Print SQL select statement with DB specific formatting.

      Parameters

      • tableName: string

        The name of the table to select from.

      • columnNames: string

        The columns to be selected.

      • whereCondition: string

        The WHERE clause to filter the results.

      • orderCondition: string

        The ORDER BY clause to sort the results.

      • limitCondition: string

        The LIMIT clause to limit the number of results.

      • groupByCondition: string

        The GROUP BY clause to group the results.

      Returns string

    • Print a table name using database specific SQL escaping.

      Parameters

      • sqlTable: string

        name of the table

      Returns string

    • Execute other sql operations.

      Parameters

      • sql: string

        SQL statement.

      Returns Promise<OINODataSet>

    • Execute a select operation.

      Parameters

      • sql: string

        SQL statement.

      Returns Promise<OINODataSet>