/** * GUCDI — deterministic Drizzle schema generator (pure). The first GENERATION * pass of the whole-app LCR vibe. Because the LCR plan's data model is already * well-typed (menu emits structured `data_contract` field types + relations), * the SQLite/Drizzle schema falls out mechanically — no LLM, no drift, testable. * * Structure → deterministic; content/judgment (seed data, surfaces) → LLM. This * is that boundary. Output mirrors the rewo LCR precedent: one `@story`-annotated * table per entity + inferred row types, SQLite-portable (brew swaps SQLite → * Postgres, inheriting the models). See docs/plans/vibe-whole-mock-lcr.md. */ import type { PlanEntity } from "./lcr-plan.js"; /** Table variable name: lower-first-letter of the entity (OperatorAuditLog → * operatorAuditLog, Wallet → wallet). */ export declare function tableVar(name: string): string; /** SQL table/column name: snake_case. */ export declare function snake(name: string): string; interface Mapped { /** the drizzle column expression sans chaining, e.g. `text("status", { enum: [...] })` */ expr: string; /** which top-level drizzle builders this used (for the import line) */ builder: "text" | "integer" | "real"; } /** Map a data_contract field type → a Drizzle SQLite column builder. Robust to * the `|null` nullability suffix (stripped by the caller) and unknown types * (default to text). */ export declare function mapType(rawType: string, sqlName: string): Mapped; /** Parse a relation declaration into (sourceField → targetEntity.targetField). * Accepts `Entity.field → Target.tcol`, `field → Target.tcol`, with `→` or `->`. */ export declare function parseRelation(rel: string): { field: string; targetEntity: string; targetField: string; } | null; /** Generate the full `schema.ts` content from the plan's entity model. */ export declare function compileDrizzleSchema(entities: PlanEntity[]): string; /** SQLite storage affinity for a data_contract type. The mock runs a real * in-browser SQLite (sql.js) seeded at boot; these are the CREATE TABLE types. */ export declare function sqliteType(rawType: string): "TEXT" | "INTEGER" | "REAL"; /** Generate CREATE TABLE DDL from the plan's entity model — run by the mock's * sql.js bootstrap to materialise the schema in the in-browser DB. Deterministic * twin of compileDrizzleSchema; enum fields get a CHECK constraint, `id` is the * PK, relations become inline REFERENCES (skipped on the PK / unknown targets). */ export declare function compileSqliteDdl(entities: PlanEntity[]): string; /** Deterministic db-bootstrap module (db.ts): a real in-browser SQLite (sql.js) * created + DDL-materialised + seeded once at boot, exposed as a Drizzle db so * the mock's query layer runs real SQL — the mock→prod swap is then a * data-source change, not a rewrite. Pure template (no entity-specific content); * the seed (seed.ts) + query adaptor (queries.ts) are the LLM pass. */ export declare function dbBootstrapTs(): string; export {}; //# sourceMappingURL=schema-gen.d.ts.map