@vibeorm/schema 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # @vibeorm/schema
2
+
3
+ > Part of **[VibeORM](https://github.com/vibeorm/vibeorm)** — a type-safe TypeScript ORM for Bun and Node. Prisma-schema or TypeScript-DSL input, a canonical schema IR, a generated client, and a dialect-aware SQL layer over PostgreSQL, PGlite, SQLite and MySQL.
4
+
5
+ The canonical Schema IR: the data shape every other VibeORM package reads. It exists as its own package because the parser, the DSL, the generator, migrate and the runtime all need the same schema type without depending on each other.
6
+
7
+ ```bash
8
+ bun add @vibeorm/schema@alpha
9
+ ```
10
+
11
+ > **Pre-release.** `2.0.0-alpha.x`, published under the `alpha` dist-tag. `npm i vibeorm` still resolves to the stable v1 line.
12
+
13
+ Most users never install this directly — it ships as a dependency of [`vibeorm`](https://www.npmjs.com/package/vibeorm). Reach for it when you are building tooling on the IR or SQL layer.
14
+
15
+ ## What it exports
16
+
17
+ - **The IR types**: `SchemaIR`, `ModelIR`, `FieldIR`, `RelationIR`, `IndexIR`, `IndexFieldIR`, `EnumIR`, `DatasourceIR`, `ExtensionDeclIR`, plus the enumerations `FieldType`, `ScalarType`, `RelationType`, `IndexKind`, `CascadeAction`, `DefaultValueIR`. Helpers: `isEnumType`, `providerToDialect`, `DIALECTS`.
18
+ - **Validation**: `validateSchemaIR({ schema })` returns `ValidationIssue[]`; `assertValidSchemaIR` throws instead. Both are shared by the parser and the DSL, so an IR built either way is held to one set of structural rules.
19
+ - **Dialect identity**: the `Provider` and `Dialect` types, and the `DialectCapabilities` / `FullTextEngine` shapes. The capability *tables* themselves live in [`@vibeorm/sql`](https://github.com/vibeorm/vibeorm/tree/master/packages/sql); this package only fixes their shape.
20
+ - **Errors**: `VibeError`, the `VibeErrorCode` union, the `VIBE_ERROR_CODES` list, and the constructors `internalError` and `unsupportedCapability`. Every error VibeORM throws is a `VibeError` with a stable `code`, so callers branch on codes and never on message text.
21
+ - **Reserved names**: `RESERVED_CLIENT_NAMES`, `RESERVED_DELEGATE_NAMES`, `isReservedClientName`, `isReservedDelegateName` — the collision guard between user models and the client surface.
22
+ - **The implicit many-to-many rule**: `implicitJoinTable` and `ImplicitJoinTable`. One shared definition of the join table an implicit m2m relation maps to, used by the parser and by migrate.
23
+ - **The extension framework**: `defineExtension`, `buildExtensionRegistry`, `extensionDeclarations`, `mergeExtensionDeclarations`, `extensionManifestEntry`, `extensionOptionsHash`, `EMPTY_EXTENSION_REGISTRY`, and the `VibeExtension` / `ExtensionRegistry` types.
24
+
25
+ ## The error codes
26
+
27
+ | Code | Meaning |
28
+ |---|---|
29
+ | `VIBE_NOT_FOUND` | `findUniqueOrThrow` / `findFirstOrThrow` / `update` / `delete` target missing |
30
+ | `VIBE_UNIQUE_VIOLATION` | unique constraint violation (driver-mapped) |
31
+ | `VIBE_FK_VIOLATION` | foreign key constraint violation (driver-mapped) |
32
+ | `VIBE_VALIDATION` | input failed validation before reaching the database |
33
+ | `VIBE_SCHEMA_INVALID` | schema failed structural validation |
34
+ | `VIBE_UNSUPPORTED_CAPABILITY` | feature requested on a dialect that does not support it |
35
+ | `VIBE_STALE_CLIENT` | generated client is stale relative to config/schema |
36
+ | `VIBE_CONFIG` | configuration problem (config file, flags, env) |
37
+ | `VIBE_MIGRATION` | migration engine failure, including checksum mismatch |
38
+ | `VIBE_TRANSACTION` | transaction begin/commit/rollback/serialization failure |
39
+ | `VIBE_ADAPTER` | driver or connection failure without a more specific code |
40
+ | `VIBE_INTERNAL` | invariant broken inside VibeORM; always a bug |
41
+
42
+ ## Why the IR is the only currency
43
+
44
+ Both schema inputs compile to `SchemaIR`: the `.prisma` parser ([`@vibeorm/parser`](https://github.com/vibeorm/vibeorm/tree/master/packages/parser)) and the TypeScript DSL ([`@vibeorm/dsl`](https://github.com/vibeorm/vibeorm/tree/master/packages/dsl)). Nothing downstream parses schema text.
45
+
46
+ The generator, migrate and the runtime read the IR and only the IR. That is what makes the two input formats interchangeable, and what makes `vibeorm convert` a mechanical translation in both directions rather than a rewrite.
47
+
48
+ ## Links
49
+
50
+ - [Documentation](https://github.com/vibeorm/vibeorm/tree/master/docs)
51
+ - [Getting started](https://github.com/vibeorm/vibeorm/blob/master/docs/getting-started.md)
52
+ - [Repository and issues](https://github.com/vibeorm/vibeorm)
53
+ - MIT licensed
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Dialect capability shape.
3
+ *
4
+ * The concrete per-dialect tables live with the dialect implementations in
5
+ * @vibeorm/sql (and are snapshot-tested there). Runtime, migrate, generator and
6
+ * the E2E harness all consume the SAME object — so what we claim, we test.
7
+ */
8
+ /** Full-text engines the `search` extension can target. */
9
+ export type FullTextEngine = "bm25" | "tsvector" | "fts5" | "fulltext";
10
+ export type DialectCapabilities = {
11
+ /** INSERT/UPDATE/DELETE ... RETURNING. False ⇒ insertId + re-select fallback. */
12
+ readonly returning: boolean;
13
+ /** Native scalar array columns (String[], Int[], ...). */
14
+ readonly scalarArrays: boolean;
15
+ /** Native enum column types (CREATE TYPE / inline ENUM). */
16
+ readonly nativeEnums: boolean;
17
+ /** Native ILIKE operator. False ⇒ LOWER() LIKE LOWER() strategy. */
18
+ readonly ilike: boolean;
19
+ /** LATERAL JOIN relation strategy ("join") availability. */
20
+ readonly lateralJoin: boolean;
21
+ /** Native DISTINCT ON. */
22
+ readonly distinctOn: boolean;
23
+ /** Partial (predicate) indexes. */
24
+ readonly partialIndexes: boolean;
25
+ /** DDL participates in transactions (mysql auto-commits DDL). */
26
+ readonly transactionalDdl: boolean;
27
+ /** createManyAndReturn support (requires multi-row RETURNING). */
28
+ readonly createManyAndReturn: boolean;
29
+ /** A real JSON column type (vs TEXT storage). */
30
+ readonly jsonColumnType: boolean;
31
+ /** Native NULLS FIRST/LAST in ORDER BY. False ⇒ IS NULL emulation term. */
32
+ readonly orderByNulls: boolean;
33
+ /** Full-text engines available on this dialect (first = preferred). */
34
+ readonly fullTextEngines: readonly FullTextEngine[];
35
+ };
36
+ //# sourceMappingURL=capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;AAIvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,0BAA0B;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,mCAAmC;IACnC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,iEAAiE;IACjE,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,kEAAkE;IAClE,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,iDAAiD;IACjD,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,eAAe,EAAE,SAAS,cAAc,EAAE,CAAC;CACrD,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The VibeORM v2 error contract.
3
+ *
4
+ * Every error thrown by any @vibeorm package is a VibeError carrying a stable
5
+ * string code. Callers branch on `error.code` — never on message text (the v1
6
+ * mistake this replaces). Adapters map driver errors to these codes via
7
+ * per-driver tables.
8
+ */
9
+ export declare const VIBE_ERROR_CODES: readonly ["VIBE_NOT_FOUND", "VIBE_UNIQUE_VIOLATION", "VIBE_FK_VIOLATION", "VIBE_VALIDATION", "VIBE_SCHEMA_INVALID", "VIBE_UNSUPPORTED_CAPABILITY", "VIBE_STALE_CLIENT", "VIBE_CONFIG", "VIBE_MIGRATION", "VIBE_TRANSACTION", "VIBE_ADAPTER", "VIBE_INTERNAL"];
10
+ export type VibeErrorCode = (typeof VIBE_ERROR_CODES)[number];
11
+ /**
12
+ * Base error for all VibeORM failures.
13
+ *
14
+ * @example
15
+ * try { await db.user.findUniqueOrThrow({ where: { id } }); }
16
+ * catch (e) {
17
+ * if (e instanceof VibeError && e.code === "VIBE_NOT_FOUND") { ... }
18
+ * }
19
+ */
20
+ export declare class VibeError extends Error {
21
+ readonly code: VibeErrorCode;
22
+ readonly meta: Readonly<Record<string, unknown>>;
23
+ constructor(params: {
24
+ code: VibeErrorCode;
25
+ message: string;
26
+ meta?: Record<string, unknown>;
27
+ cause?: unknown;
28
+ });
29
+ }
30
+ /** Standard capability error — used by sql/runtime/migrate/generator alike. */
31
+ export declare function unsupportedCapability(params: {
32
+ dialect: string;
33
+ feature: string;
34
+ hint?: string;
35
+ }): VibeError;
36
+ /** Internal invariant violation — always indicates a VibeORM bug. */
37
+ export declare function internalError(params: {
38
+ message: string;
39
+ meta?: Record<string, unknown>;
40
+ }): VibeError;
41
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,gBAAgB,+PAyBnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAI9D;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAClC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;gBAErC,MAAM,EAAE;QAClB,IAAI,EAAE,aAAa,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CAMF;AAID,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,SAAS,CAOZ;AAED,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,SAAS,CAMpG"}
@@ -0,0 +1,334 @@
1
+ /**
2
+ * Extension framework contract (plan §10, extensions.md).
3
+ *
4
+ * Hook types live HERE so every package can consume them without cycles:
5
+ * extensions implement them (tier 1 in @vibeorm/extensions), parser/dsl route
6
+ * schema attributes through the registry, migrate applies artifact DDL,
7
+ * the generator bakes client surfaces (D9), and the runtime mounts them.
8
+ *
9
+ * All hook signatures are dependency-free on purpose: DDL is dialect-correct
10
+ * SQL text (never migrate step objects), SQL fragments are neutral part lists
11
+ * (@vibeorm/sql renders them), and client contributions are JS/d.ts text.
12
+ */
13
+ import type { Dialect, ModelIR, Provider, SchemaIR } from "./ir.ts";
14
+ /** Scalar-ish values an extension attribute argument may carry. */
15
+ export type ExtensionAttributeValue = string | number | boolean | readonly string[] | readonly number[];
16
+ /**
17
+ * One occurrence of an extension attribute, normalized identically by the
18
+ * .prisma parser and the TS DSL (source equivalence is tested — LEARNINGS F2).
19
+ */
20
+ export type ExtensionAttributeArgs = {
21
+ /** The positional field-list argument (`[title, body]`), when present. */
22
+ readonly fields?: readonly string[];
23
+ /** Named arguments (`name: "x"`, `weights: [2, 1]`, `dims: 1536`). */
24
+ readonly named: Readonly<Record<string, ExtensionAttributeValue>>;
25
+ };
26
+ /** A model-level attribute the extension registers (`@@search(...)`). */
27
+ export type ExtensionModelAttribute = {
28
+ /** Attribute name without the `@@` prefix. */
29
+ readonly name: string;
30
+ /**
31
+ * Validate and normalize one occurrence into declaration data. Returning
32
+ * `{ error }` rejects the schema with VIBE_SCHEMA_INVALID at parse time.
33
+ */
34
+ readonly parse: (ctx: {
35
+ readonly model: string;
36
+ readonly args: ExtensionAttributeArgs;
37
+ /** Scalar/enum field names on the model, for validation. */
38
+ readonly fieldNames: readonly string[];
39
+ }) => {
40
+ readonly declaration: Readonly<Record<string, unknown>>;
41
+ } | {
42
+ readonly error: string;
43
+ };
44
+ };
45
+ /** A column type the extension registers (`embedding Vector(1536)`). */
46
+ export type ExtensionFieldType = {
47
+ /** Type name as written in the schema — e.g. "Vector". */
48
+ readonly name: string;
49
+ /**
50
+ * Lower one field to a database-native column type. The field lands in the
51
+ * IR exactly like `Unsupported("<nativeType>")` (kept for DDL, excluded from
52
+ * the core queryable surface); the declaration is merged into the
53
+ * extension's ExtensionDeclIR for downstream planes.
54
+ */
55
+ readonly lower: (ctx: {
56
+ readonly model: string;
57
+ readonly field: string;
58
+ /** Positional type arguments (`Vector(1536)` → [1536]). */
59
+ readonly args: readonly (string | number)[];
60
+ }) => {
61
+ readonly nativeType: string;
62
+ readonly declaration?: Readonly<Record<string, unknown>>;
63
+ } | {
64
+ readonly error: string;
65
+ };
66
+ };
67
+ /**
68
+ * The database object an artifact owns. Migrate uses this identity to
69
+ * (a) hide extension-owned objects from the introspected IR before diffing —
70
+ * so the core differ never schedules their drop — and (b) decide whether the
71
+ * artifact is missing and must be created.
72
+ */
73
+ export type ExtensionArtifactOwner = {
74
+ readonly kind: "postgresExtension";
75
+ readonly name: string;
76
+ } | {
77
+ readonly kind: "column";
78
+ readonly table: string;
79
+ readonly column: string;
80
+ } | {
81
+ readonly kind: "index";
82
+ readonly table: string;
83
+ readonly name: string;
84
+ } | {
85
+ readonly kind: "table";
86
+ readonly name: string;
87
+ /** Auxiliary tables created alongside (FTS5's `_data`, `_idx`, …). */
88
+ readonly auxiliaryPrefixes?: readonly string[];
89
+ } | {
90
+ readonly kind: "trigger";
91
+ readonly table: string;
92
+ readonly name: string;
93
+ };
94
+ /**
95
+ * One extension-owned database object with dialect-correct DDL. `create`
96
+ * statements must be idempotent wherever the dialect allows (IF NOT EXISTS),
97
+ * so replays and partial applies converge.
98
+ */
99
+ export type ExtensionArtifact = {
100
+ /** Stable identity, e.g. "search:Post:index". Used in logs and errors. */
101
+ readonly id: string;
102
+ readonly owns: ExtensionArtifactOwner;
103
+ readonly create: readonly string[];
104
+ readonly drop: readonly string[];
105
+ };
106
+ /** Context handed to schema-scoped extension hooks. */
107
+ export type ExtensionSchemaContext = {
108
+ readonly schema: SchemaIR;
109
+ readonly dialect: Dialect;
110
+ readonly provider: Provider;
111
+ /** The extension factory's own options (from config / VibeClient). */
112
+ readonly options: Readonly<Record<string, unknown>>;
113
+ /** Normalized per-model declarations gathered from schema attributes. */
114
+ readonly declarations: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
115
+ };
116
+ export type ExtensionMigratePlane = {
117
+ /**
118
+ * Every database object this extension needs for the given schema on the
119
+ * given dialect/provider. Called by `db push` and `migrate generate`.
120
+ * Must throw VIBE_UNSUPPORTED_CAPABILITY for a dialect that cannot ever
121
+ * satisfy the declaration (earliest knowable moment).
122
+ */
123
+ readonly artifacts: (ctx: ExtensionSchemaContext) => readonly ExtensionArtifact[];
124
+ };
125
+ /**
126
+ * A neutral bound SQL fragment: literal text, bound parameters and quoted
127
+ * identifiers, in order. @vibeorm/sql renders it (placeholders through
128
+ * ParamCollector, identifiers through dialect.quoteIdent) — extensions never
129
+ * hand-write `$1`/`?` or quotes.
130
+ */
131
+ export type SqlFragmentPart = string | {
132
+ readonly param: unknown;
133
+ } | {
134
+ readonly ident: readonly string[];
135
+ };
136
+ export type SqlFragmentSpec = {
137
+ readonly parts: readonly SqlFragmentPart[];
138
+ };
139
+ /** A where-operator the extension contributes (`{ name: { similarTo: "x" } }`). */
140
+ export type ExtensionWhereOperator = {
141
+ /** Operator key as written in `where` objects. */
142
+ readonly name: string;
143
+ /**
144
+ * Compile one use to a fragment. `column` is the already-resolved column
145
+ * reference (alias-qualified by the caller via `ident`).
146
+ */
147
+ readonly compile: (ctx: {
148
+ /** Identifier path for the column, e.g. ["t0", "name"] or ["name"]. */
149
+ readonly column: readonly string[];
150
+ readonly operand: unknown;
151
+ readonly dialect: Dialect;
152
+ readonly provider: Provider;
153
+ readonly options: Readonly<Record<string, unknown>>;
154
+ }) => {
155
+ readonly fragment: SqlFragmentSpec;
156
+ } | {
157
+ readonly error: string;
158
+ };
159
+ };
160
+ export type ExtensionSqlPlane = {
161
+ readonly whereOperators?: readonly ExtensionWhereOperator[];
162
+ };
163
+ export type ExtensionImportSpec = {
164
+ readonly from: string;
165
+ readonly names: readonly string[];
166
+ };
167
+ /**
168
+ * What the generator bakes for one scope. `runtimeGlue` is a JS expression
169
+ * (may reference identifiers from `imports`) evaluating to the mount factory
170
+ * the runtime calls with a MountContext; `dts` lines land inside the delegate
171
+ * (model scope) or client (root scope) type body; `dtsTypes` are module-scope
172
+ * declarations emitted once per contribution.
173
+ */
174
+ export type ExtensionClientContribution = {
175
+ readonly kind: "method" | "namespace";
176
+ readonly runtimeGlue: string;
177
+ readonly dts: readonly string[];
178
+ readonly dtsTypes?: readonly string[];
179
+ readonly imports?: readonly ExtensionImportSpec[];
180
+ readonly dtsImports?: readonly ExtensionImportSpec[];
181
+ };
182
+ /** Generated type names the extension may reference in its d.ts text. */
183
+ export type ExtensionModelTypeNames = {
184
+ /** The model payload type (e.g. "Post"). */
185
+ readonly payload: string;
186
+ readonly whereInput: string;
187
+ };
188
+ export type ExtensionClientPlane = {
189
+ readonly model?: (ctx: {
190
+ readonly model: ModelIR;
191
+ readonly schema: SchemaIR;
192
+ readonly dialect: Dialect;
193
+ readonly provider: Provider;
194
+ readonly options: Readonly<Record<string, unknown>>;
195
+ readonly declaration: Readonly<Record<string, unknown>>;
196
+ readonly typeNames: ExtensionModelTypeNames;
197
+ }) => ExtensionClientContribution | null;
198
+ readonly root?: (ctx: {
199
+ readonly schema: SchemaIR;
200
+ readonly dialect: Dialect;
201
+ readonly provider: Provider;
202
+ readonly options: Readonly<Record<string, unknown>>;
203
+ readonly declarations: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
204
+ }) => ExtensionClientContribution | null;
205
+ };
206
+ /** Minimal SQL execution surface handed to runtime/doctor hooks. */
207
+ export type ExtensionSqlExecutor = (params: {
208
+ readonly text: string;
209
+ readonly values?: readonly unknown[];
210
+ }) => Promise<readonly Record<string, unknown>[]>;
211
+ export type ExtensionRuntimePlane = {
212
+ /** Session setup after connect (e.g. SET pg_trgm.similarity_threshold). */
213
+ readonly onConnect?: (ctx: {
214
+ readonly execute: ExtensionSqlExecutor;
215
+ readonly dialect: Dialect;
216
+ readonly provider: Provider;
217
+ readonly options: Readonly<Record<string, unknown>>;
218
+ }) => Promise<void>;
219
+ };
220
+ export type ExtensionDoctorCheck = {
221
+ readonly name: string;
222
+ readonly ok: boolean;
223
+ readonly note?: string;
224
+ };
225
+ export type ExtensionDoctorReport = {
226
+ readonly checks: readonly ExtensionDoctorCheck[];
227
+ };
228
+ export type ExtensionDoctorHook = (ctx: {
229
+ readonly execute: ExtensionSqlExecutor;
230
+ readonly dialect: Dialect;
231
+ readonly provider: Provider;
232
+ readonly options: Readonly<Record<string, unknown>>;
233
+ }) => Promise<ExtensionDoctorReport>;
234
+ /**
235
+ * A VibeORM extension instance — what an extension factory (`search()`,
236
+ * `vector({ dims })`) returns and what config/VibeClient carry.
237
+ */
238
+ export type VibeExtension = {
239
+ /** Unique name; the ONLY identifier the extension may claim (D9). */
240
+ readonly name: string;
241
+ /** Embedded in the generated-client manifest for staleness checks. */
242
+ readonly version: string;
243
+ /** The factory's raw options — hashed into the manifest. */
244
+ readonly options: Readonly<Record<string, unknown>>;
245
+ /** Database extension requirements per provider (null = built in). */
246
+ readonly requires?: Partial<Record<Provider, {
247
+ readonly extension: string;
248
+ readonly min?: string;
249
+ } | null>>;
250
+ readonly schema?: {
251
+ readonly modelAttributes?: readonly ExtensionModelAttribute[];
252
+ readonly fieldTypes?: readonly ExtensionFieldType[];
253
+ /** Index kinds this extension registers (informational). */
254
+ readonly indexKinds?: readonly string[];
255
+ /** Replication-class: valid with zero schema attributes. */
256
+ readonly configOnly?: boolean;
257
+ };
258
+ readonly migrate?: ExtensionMigratePlane;
259
+ readonly sql?: ExtensionSqlPlane;
260
+ readonly client?: ExtensionClientPlane;
261
+ readonly runtime?: ExtensionRuntimePlane;
262
+ readonly doctor?: ExtensionDoctorHook;
263
+ };
264
+ /** Manifest entry embedded in the generated client (extensions.md §3.2). */
265
+ export type ExtensionManifestEntry = {
266
+ readonly name: string;
267
+ readonly version: string;
268
+ readonly optionsHash: string;
269
+ };
270
+ /**
271
+ * Deterministic hash of an extension's options for the client manifest.
272
+ * FNV-1a 32-bit over a key-sorted serialization — stable across processes.
273
+ */
274
+ export declare function extensionOptionsHash(params: {
275
+ options: Readonly<Record<string, unknown>>;
276
+ }): string;
277
+ /** Build the manifest entry for one extension instance. */
278
+ export declare function extensionManifestEntry(params: {
279
+ extension: VibeExtension;
280
+ }): ExtensionManifestEntry;
281
+ /**
282
+ * Validate and freeze an extension definition. Userland extensions use this
283
+ * exactly like tier 1 — nothing in @vibeorm/extensions is privileged.
284
+ *
285
+ * @example
286
+ * export function trgm(options: TrgmOptions = {}): VibeExtension {
287
+ * return defineExtension({ name: "trgm", version: VERSION, options, ... });
288
+ * }
289
+ */
290
+ export declare function defineExtension(extension: VibeExtension): VibeExtension;
291
+ /** Configured extensions, indexed for the parser/dsl/generator/migrate. */
292
+ export type ExtensionRegistry = {
293
+ readonly extensions: readonly VibeExtension[];
294
+ readonly byName: ReadonlyMap<string, VibeExtension>;
295
+ /** Model-attribute name (without @@) → owning extension + spec. */
296
+ readonly modelAttributes: ReadonlyMap<string, {
297
+ readonly extension: VibeExtension;
298
+ readonly attribute: ExtensionModelAttribute;
299
+ }>;
300
+ /** Field-type name → owning extension + spec. */
301
+ readonly fieldTypes: ReadonlyMap<string, {
302
+ readonly extension: VibeExtension;
303
+ readonly fieldType: ExtensionFieldType;
304
+ }>;
305
+ };
306
+ /**
307
+ * Index a configured extension list. Throws VIBE_CONFIG on duplicate
308
+ * extension names and on attribute/type claims that collide across extensions.
309
+ */
310
+ export declare function buildExtensionRegistry(params: {
311
+ extensions: readonly VibeExtension[];
312
+ }): ExtensionRegistry;
313
+ /** An empty registry — the default when no extensions are configured. */
314
+ export declare const EMPTY_EXTENSION_REGISTRY: ExtensionRegistry;
315
+ /**
316
+ * Merge two declaration fragments for the same (extension, model) — e.g. a
317
+ * field-type lowering plus a model attribute. One level deep: object values
318
+ * merge shallowly, everything else is last-wins. Used identically by the
319
+ * .prisma parser and the TS DSL so both sources produce byte-identical IR.
320
+ */
321
+ export declare function mergeExtensionDeclarations(params: {
322
+ base: Readonly<Record<string, unknown>>;
323
+ next: Readonly<Record<string, unknown>>;
324
+ }): Record<string, unknown>;
325
+ /**
326
+ * Per-model declarations one extension gathered from schema attributes,
327
+ * read back out of SchemaIR.extensions. Parser and DSL both store them as
328
+ * `{ models: { [modelName]: declaration } }` in ExtensionDeclIR.options.
329
+ */
330
+ export declare function extensionDeclarations(params: {
331
+ schema: SchemaIR;
332
+ name: string;
333
+ }): Readonly<Record<string, Readonly<Record<string, unknown>>>>;
334
+ //# sourceMappingURL=extension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,Q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M,CAAC;CACd,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAM9D"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @vibeorm/schema — canonical Schema IR, validation, dialect/capability types,
3
+ * and the VibeError contract for VibeORM v2.
4
+ */
5
+ export { DIALECTS, isEnumType, providerToDialect } from "./ir.ts";
6
+ export type { CascadeAction, DatasourceIR, DefaultValueIR, Dialect, EnumIR, ExtensionDeclIR, FieldIR, FieldType, IndexFieldIR, IndexIR, IndexKind, ModelIR, Provider, RelationIR, RelationType, ScalarType, SchemaIR, } from "./ir.ts";
7
+ export type { DialectCapabilities, FullTextEngine } from "./capabilities.ts";
8
+ export { VIBE_ERROR_CODES, VibeError, internalError, unsupportedCapability } from "./errors.ts";
9
+ export type { VibeErrorCode } from "./errors.ts";
10
+ export { RESERVED_CLIENT_NAMES, RESERVED_DELEGATE_NAMES, isReservedClientName, isReservedDelegateName, } from "./reserved.ts";
11
+ export { EMPTY_EXTENSION_REGISTRY, buildExtensionRegistry, defineExtension, extensionDeclarations, extensionManifestEntry, extensionOptionsHash, mergeExtensionDeclarations, } from "./extension.ts";
12
+ export type { ExtensionArtifact, ExtensionArtifactOwner, ExtensionAttributeArgs, ExtensionAttributeValue, ExtensionClientContribution, ExtensionClientPlane, ExtensionDoctorCheck, ExtensionDoctorHook, ExtensionDoctorReport, ExtensionFieldType, ExtensionImportSpec, ExtensionManifestEntry, ExtensionMigratePlane, ExtensionModelAttribute, ExtensionModelTypeNames, ExtensionRegistry, ExtensionRuntimePlane, ExtensionSchemaContext, ExtensionSqlExecutor, ExtensionSqlPlane, ExtensionWhereOperator, SqlFragmentPart, SqlFragmentSpec, VibeExtension, } from "./extension.ts";
13
+ export { assertValidSchemaIR, validateSchemaIR } from "./validate.ts";
14
+ export type { ValidationIssue } from "./validate.ts";
15
+ export { implicitJoinTable } from "./m2m.ts";
16
+ export type { ImplicitJoinTable } from "./m2m.ts";
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAClE,YAAY,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,OAAO,EACP,MAAM,EACN,eAAe,EACf,OAAO,EACP,SAAS,EACT,YAAY,EACZ,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,UAAU,EACV,QAAQ,GACT,MAAM,SAAS,CAAC;AAIjB,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAI7E,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAChG,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAIvB,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,eAA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