Documentation
    Preparing search index...

    Class PostgresQueryGenerator

    Temporary class to ease the TypeScript migration

    Hierarchy (View Summary)

    Index
    • get sequelize(): Sequelize<Dialect>

      Returns Sequelize<Dialect>

    • Throws if columns of this type cannot be unique in this dialect, to throw a clear error instead of the one of the database.

      Parameters

      • columnName: string | undefined

        The name of the column

      • type: string | AbstractDataType<any>

        The type of the column

      • Optionaloptions: UniqueTypeOptions

        The length of the prefix of the column that is part of the unique index, if any (prefixLength)

      Returns void

    • Returns a query that creates a savepoint.

      Parameters

      • savepointName: string

      Returns string

    • Escapes a value (e.g. a string, number or date) as an SQL value (as opposed to an identifier).

      Parameters

      • value: unknown

        The value to escape

      • Optionaloptions: EscapeOptions

        The options to use when escaping the value

      Returns string

    • Escapes an array of values (e.g. strings, numbers or dates) as an SQL List of values.

      Parameters

      • values: unknown[]

        The list of values to escape

      • Optionaloptions: EscapeOptions

      Returns string

      const values = [1, 2, 3];
      queryGenerator.escapeList([1, 2, 3]);
    • Generates an SQL query that returns all foreign keys of a table or the foreign key constraint of a given column.

      Parameters

      • _tableName: TableOrModel

        The table or associated model.

      • Optional_columnName: string

        The name of the column. Not supported by SQLite.

      Returns Error

      The generated SQL query.

      Use showConstraintsQuery instead.

    • Called for each column of attributesToSql before it is generated. Dialects that reject more than one cascading constraint to the same table use this to drop the referential actions of the references they cannot accept.

      Parameters

      • _attribute: AttributeToSqlColumn

        the column about to be generated. Mutate it to change what is emitted

      • _referencedTables: string[]

        the quoted tables referenced by the columns generated so far. Push to record one

      Returns void

    • Adds quotes to identifier

      Parameters

      • identifier: string
      • Optional_force: boolean

      Returns string

    • Returns a query that rollbacks a savepoint.

      Parameters

      • savepointName: string

      Returns string