SQLite dialect implementation.

Generates standard SQLite SQL syntax including INSERT OR IGNORE, INSERT OR REPLACE, json_extract(), ifnull(), PRAGMA, and positional ? placeholders.

Implements

Constructors

Properties

name: "sqlite" = ...

Dialect identifier.

Methods

  • Generate an INSERT OR IGNORE statement. SQLite: INSERT OR IGNORE INTO t (a, b) VALUES (?, ?) Postgres: INSERT INTO t (a, b) VALUES ($1, $2) ON CONFLICT DO NOTHING

    Parameters

    • table: string
    • columns: string[]
    • placeholders: string[]

    Returns string

  • Generate an INSERT OR REPLACE (upsert) statement. SQLite: INSERT OR REPLACE INTO t (a, b) VALUES (?, ?) Postgres: INSERT INTO t (a, b) VALUES ($1, $2) ON CONFLICT (pk) DO UPDATE SET ...

    Parameters

    • table: string
    • columns: string[]
    • placeholders: string[]
    • Optional_primaryKey: string

    Returns string

  • Generate a JSON field extraction expression. SQLite: json_extract(col, '$.key') Postgres: (col::jsonb)->>'key'

    Parameters

    • column: string
    • jsonPath: string

    Returns string

  • Generate a null-coalesce expression. SQLite: ifnull(expr, fallback) Postgres: COALESCE(expr, fallback)

    Parameters

    • expr: string
    • fallback: string

    Returns string

  • Generate a PRAGMA statement or equivalent. SQLite: PRAGMA key = value Postgres: returns null (skip — Postgres enforces FKs by default, etc.)

    Parameters

    • key: string
    • value: string

    Returns null | string