Skip to main content
zerotal

Documentation


Documentation / @zerotal/orm / index / SqliteDialect

Class: SqliteDialect

Defined in: packages/orm/src/db/dialects/SqliteDialect.ts:7

SQLite strategy — sqlite_master / pragma_table_info introspection, strftime() date parts, no advisory-lock primitive.

Implements

Constructors

Constructor

new SqliteDialect(): SqliteDialect

Returns

SqliteDialect

Properties

name

readonly name: "sqlite"

Defined in: packages/orm/src/db/dialects/SqliteDialect.ts:8

Implementation of

SqlDialect.name


supportsAdvisoryLocks

readonly supportsAdvisoryLocks: false = false

Defined in: packages/orm/src/db/dialects/SqliteDialect.ts:9

Whether the engine supports application-level advisory locks.

Implementation of

SqlDialect.supportsAdvisoryLocks

Methods

hasTableSql()

hasTableSql(table): DialectQuery

Defined in: packages/orm/src/db/dialects/SqliteDialect.ts:11

Introspection query returning at least one row when table exists.

Parameters

table

string

Returns

DialectQuery

Implementation of

SqlDialect.hasTableSql


hasColumnSql()

hasColumnSql(table, column): DialectQuery

Defined in: packages/orm/src/db/dialects/SqliteDialect.ts:18

Introspection query returning at least one row when column exists on table.

Parameters

table

string

column

string

Returns

DialectQuery

Implementation of

SqlDialect.hasColumnSql


dateExpr()

dateExpr(part, column): string

Defined in: packages/orm/src/db/dialects/SqliteDialect.ts:28

SQL expression extracting a date part from column. The caller must validate column as a safe identifier first — the expression is interpolated verbatim.

Parameters

part

DatePart

column

string

Returns

string

Implementation of

SqlDialect.dateExpr


autoIncrementColumn()

autoIncrementColumn(column): string

Defined in: packages/orm/src/db/dialects/SqliteDialect.ts:43

The column definition for an auto-incrementing integer primary key.

Every engine spells this differently and none of them accept SQLite's INTEGER PRIMARY KEY AUTOINCREMENT: PostgreSQL wants a serial/identity type, MySQL wants AUTO_INCREMENT. Hard-coding the SQLite form meant the first migrate against PostgreSQL died on a syntax error and MySQL on error 1064 — before any of the dialect-aware hasTable/ALTER handling downstream got a chance to matter.

Parameters

column

string

Already-validated column name.

Returns

string

The full column fragment, type and constraints included.

Implementation of

SqlDialect.autoIncrementColumn


advisoryLockSql()

advisoryLockSql(): DialectQuery | null

Defined in: packages/orm/src/db/dialects/SqliteDialect.ts:47

Statement acquiring an advisory lock (blocking), or null when unsupported.

Returns

DialectQuery | null

Implementation of

SqlDialect.advisoryLockSql


advisoryUnlockSql()

advisoryUnlockSql(): DialectQuery | null

Defined in: packages/orm/src/db/dialects/SqliteDialect.ts:51

Statement releasing an advisory lock, or null when unsupported.

Returns

DialectQuery | null

Implementation of

SqlDialect.advisoryUnlockSql