IF Commons GitHub

governance/dialect

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-sql-governance FR-001

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"); // 67108864

Source: commons/anyfs-sql/src/governance/dialect.ts

5 of 6 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

DIALECTSconst
const DIALECTS: readonly ["sqlite", "postgres", "duckdb"]

The dialects: SQLite (and every driver of it: a file, libSQL, Turso, D1), PostgreSQL and DuckDB.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

SqlDialecttypeno test imports it
type SqlDialect = (typeof DIALECTS)[number];

One dialect of SQL.

isDialectfunction
function isDialect(text: string): text is "duckdb" | "postgres" | "sqlite"

Whether a text is the name of a dialect.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

DEFAULT_MAX_OBJECTconst
const DEFAULT_MAX_OBJECT: number

The 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.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

HARD_MAX_OBJECTconst
const 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.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

defaultMaxObjectconst
const defaultMaxObject: (_dialect: "duckdb" | "postgres" | "sqlite") => number

The default largest object of a dialect.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.