DIALECTSconstconst DIALECTS: readonly ["sqlite", "postgres", "duckdb"]The dialects: SQLite (and every driver of it: a file, libSQL, Turso, D1), PostgreSQL and DuckDB.
The dialects of SQL the stores speak, a closed list, and the largest object each holds. A dialect is a way of writing the same statements (how a name is quoted, how a parameter is written, what a binary column is called), never a different store: the library of the language of SQL (lang-sql) knows how each is written, and the driver of a database says which one it speaks.
import { DIALECTS, defaultMaxObject } from "./dialect.ts";
DIALECTS; // ["sqlite", "postgres", "duckdb"]
defaultMaxObject("sqlite"); // 67108864DIALECTSconstconst DIALECTS: readonly ["sqlite", "postgres", "duckdb"]The dialects: SQLite (and every driver of it: a file, libSQL, Turso, D1), PostgreSQL and DuckDB.
SqlDialecttypeno test imports ittype SqlDialect = (typeof DIALECTS)[number];One dialect of SQL.
isDialectfunctionfunction isDialect(text: string): text is "duckdb" | "postgres" | "sqlite"Whether a text is the name of a dialect.
DEFAULT_MAX_OBJECTconstconst DEFAULT_MAX_OBJECT: numberThe most a store holds of one object by default, in bytes: 64 MiB, far below what any of the engines holds in one value, so that a body is never cut and a refusal comes before the engine's own.
HARD_MAX_OBJECTconstconst HARD_MAX_OBJECT: Readonly<Record<"duckdb" | "postgres" | "sqlite", number>>The hard limit of one value of a dialect, in bytes: what the engine itself holds, which an option cannot raise.
defaultMaxObjectconstconst defaultMaxObject: (_dialect: "duckdb" | "postgres" | "sqlite") => numberThe default largest object of a dialect.