Class AbstractDialectAbstract

Hierarchy

  • AbstractDialect

Constructors

Properties

#baseDataTypes: Map<string, Class<ABSTRACT<any>>>

base implementations of shared data types

#dataTypeOverrides: Map<string, Class<ABSTRACT<any>>>

dialect-specific implementation of shared data types

#dataTypeParsers: Map<unknown, TypeParser> = ...
#printedWarnings: Set<string> = ...
DataTypes: Record<string, Class<ABSTRACT<any>>>
Query: typeof AbstractQuery
TICK_CHAR_LEFT: string
TICK_CHAR_RIGHT: string
connectionManager: AbstractConnectionManager<any>
dataTypesDocumentationUrl: string
defaultVersion: string
name: Dialect
queryGenerator: AbstractQueryGenerator
queryInterface: AbstractQueryInterface
sequelize: Sequelize
supports: DialectSupports = ...

List of features this dialect supports.

Important: Dialect implementations inherit these values. When changing a default, ensure the implementations still properly declare which feature they support.

Accessors

Methods

  • Produces a safe representation of a Buffer for this dialect, that can be inlined in a SQL string. Used mainly by DataTypes.

    Parameters

    • buffer: Buffer

      The buffer to escape

    Returns string

    The string, escaped for SQL.

  • Produces a safe representation of a string for this dialect, that can be inlined in a SQL string. Used mainly by DataTypes.

    Parameters

    • value: string

      The string to escape

    Returns string

    The string, escaped for SQL.

  • Returns the dialect-specific implementation of a shared data type, or null if no such implementation exists (in which case you need to use the base implementation).

    Parameters

    • dataType: Class<ABSTRACT<any>>

      The shared data type.

    Returns null | Class<ABSTRACT<any>>

  • Used to register a base parser for a Database type. Parsers are based on the Database Type, not the JS type. Only one parser can be assigned as the parser for a Database Type. For this reason, prefer neutral implementations.

    For instance, when implementing "parse" for a Date type, prefer returning a String rather than a Date object.

    The DataTypes.ABSTRACT#parseDatabaseValue method will then be called on the DataType instance defined by the user, which can decide on a more specific JS type (e.g. parse the date string & return a Date instance or a Temporal instance).

    You typically do not need to implement this method. This is used to provide default parsers when no DataType is provided (e.g. raw queries that don't specify a model). Sequelize already provides a default parser for most types. For a custom Data Type, implementing DataTypes.ABSTRACT#parseDatabaseValue is typically what you want.

    Parameters

    • databaseDataTypes: unknown[]

      Dialect-specific DB data type identifiers that will use this parser.

    • parser: TypeParser

      The parser function to call when parsing the data type. Parameters are dialect-specific.

    Returns void

  • Parameters

    • supportsOverwrite: {
          DEFAULT?: boolean;
          DEFAULT VALUES?: boolean;
          EXCEPTION?: boolean;
          IREGEXP?: boolean;
          LIMIT ON UPDATE?: boolean;
          ON DUPLICATE KEY?: boolean;
          ORDER NULLS?: boolean;
          REGEXP?: boolean;
          RIGHT JOIN?: boolean;
          UNION?: boolean;
          UNION ALL?: boolean;
          VALUES ()?: boolean;
          alterColumn?: { unique?: boolean; };
          autoIncrement?: { identityInsert?: boolean; defaultValue?: boolean; update?: boolean; };
          bulkDefault?: boolean;
          constraints?: { restrict?: boolean; deferrable?: boolean; unique?: boolean; default?: boolean; check?: boolean; foreignKey?: boolean; foreignKeyChecksDisableable?: boolean; primaryKey?: boolean; onUpdate?: boolean; add?: boolean; remove?: boolean; removeOptions?: { ...; }; };
          dataTypes?: { CHAR?: boolean; COLLATE_BINARY?: boolean; CITEXT?: boolean; INTS?: { zerofill?: boolean; unsigned?: boolean; }; REAL?: { scaleAndPrecision?: boolean; NaN?: boolean; infinity?: boolean; zerofill?: boolean; unsigned?: boolean; }; ... 16 more ...; TIME?: { ...; }; };
          dropTable?: { cascade?: boolean; };
          escapeStringConstants?: boolean;
          finalTable?: boolean;
          forShare?: "LOCK IN SHARE MODE" | "FOR SHARE";
          globalTimeZoneConfig?: boolean;
          groupedLimit?: boolean;
          index?: { collate?: boolean; length?: boolean; parser?: boolean; concurrently?: boolean; type?: boolean; using?: number | boolean; functionBased?: boolean; operator?: boolean; where?: boolean; include?: boolean; };
          indexHints?: boolean;
          indexViaAlter?: boolean;
          inserts?: { ignoreDuplicates?: string; updateOnDuplicate?: string | boolean; onConflictDoNothing?: string; onConflictWhere?: boolean; conflictFields?: boolean; };
          jsonExtraction?: { unquoted?: boolean; quoted?: boolean; };
          jsonOperations?: boolean;
          lock?: boolean;
          lockKey?: boolean;
          lockOf?: boolean;
          lockOuterJoinFailure?: boolean;
          maxExecutionTimeHint?: { select?: boolean; };
          migrations?: boolean;
          multiDatabases?: boolean;
          removeColumn?: { cascade?: boolean; ifExists?: boolean; };
          renameTable?: { changeSchema?: boolean; changeSchemaAndTable?: boolean; };
          returnValues?: false | "output" | "returning";
          schemas?: boolean;
          searchPath?: boolean;
          settingIsolationLevelDuringTransaction?: boolean;
          skipLocked?: boolean;
          tableHints?: boolean;
          tmpTableTrigger?: boolean;
          transactionOptions?: { type?: boolean; };
          transactions?: boolean;
          truncate?: { cascade?: boolean; };
          upserts?: boolean;
      }
      • Optional DEFAULT?: boolean
      • Optional DEFAULT VALUES?: boolean
      • Optional EXCEPTION?: boolean
      • Optional IREGEXP?: boolean

        Case-insensitive regexp operator support ('~*' in postgres).

      • Optional LIMIT ON UPDATE?: boolean
      • Optional ON DUPLICATE KEY?: boolean
      • Optional ORDER NULLS?: boolean
      • Optional REGEXP?: boolean
      • Optional RIGHT JOIN?: boolean
      • Optional UNION?: boolean
      • Optional UNION ALL?: boolean
      • Optional VALUES ()?: boolean
      • Optional alterColumn?: { unique?: boolean; }
      • Optional autoIncrement?: { identityInsert?: boolean; defaultValue?: boolean; update?: boolean; }
      • Optional bulkDefault?: boolean
      • Optional constraints?: { restrict?: boolean; deferrable?: boolean; unique?: boolean; default?: boolean; check?: boolean; foreignKey?: boolean; foreignKeyChecksDisableable?: boolean; primaryKey?: boolean; onUpdate?: boolean; add?: boolean; remove?: boolean; removeOptions?: { ...; }; }
      • Optional dataTypes?: { CHAR?: boolean; COLLATE_BINARY?: boolean; CITEXT?: boolean; INTS?: { zerofill?: boolean; unsigned?: boolean; }; REAL?: { scaleAndPrecision?: boolean; NaN?: boolean; infinity?: boolean; zerofill?: boolean; unsigned?: boolean; }; ... 16 more ...; TIME?: { ...; }; }
      • Optional dropTable?: { cascade?: boolean; }
      • Optional escapeStringConstants?: boolean

        This dialect supports E-prefixed strings, e.g. "E'foo'", which enables the ability to use backslash escapes inside of the string.

      • Optional finalTable?: boolean
      • Optional forShare?: "LOCK IN SHARE MODE" | "FOR SHARE"
      • Optional globalTimeZoneConfig?: boolean

        Whether this dialect supports changing the global timezone option

      • Optional groupedLimit?: boolean
      • Optional index?: { collate?: boolean; length?: boolean; parser?: boolean; concurrently?: boolean; type?: boolean; using?: number | boolean; functionBased?: boolean; operator?: boolean; where?: boolean; include?: boolean; }
      • Optional indexHints?: boolean
      • Optional indexViaAlter?: boolean
      • Optional inserts?: { ignoreDuplicates?: string; updateOnDuplicate?: string | boolean; onConflictDoNothing?: string; onConflictWhere?: boolean; conflictFields?: boolean; }
      • Optional jsonExtraction?: { unquoted?: boolean; quoted?: boolean; }

        Whether this dialect supports returning quoted & unquoted JSON strings

      • Optional jsonOperations?: boolean

        Whether this dialect supports SQL JSON functions

      • Optional lock?: boolean
      • Optional lockKey?: boolean
      • Optional lockOf?: boolean
      • Optional lockOuterJoinFailure?: boolean
      • Optional maxExecutionTimeHint?: { select?: boolean; }
      • Optional migrations?: boolean
      • Optional multiDatabases?: boolean

        Whether this dialect has native support for having multiple databases per instance (in the postgres or mssql sense). For the purposes of Sequelize, a database is considered to be a grouping of schemas. For instance, in MySQL, "CREATE DATABASE" creates what we consider to be a schema, so we do not consider that MySQL supports this option.

      • Optional removeColumn?: { cascade?: boolean; ifExists?: boolean; }
      • Optional renameTable?: { changeSchema?: boolean; changeSchemaAndTable?: boolean; }
      • Optional returnValues?: false | "output" | "returning"
      • Optional schemas?: boolean

        Whether this dialect has native support for schemas. For the purposes of Sequelize, a Schema is considered to be a grouping of tables. For instance, in MySQL, "CREATE DATABASE" creates what we consider to be a schema.

      • Optional searchPath?: boolean
      • Optional settingIsolationLevelDuringTransaction?: boolean
      • Optional skipLocked?: boolean
      • Optional tableHints?: boolean
      • Optional tmpTableTrigger?: boolean
      • Optional transactionOptions?: { type?: boolean; }
      • Optional transactions?: boolean
      • Optional truncate?: { cascade?: boolean; }
      • Optional upserts?: boolean

    Returns DialectSupports

Generated using TypeDoc