Documentation
    Preparing search index...

    Class MsSqlQueryInterfaceInternal

    The methods in this class are not part of the public API.

    Hierarchy (View Summary)

    Index
    dialect: MsSqlDialect
    • Adds a unique constraint on the column, or a unique index if the dialect cannot add constraints to existing tables.

      Parameters

      • tableName: TableOrModel

        The table that contains the column

      • columnName: string

        The name of the column, as it is in the database

      • Optionaloptions: QueryRawOptions

        Query options

      Returns Promise<void>

    • Returns whether the table has a unique key (a unique constraint, a unique index, or the primary key) on exactly the given column.

      Both the unique constraints and the indexes of the table are checked, because depending on the dialect, a unique key can be a unique index without a unique constraint. Snowflake does not report which columns its unique constraints are on, so they are never found there.

      Parameters

      • tableName: TableOrModel

        The table that contains the column

      • columnName: string

        The name of the column, as it is in the database

      • Optionaloptions: QueryRawOptions

        Query options

      Returns Promise<boolean>

    • Returns whether AbstractQueryInterface#changeColumn needs to add a unique key to the column, as requested by its "unique" option. This is only the case if the table does not have a unique key on exactly that column yet, so calling changeColumn again does not add another one.

      Parameters

      • tableName: TableOrModel

        The table that contains the column

      • columnName: string

        The name of the column, as it is in the database

      • unique: AllowArray<string | boolean | { msg?: string; name: string }> | undefined

        The value of the "unique" attribute option

      • Optionaloptions: QueryRawOptions

        Query options

      Returns Promise<boolean>