ReadonlynameThe name of the dialect
ReadonlylibraryThe database library or driver being used
Connect to the database
Disconnect from the database
Get the current connection
Check if connected
Execute a raw query
The SQL query string
Optionaloptions: QueryOptions
Query options
Execute 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)
Escape a value for use in a query
The value to escape
Escape an identifier (table name, column name, etc.)
The identifier to escape
Quote an identifier (column name, table name)
The identifier to quote
Quote a table name
The table name to quote
Optionalschema: string
Optional schema to prefix the table with
Create a schema
The schema name to create
Drop a schema
The schema name to drop
Optionaloptions: DropSchemaOptions
Drop options (e.g., cascade)
Show all schemas in the database
List all schemas in the database
Generate SQL for creating a database
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
Name of the extension to create
Optionaloptions: CreateExtensionOptions
Extension options
Drop a PostgreSQL extension
Name of the extension to drop
Optionaloptions: DropExtensionOptions
Drop options
Get all installed PostgreSQL extensions
Array of extension information
Check if a PostgreSQL extension is installed
Name of the extension
True if the extension is installed
Get database version
Create a new table
Name of the table
Column definitions
Optionaloptions: TableOptions
Additional options
Drop a table
Name of the table
Optionaloptions: DropTableOptions
Additional options
Create a partitioned table (PostgreSQL 10+)
Name of the table to create
Column definitions
Optionaloptions: TableOptions & {Table options including partition configuration
Create a partition for an existing partitioned table (PostgreSQL 10+)
Partition creation options
Attach a partition to a partitioned table (PostgreSQL 11+)
Partition attachment options
Detach a partition from a partitioned table (PostgreSQL 11+)
Partition detachment options
Create a database view
Name of the view to create
The SELECT query for the view
Optionaloptions: ViewOptions
View options (e.g., replace if exists)
Drop a database view
Name of the view to drop
Optionaloptions: DropViewOptions
Drop options
Add a column to a table
Name of the table
Name of the new column
Column definition
Remove a column from a table
Name of the table
Name of the column to remove
Change a column definition
Name of the table
Name of the column to change
New column definition
Rename a column
Name of the table
Current column name
New column name
Add a foreign key to a table
Name of the table
Name of the column
Name of the referenced table
Name of the referenced column
Optionaloptions: any
Foreign key options
Bulk insert records into a table
Name of the table
Array of records to insert
Optionaloptions: any
Insert options
Show all tables in the database
Show all views in the database
Show constraints for a table
Add a constraint to a table
Remove a constraint from a table
Show indexes for a table
Describe a table (get column information)
Name of the table
Rename a table
Current table name
New table name
Add an index to a table
Name of the table
Name of the index
Fields to index
Optionaloptions: IndexOptions
Index options
Remove an index from a table
Name of the table
Name of the index
Create an index on a table with full options support
Name of the table
Index definition
Create a fulltext index on a table
Name of the table
Name of the index
Fields to index
Optionaloptions: { parser?: string; comment?: string }
Fulltext index options
Create a spatial index on a table
Name of the table
Name of the index
Fields to index
Optionaloptions: { storage?: string; srid?: number }
Spatial index options
Drop an index from a table
Name of the table
Name of the index
Optionaloptions: DropIndexOptions
Drop options
Create a constraint on a table
Name of the table
Constraint definition
Drop a constraint from a table
Name of the table
Name of the constraint
Optionaloptions: DropConstraintOptions
Drop options
Change owner of a table or view
Create a foreign data wrapper (PostgreSQL)
Optionaloptions: { handler?: string }Drop a foreign data wrapper (PostgreSQL)
Optionaloptions: { ifExists?: boolean }Create a foreign server (PostgreSQL)
Optionaloptions: { options?: Record<string, string>; ifNotExists?: boolean }Create a foreign table (PostgreSQL)
Optionaloptions: { serverName?: string; ifNotExists?: boolean }Drop a security policy (MSSQL Row-Level Security)
Begin a new transaction
Optionaloptions: TransactionOptions
Transaction options
Commit a transaction
The transaction to commit
Rollback a transaction
The transaction to rollback
Build a WHERE clause from a WhereOptions object
The where options
Optionaloptions: BuildOptions
Build options
Build an ORDER BY clause
The order options
Optionaloptions: BuildOptions
Build options
Build a LIMIT/OFFSET clause
Optionallimit: string | number
Limit value
Optionaloffset: string | number
Offset value
Build an INSERT query
Table name
Values to insert
Optionaloptions: InsertOptions
Query options
Build an UPDATE query
Table name
Values to update
Where clause
Optionaloptions: UpdateOptions
Query options
Build a DELETE query
Table name
Where clause
Optionaloptions: DeleteOptions
Query options
Build a SELECT query
Select options
Build an UPSERT query (insert or update on conflict)
Table name
Values to insert/update
Optionaloptions: UpsertQueryOptions
Upsert options
Build an increment query
Table name
Fields to increment (field name or array of field names, or object with values)
Where clause
Optionaloptions: { by?: number }
Query options (by: number)
Replace placeholders in SQL with actual values Supports both named (:param) and positional (?) placeholders
SQL string with placeholders
Optionalreplacements: unknown[] | Record<string, unknown>
Values to replace (object for named, array for positional)
SQL with placeholders replaced with escaped values
Optionalopts: { ifExists?: boolean; cascade?: boolean }Create a user mapping for a foreign server
User name
Foreign server name
Optionaloptions: any
User mapping options
Drop a user mapping for a foreign server
User name
Foreign server name
Optionaloptions: anyOptionalopts: FdwImportForeignSchemaOptionsOptionaloptions: anyOptionaloptions: anyOptionalhost: stringOptionaloptions: anyOptionaloptions: anyOptionaloptions: anyOptionaloptions: anyOptionaloptions: DropStoredProcedureOptionsOptionaloptions: DropStoredProcedureOptionsOptionalschema: string
The contract every SQL engine implements.
A dialect owns everything engine-specific: identifier quoting, value escaping, how DDL is written, which clauses are legal, and how pagination and locking are spelled. Model code builds the same
FindOptionsregardless, and the dialect is the single place that turns it into SQL for one engine — which is whyLIMIT ... OFFSETon PostgreSQL becomesOFFSET ... FETCH NEXTon MSSQL without the caller changing.