SCHEMA_VERSIONconstconst SCHEMA_VERSION: 3The version of the layout this library writes.
The layout of the tables, as data a reader of the database can use without the library: what each table holds and what each column means, and the versions of the layout in order. The layout is the same in every dialect (a column is a text, an integer or bytes, and each dialect names the type its own way); a newer layout only adds, and a database of a newer layout than the library knows is refused and never changed.
import { LAYOUT, SCHEMA_VERSION } from "./schema.ts";
SCHEMA_VERSION; // 3
LAYOUT.filter((c) => c.table === "versions").map((c) => c.column); // ["id", "sum", "replica", "seq", "path", "parent", "merged", "kind", "blob"]SCHEMA_VERSIONconstconst SCHEMA_VERSION: 3The version of the layout this library writes.
LAYOUT_NAMEconstconst LAYOUT_NAME: "anyfs-sql-merge"The name the layout has in the facts of a database: the version rows and the blobs of a store that merges.
ColumnKindtypeno test imports ittype ColumnKind = "text" | "integer" | "bytes" | "tsvector";What a column holds, in the words of every dialect.
Columntypeno test imports ittype Column = { readonly table: TableRole; readonly column: string; readonly kind: ColumnKind; readonly since: number; readonly means: string };One column of the layout: the table, its name, what it holds and what it means.
LAYOUTconstconst LAYOUT: readonly Column[]The columns of every table and view, in order: the documented layout. A catalog reads these and no other.
MIGRATION_PLANconstconst MIGRATION_PLAN: readonly { readonly version: number; readonly name: string; readonly destructive: boolean; }[]What a version of the layout adds, in order: the plan of the migrations. The version rows are the only layout there is: a database of an earlier layout is not migrated and is refused.