OINO TS
    Preparing search index...

    Class OINODbMsSql

    Implementation of MsSql-database.

    Hierarchy

    • OINODb
      • OINODbMsSql
    Index

    Constructors

    Methods

    • Coerce a data value into a MSSQL bind-parameter value. node-mssql infers the SQL type from the JS value (number, string, boolean, Date, Buffer), so most values pass through. Binary columns are the exception: only a Buffer is inferred as VarBinary, so Uint8Array and (base64-encoded) string values are converted to Buffer — otherwise they would be bound as NVarChar and fail with "Implicit conversion from data type nvarchar to binary is not allowed".

      Parameters

      • cellValue: OINODataCell

        data value to bind

      • nativeType: string

        native type name for the table column

      Returns OINODataCell

    • Resolve the optimal native (SQL) type for a serialized field schema.

      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[]>

    • Get the names of all user (base) tables in the database schema, excluding system tables and views.

      Returns Promise<string[]>

    • Parse a single SQL result value for serialization using the context of the native data type.

      Parameters

      • sqlValue: OINODataCell

        data from serialization

      • nativeType: string

        native type name for table column

      Returns OINODataCell

    • Print a single data value from serialization using the context of the native data type with the correct SQL escaping.

      Parameters

      • cellValue: OINODataCell

        data from sql results

      • nativeType: string

        native type name for table column

      Returns string

    • Print a column name with correct SQL escaping.

      Parameters

      • sqlColumn: string

        name of the column

      Returns string

    • Print a bind-parameter placeholder for the given zero-based parameter index (MSSQL @p0).

      Parameters

      • index: number

        zero-based parameter index

      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 single string value as valid sql literal

      Parameters

      • sqlString: string

        string value

      Returns string

    • Print a table name using database specific SQL escaping.

      Parameters

      • sqlTable: string

        name of the table

      Returns string

    • Execute a parameterized statement, binding its values as @p0, @p1, … named parameters.

      Parameters

      • statement: OINODbSqlStatement

        statement (SQL text + ordered bind values) to execute

      Returns Promise<OINODataSet>

    • Execute other sql operations.

      Parameters

      • sql: string

        SQL statement.

      Returns Promise<OINODataSet>

    • Execute a select operation.

      Parameters

      • sql: string

        SQL statement.

      Returns Promise<OINODataSet>

    • Validate connection to database is working.

      Returns Promise<OINOResult>