AbstractAbstract ReadonlynameThe name of the dialect
Abstract ReadonlylibraryThe database library or driver being used
Protected_Protected_ProtecteddialectAbstractconnectConnect to the database
AbstractdisconnectDisconnect from the database
AbstractgetGet the current connection
AbstractisCheck if connected
AbstractqueryExecute a raw query
The SQL query string
Optionaloptions: QueryOptions
Query options
AbstractqueryExecute a query and stream the results back as a Node.js Readable
(object mode — one row, or one model instance when options.mapToModel
is set, per chunk) instead of buffering the whole result set in memory.
Used by Model.findAllStream()/findAllIterate() for processing large
tables without loading them all into memory at once.
Native server-side cursor support (postgres/mysql/cockroachdb) is used where the driver has it; other dialects fall back to LIMIT/OFFSET-paged queries — correct and dialect-agnostic, though it does more round trips than a real cursor for very large result sets.
The SQL query string to stream results for
Optionaloptions: StreamOptions
Streaming options (batch size, backpressure watermark, model mapping)
AbstractescapeEscape a value for use in a query
The value to escape
AbstractescapeEscape an identifier (table name, column name, etc.)
The identifier to escape
AbstractquoteQuote an identifier (column name, table name)
The identifier to quote
AbstractquoteQuote a table name
The table name to quote
Optionalschema: string
Optional schema to prefix the table with
AbstractgetGet database version
AbstractcreateCreate a new table
Name of the table
Column definitions
Optionaloptions: TableOptions
Additional options
AbstractdropDrop a table
Name of the table
Optionaloptions: DropTableOptions
Additional options
AbstractcreateCreate a partitioned table (PostgreSQL 10+)
Optionaloptions: TableOptions & {AbstractcreateCreate a partition for an existing partitioned table (PostgreSQL 10+)
AbstractattachAttach a partition to a partitioned table (PostgreSQL 11+)
AbstractdetachDetach a partition from a partitioned table (PostgreSQL 11+)
AbstractdropAbstractcreateCreate a database view
Name of the view to create
The SELECT query for the view
Optionaloptions: ViewOptions
View options
AbstractdropDrop a database view
Name of the view to drop
Optionaloptions: DropViewOptions
Drop options
AbstractcreateCreate a materialized view (PostgreSQL only)
Materialized view options
AbstractrefreshRefresh a materialized view (PostgreSQL only)
Name of the materialized view to refresh
Optionaloptions: RefreshOptions
Refresh options
AbstractdropDrop a materialized view (PostgreSQL only)
Name of the materialized view to drop
Optionaloptions: DropMaterializedViewOptions
Drop options
AbstracthasCheck if a materialized view exists (PostgreSQL only)
Name of the materialized view
True if the materialized view exists
AbstractcreateCreate a stored procedure
Stored procedure options
Create a stored procedure (alias for createStoredProcedure)
Stored procedure options
AbstractdropDrop a stored procedure
Name of the stored procedure
Optionaloptions: DropStoredProcedureOptions
Drop options
Drop a stored procedure (alias for dropStoredProcedure)
Name of the stored procedure
Optionaloptions: DropStoredProcedureOptions
Drop options
AbstractexecuteExecute a stored procedure
Execute options
Query result
AbstracthasCheck if a stored procedure exists
Name of the stored procedure
Optionalschema: string
Schema name (PostgreSQL)
True if the stored procedure exists
AbstractcreateAbstractdropDrop a trigger
Name of the trigger
Table the trigger is attached to
Optionaloptions: DropTriggerOptions
Drop options
AbstracthasCheck if a trigger exists
Name of the trigger
Table the trigger is attached to
True if the trigger exists
AbstractcreateCreate a sequence (PostgreSQL)
Sequence options
AbstractdropDrop a sequence (PostgreSQL)
Name of the sequence
Optionaloptions: DropSequenceOptions
Drop options
AbstractnextGet next value from a sequence (PostgreSQL)
Name of the sequence
Next sequence value
AbstracthasCheck if a sequence exists (PostgreSQL)
Name of the sequence
True if the sequence exists
AbstractcreateCreate a policy (PostgreSQL RLS)
Policy options
AbstractdropDrop a policy (PostgreSQL RLS)
Name of the policy
Table name
Optionaloptions: DropPolicyOptions
Drop options
AbstractenableEnable row-level security on a table (PostgreSQL)
Table name
Optionalschema: string
Schema name
AbstractdisableDisable row-level security on a table (PostgreSQL)
Table name
Optionalschema: string
Schema name
AbstracthasCheck if a policy exists (PostgreSQL RLS)
Name of the policy
Table name
True if the policy exists
AbstractcommentAdd comment to a table
Table name
Comment text
AbstractcommentAdd comment to a column
Table name
Column name
Comment text
AbstractcreateCreate a partial index (index with WHERE clause)
Table name
Index name
Fields to index
WHERE clause for partial index
Optionaloptions: IndexOptions
Additional index options
AbstractcreateCreate an expression index
Table name
Index name
Expression for the index
Optionaloptions: IndexOptions
Additional index options
AbstractcreateCreate an identity column
Table name
Column name
Optionaloptions: {Identity options
AbstractcreateCreate a computed column
Table name
Column name
Expression for computed column
Optionaloptions: { persisted?: boolean; type?: string }
Computed column options
AbstractaddAdd a column to a table
Name of the table
Name of the new column
Column definition
AbstractremoveRemove a column from a table
Name of the table
Name of the column to remove
AbstractchangeChange a column definition
Name of the table
Name of the column to change
New column definition
Rename a column (default throws error)
Add a foreign key (default throws error)
Optional_options: anyBulk insert records (default implementation)
Optional_options: anyAbstractshowShow all tables in the database
AbstractshowShow all views in the database
AbstractshowAbstractshowShow constraints for a table
AbstractaddAdd a constraint to a table
AbstractremoveRemove a constraint from a table
AbstractshowShow indexes for a table
AbstractdescribeDescribe a table (get column information)
Name of the table
AbstractrenameRename a table
Current table name
New table name
AbstractaddAdd an index to a table
Name of the table
Name of the index
Fields to index
Optionaloptions: IndexOptions
Index options
AbstractremoveRemove an index from a table
Name of the table
Name of the index
AbstractcreateCreate an index on a table with full options support
Name of the table
Index definition
Create a fulltext index (default throws error)
Optional_options: { parser?: string; comment?: string }Create a spatial index (default throws error)
Optional_options: { storage?: string; srid?: number }AbstractdropDrop an index from a table
Name of the table
Name of the index
Optionaloptions: DropIndexOptions
Drop options
AbstractcreateCreate a constraint on a table
Name of the table
Constraint definition
AbstractdropDrop a constraint from a table
Name of the table
Name of the constraint
Optionaloptions: DropConstraintOptions
Drop options
AbstractchangeChange owner of a table or view
AbstractcreateCreate a foreign data wrapper (PostgreSQL)
Optionaloptions: { handler?: string }AbstractdropDrop a foreign data wrapper (PostgreSQL)
Optionaloptions: { ifExists?: boolean }AbstractcreateCreate a foreign server (PostgreSQL)
Optionaloptions: { options?: Record<string, string>; ifNotExists?: boolean }AbstractdropAbstractcreateCreate a foreign table (PostgreSQL)
Optionaloptions: { serverName?: string; ifNotExists?: boolean }AbstractcreateAbstractdropDrop a security policy (MSSQL Row-Level Security)
AbstractstartBegin a new transaction
Optionaloptions: TransactionOptions
Transaction options
AbstractcommitCommit a transaction
The transaction to commit
AbstractrollbackRollback a transaction
The transaction to rollback
AbstractgetAbstractbuildBuild a WHERE clause from a WhereOptions object
The where options
Optionaloptions: BuildOptions
Build options
AbstractbuildBuild an ORDER BY clause
The order options
Optionaloptions: BuildOptions
Build options
AbstractbuildBuild a LIMIT/OFFSET clause
Optionallimit: string | number
Limit value
Optionaloffset: string | number
Offset value
AbstractbuildBuild an INSERT query
Table name
Values to insert
Optionaloptions: InsertOptions
Query options
AbstractbuildBuild an UPDATE query
Table name
Values to update
Where clause
Optionaloptions: UpdateOptions
Query options
AbstractbuildBuild a DELETE query
Table name
Where clause
Optionaloptions: DeleteOptions
Query options
AbstractbuildBuild a SELECT query
Select options
AbstractcreateCreate a schema
The schema name to create
AbstractdropDrop a schema
The schema name to drop
Optionaloptions: DropSchemaOptions
Drop options
AbstractshowShow all schemas in the database
List all schemas in the database
Generate SQL for creating a database (default implementation)
Database creation options
Generate SQL for dropping a database
Database name to drop
Generate SQL for creating a savepoint
Optionalname: string
Savepoint name (optional, will be generated if not provided)
Generate SQL for releasing a savepoint
Savepoint name to release
Generate SQL for rolling back to a savepoint
Savepoint name to rollback to
Create a PostgreSQL extension (only supported in PostgreSQL)
Optional_options: CreateExtensionOptionsDrop a PostgreSQL extension (only supported in PostgreSQL)
Optional_options: DropExtensionOptionsGet all installed PostgreSQL extensions (only supported in PostgreSQL)
Array of extension information
Check if a PostgreSQL extension is installed (only supported in PostgreSQL)
True if the extension is installed
Create a PostgreSQL enum type (only supported in PostgreSQL)
Optional_options: CreateEnumTypeOptionsDrop a PostgreSQL type (only supported in PostgreSQL)
Optional_options: DropTypeOptionsCreate a PostgreSQL domain (only supported in PostgreSQL)
Optional_options: CreateDomainOptionsDrop a PostgreSQL domain (only supported in PostgreSQL)
Optional_options: DropDomainOptionsOptional_opts: { ifExists?: boolean; cascade?: boolean }Create a user mapping (default throws error)
Optional_options: anyDrop a user mapping (default throws error)
Optional_options: anyOptional_opts: FdwImportForeignSchemaOptionsOptional_options: anyOptional_options: anyOptional_host: stringOptional_options: anyOptional_options: anyOptional_options: anyOptional_options: anyAbstractbuildBuild an UPSERT query (insert or update on conflict)
Table name
Values to insert/update
Optionaloptions: UpsertQueryOptions
Upsert options
Build an UPSERT query (insert or update on conflict)
Table name
Values to insert/update
Optionaloptions: UpsertQueryOptions
Upsert options
AbstractbuildBuild an increment query
Table name
Fields to increment
Where clause
Optionaloptions: { by?: number }
Query options (by: number)
Build a JSON/JSONB path query Default implementation using common JSON extraction syntax
The JSON/JSONB column name
The JSON path to access (e.g., 'key' or 'key.subkey')
Optionalvalue: unknown
The value to compare against (optional)
The comparison operator to use (defaults to =)
SQL fragment and values for the JSON query
ProtectedformatFormat a value for SQL based on its type
ProtectedformatFormat a date for SQL
Replace placeholders in SQL with actual values Supports both named (:param) and positional (?) placeholders Properly escapes values to prevent SQL injection
Optionalreplacements: unknown[] | Record<string, unknown>ProtectedreplaceReplace positional (?) placeholders with escaped values
ProtectedreplaceReplace named (:param) placeholders with escaped values
ProtectedescapeEscape a replacement value for safe inclusion in SQL
ProtectedparseProtectedgetGet the isolation level SQL
OptionalisolationLevel: stringProtectedresolveResolve the 'all' include option to actual include configurations
ProtectedgenerateGenerate column list with proper aliasing to avoid duplicates
Optionalattributes: string[] | { include?: string[]; exclude?: string[] }Optionalincludes: { tableName: string; alias: string }[]ProtectedflattenFlatten nested includes to handle 'all' option
Abstract base class for database dialects Provides common functionality for all dialect implementations