@prisma-next/sql-contract
Advanced tools
| import { t as SqlNode } from "./sql-node-V214WXQD.mjs"; | ||
| import { NamespaceId } from "@prisma-next/contract/types"; | ||
| //#region src/ir/foreign-key-reference.d.ts | ||
| /** | ||
| * Input for a foreign-key reference (one side of a foreign-key declaration). | ||
| * | ||
| * When `spaceId` is absent the reference is local — the referenced table lives | ||
| * in the same contract-space. When `spaceId` is present the reference is | ||
| * cross-space — the referenced table lives in a different contract-space | ||
| * identified by `spaceId`. | ||
| * | ||
| * Presence-based discrimination keeps local FK JSON byte-identical to | ||
| * contracts authored before cross-space support was added. | ||
| */ | ||
| interface ForeignKeyReferenceInput { | ||
| readonly namespaceId: string; | ||
| readonly tableName: string; | ||
| readonly columns: readonly string[]; | ||
| readonly spaceId?: string; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for one side (source or target) of a foreign-key | ||
| * declaration. Carries the full coordinate: namespace, table, and columns. | ||
| * | ||
| * Cross-space discrimination is based on `spaceId` presence: absent means | ||
| * local (same contract-space); present means cross-space (the referenced | ||
| * table lives in the contract-space identified by `spaceId`). | ||
| * | ||
| * For local references `spaceId` is absent from JSON, keeping the serialized | ||
| * shape byte-identical to contracts authored before cross-space support was | ||
| * added. For cross-space references `spaceId` appears in JSON so round-trips | ||
| * are lossless. | ||
| * | ||
| * Use `UNBOUND_NAMESPACE_ID` from `@prisma-next/framework-components/ir` | ||
| * as the sentinel `namespaceId` for single-namespace (unbound) references. | ||
| */ | ||
| declare class ForeignKeyReference extends SqlNode { | ||
| readonly namespaceId: NamespaceId; | ||
| readonly tableName: string; | ||
| readonly columns: readonly string[]; | ||
| readonly spaceId?: string; | ||
| constructor(input: ForeignKeyReferenceInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/foreign-key.d.ts | ||
| type ReferentialAction = 'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault'; | ||
| interface ForeignKeyInput { | ||
| readonly source: ForeignKeyReference | ForeignKeyReferenceInput; | ||
| readonly target: ForeignKeyReference | ForeignKeyReferenceInput; | ||
| readonly name?: string; | ||
| readonly onDelete?: ReferentialAction; | ||
| readonly onUpdate?: ReferentialAction; | ||
| /** Whether to emit FK constraint DDL (ALTER TABLE … ADD CONSTRAINT … FOREIGN KEY). */ | ||
| readonly constraint: boolean; | ||
| /** Whether to emit a backing index for the FK columns. */ | ||
| readonly index: boolean; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a table-level foreign-key declaration. | ||
| * | ||
| * Each FK carries explicit `source` and `target` {@link ForeignKeyReference} | ||
| * coordinates (namespace, table, columns). For single-namespace contracts the | ||
| * sentinel `UNBOUND_NAMESPACE_ID` appears on both sides. | ||
| * | ||
| * The nested references are normalised to {@link ForeignKeyReference} | ||
| * instances inside the constructor so downstream walks see a uniform AST | ||
| * regardless of whether the input was a JSON literal or an already-constructed | ||
| * class instance. | ||
| */ | ||
| declare class ForeignKey extends SqlNode { | ||
| readonly source: ForeignKeyReference; | ||
| readonly target: ForeignKeyReference; | ||
| readonly constraint: boolean; | ||
| readonly index: boolean; | ||
| readonly name?: string; | ||
| readonly onDelete?: ReferentialAction; | ||
| readonly onUpdate?: ReferentialAction; | ||
| constructor(input: ForeignKeyInput); | ||
| } | ||
| //#endregion | ||
| export { ForeignKeyReferenceInput as a, ForeignKeyReference as i, ForeignKeyInput as n, ReferentialAction as r, ForeignKey as t }; | ||
| //# sourceMappingURL=foreign-key-DM1UTydh.d.mts.map |
| {"version":3,"file":"foreign-key-DM1UTydh.d.mts","names":[],"sources":["../src/ir/foreign-key-reference.ts","../src/ir/foreign-key.ts"],"mappings":";;;;;;AAeA;;;;;;;;;UAAiB,wBAAA;EAAA,SACN,WAAA;EAAA,SACA,SAAA;EAAA,SACA,OAAA;EAAA,SACA,OAAA;AAAA;;;;;;;;;;;;;;AAyBkC;;;cANhC,mBAAA,SAA4B,OAAA;EAAA,SAC9B,WAAA,EAAa,WAAA;EAAA,SACb,SAAA;EAAA,SACA,OAAA;EAAA,SACQ,OAAA;cAEL,KAAA,EAAO,wBAAA;AAAA;;;KCxCT,iBAAA;AAAA,UAEK,eAAA;EAAA,SACN,MAAA,EAAQ,mBAAA,GAAsB,wBAAA;EAAA,SAC9B,MAAA,EAAQ,mBAAA,GAAsB,wBAAA;EAAA,SAC9B,IAAA;EAAA,SACA,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAA;EDMX;EAAA,SCJA,UAAA;EDMA;EAAA,SCJA,KAAA;AAAA;ADuBX;;;;;;;;;;;;AAAA,cCRa,UAAA,SAAmB,OAAA;EAAA,SACrB,MAAA,EAAQ,mBAAA;EAAA,SACR,MAAA,EAAQ,mBAAA;EAAA,SACR,UAAA;EAAA,SACA,KAAA;EAAA,SACQ,IAAA;EAAA,SACA,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAA;cAEhB,KAAA,EAAO,eAAA;AAAA"} |
| import { IRNodeBase } from "@prisma-next/framework-components/ir"; | ||
| //#region src/ir/sql-node.d.ts | ||
| /** | ||
| * SQL family IR node base. Carries the family-level `kind` discriminator | ||
| * `'sql'` and inherits the framework's `freezeNode` affordance. | ||
| * | ||
| * Single family-level discriminator (not per-leaf) reflects the fact that | ||
| * SQL IR has no polymorphic dispatch today — verifiers and serializers | ||
| * walk by structural position (`storage.tables[name].columns[name]`), | ||
| * not by inspecting `kind`. The abstract bar for per-leaf discriminators | ||
| * isn't earned until a future polymorphic consumer arrives. | ||
| * | ||
| * `kind` is installed as a non-enumerable own property on every instance, | ||
| * which keeps three things clean simultaneously: | ||
| * | ||
| * - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope | ||
| * shape (no `kind` field), so emitted contract.json files and the | ||
| * `validateSqlContractFully` arktype schemas stay unchanged. | ||
| * - Test assertions that use `toEqual({...})` against the pre-lift flat | ||
| * shape continue to pass — only enumerable own properties are | ||
| * compared. | ||
| * - Direct access (`node.kind`) and runtime narrowing | ||
| * (`if (node.kind === 'sql')`) still work, so future polymorphic | ||
| * dispatch can begin reading `kind` without a runtime change. | ||
| * | ||
| * Future per-leaf overrides land cleanly: a class that gains a | ||
| * polymorphic-dispatch consumer (e.g. an enum type instance walked | ||
| * alongside other types) overrides `kind` with its narrower literal | ||
| * at that leaf level. Per-leaf overrides will use enumerable kind | ||
| * (matching the Mongo per-class-discriminator precedent) because they | ||
| * encode dispatch-relevant information that callers need to see in | ||
| * JSON envelopes; the family-level `'sql'` is uniform across all SQL | ||
| * IR and carries no dispatch-relevant information. | ||
| */ | ||
| declare abstract class SqlNode extends IRNodeBase { | ||
| readonly kind?: string; | ||
| constructor(); | ||
| } | ||
| //#endregion | ||
| export { SqlNode as t }; | ||
| //# sourceMappingURL=sql-node-V214WXQD.d.mts.map |
| {"version":3,"file":"sql-node-V214WXQD.d.mts","names":[],"sources":["../src/ir/sql-node.ts"],"mappings":";;;;;AAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAAsB,OAAA,SAAgB,UAAU;EAAA,SACrC,IAAA"} |
| import { t as SqlNode } from "./sql-node-V214WXQD.mjs"; | ||
| import { t as StorageTable } from "./storage-table-Bj1ZN1P7.mjs"; | ||
| import { t as StorageValueSet } from "./storage-value-set-D-jww77l.mjs"; | ||
| import { Namespace, NamespaceBase, Storage, StorageType } from "@prisma-next/framework-components/ir"; | ||
| import { StorageHashBase } from "@prisma-next/contract/types"; | ||
| import { AuthoringContributions } from "@prisma-next/framework-components/authoring"; | ||
| //#region src/ir/storage-type-instance.d.ts | ||
| /** | ||
| * Sentinel kind for the legacy codec-triple shape persisted under | ||
| * `SqlStorage.types`. Plain JSON-clean object literals carry this | ||
| * discriminator so the polymorphic slot dispatch can route them down | ||
| * the codec path while target-specific IR class instances (e.g. the | ||
| * Postgres enum class) keep their own narrower `kind` literal. | ||
| */ | ||
| declare const CODEC_INSTANCE_KIND: "codec-instance"; | ||
| /** | ||
| * Structural sub-interface of {@link StorageType} for codec-typed entries | ||
| * in `SqlStorage.types`. These are plain object literals — there is no | ||
| * runtime IR class, the JSON envelope round-trips through the slot | ||
| * unchanged. The `kind: 'codec-instance'` discriminator is the dispatch | ||
| * key that distinguishes codec-typed entries from any class-instance | ||
| * kinds a target pack contributes to the polymorphic slot. | ||
| */ | ||
| interface StorageTypeInstance extends StorageType { | ||
| readonly kind: typeof CODEC_INSTANCE_KIND; | ||
| readonly codecId: string; | ||
| readonly nativeType: string; | ||
| readonly typeParams: Record<string, unknown>; | ||
| } | ||
| /** | ||
| * Construction-time input for a codec-triple entry. Symmetric with the | ||
| * structural runtime shape minus the `kind` discriminator — callers may | ||
| * omit `kind`; the helper {@link toStorageTypeInstance} stamps it on. | ||
| * `typeParams` may be omitted on input; the constructor normalises a | ||
| * missing value to `{}` so the in-memory shape is always present. | ||
| */ | ||
| interface StorageTypeInstanceInput { | ||
| readonly codecId: string; | ||
| readonly nativeType: string; | ||
| readonly typeParams?: Record<string, unknown>; | ||
| } | ||
| /** | ||
| * Stamp the codec-instance `kind` discriminator on a caller-supplied | ||
| * codec triple. Idempotent: input that already carries the discriminator | ||
| * passes through unchanged. Missing `typeParams` is normalised to `{}`. | ||
| */ | ||
| declare function toStorageTypeInstance(input: StorageTypeInstanceInput): StorageTypeInstance; | ||
| /** | ||
| * Type-guard for codec-typed entries on the polymorphic | ||
| * `SqlStorage.types` slot. Distinguishes `StorageTypeInstance` from | ||
| * any class-instance kinds a target pack contributes. | ||
| */ | ||
| declare function isStorageTypeInstance(value: unknown): value is StorageTypeInstance; | ||
| //#endregion | ||
| //#region src/ir/sql-storage.d.ts | ||
| /** | ||
| * Polymorphic value type for document-scoped `SqlStorage.types` entries | ||
| * (codec aliases / parameterised native type registrations). | ||
| * | ||
| * Postgres native enum registrations live under the postgres-specific | ||
| * `entries.type` slot on `PostgresSchema` (target layer), not here. | ||
| */ | ||
| type SqlStorageTypeEntry = StorageTypeInstance | StorageTypeInstanceInput; | ||
| interface SqlNamespaceInput { | ||
| readonly id: string; | ||
| readonly entries: Readonly<Record<string, Readonly<Record<string, unknown>>>>; | ||
| } | ||
| /** | ||
| * Target-supplied factory that materializes a `Namespace` from a SQL | ||
| * `SqlNamespaceInput` (used to populate `SqlStorage.namespaces`). | ||
| */ | ||
| type SqlNamespaceFactory = (input: SqlNamespaceInput) => Namespace; | ||
| /** | ||
| * SQL-family extension of the framework `AuthoringContributions`. SQL target | ||
| * packs add a `createNamespace` factory so the PSL/TS authoring paths can | ||
| * materialize namespaces (and merge lowered extension-block entities) without | ||
| * each consumer re-specifying it. The factory is SQL-specific, so it lives here | ||
| * rather than on the framework `AuthoringContributions` base. | ||
| */ | ||
| interface SqlAuthoringContributions extends AuthoringContributions { | ||
| readonly createNamespace?: SqlNamespaceFactory; | ||
| } | ||
| /** | ||
| * Narrows framework `AuthoringContributions` to the SQL-family shape by testing | ||
| * for the SQL-specific `createNamespace` capability. | ||
| */ | ||
| declare function isSqlAuthoringContributions(authoring: AuthoringContributions | undefined): authoring is SqlAuthoringContributions; | ||
| interface SqlStorageInput<THash extends string = string> { | ||
| readonly storageHash: StorageHashBase<THash>; | ||
| readonly types?: Record<string, SqlStorageTypeEntry>; | ||
| readonly namespaces: Readonly<Record<string, SqlNamespaceBase>>; | ||
| } | ||
| /** | ||
| * SQL Contract IR root node for the `storage` field. | ||
| * | ||
| * Single concrete family-shared class — both Postgres and SQLite | ||
| * consume this class today. Per-target storage subclasses are | ||
| * introduced when each target's namespace shape earns its | ||
| * target-specific concretion (target-specific derived fields, | ||
| * target-specific storage extensions). | ||
| * | ||
| * Honours the framework `Storage` interface: every SQL IR carries a | ||
| * `namespaces` map keyed by namespace id. Callers must supply fully | ||
| * constructed `Namespace` instances — construction discipline lives | ||
| * in the authoring builders and deserializer hydration paths. | ||
| * | ||
| * The constructor normalises optional `types` into class instances. | ||
| * `types` is polymorphic per Decision 18 Option B: codec-triple inputs | ||
| * are stamped with `kind: 'codec-instance'`; hydration of raw JSON | ||
| * class-instance entries (carrying their narrower `kind` literal) is | ||
| * the per-target serializer's responsibility (so the family base does | ||
| * not import target-specific subclasses). | ||
| */ | ||
| /** | ||
| * The typed `entries` shape for SQL family namespaces. The open dictionary | ||
| * is intersected with optional known-kind maps so that `ns.entries.table` | ||
| * and `ns.entries.valueSet` resolve without a cast, while unknown pack- | ||
| * contributed kinds remain valid (the `Record` part allows any string key). | ||
| */ | ||
| type SqlNamespaceEntries = Readonly<Record<string, Readonly<Record<string, unknown>>>> & { | ||
| readonly table?: Readonly<Record<string, StorageTable>>; | ||
| readonly valueSet?: Readonly<Record<string, StorageValueSet>>; | ||
| }; | ||
| /** | ||
| * Structural interface for SQL family namespaces. Generated `.d.ts` contract | ||
| * types satisfy this structurally (no prototype methods). The runtime | ||
| * abstract class `SqlNamespaceBase` extends this. | ||
| * | ||
| * `qualifyTable` is optional so JSON-shaped contract types (which carry no | ||
| * methods) are accepted where `SqlNamespace` is required. Hydrated | ||
| * `SqlNamespaceBase` instances always have it. | ||
| */ | ||
| interface SqlNamespace { | ||
| readonly kind: string; | ||
| readonly id: string; | ||
| readonly entries: SqlNamespaceEntries; | ||
| qualifyTable?(tableName: string): string; | ||
| } | ||
| /** | ||
| * Abstract SQL family namespace base class. Target concretions (`PostgresSchema`, | ||
| * `SqliteDatabase`, …) extend this — it is never instantiated directly. | ||
| * `entries` is the open ADR 224 dictionary: `entries[entityKind][entityName]` | ||
| * addresses any entity. | ||
| */ | ||
| declare abstract class SqlNamespaceBase extends NamespaceBase implements SqlNamespace { | ||
| abstract readonly id: string; | ||
| abstract readonly entries: SqlNamespaceEntries; | ||
| abstract qualifyTable(tableName: string): string; | ||
| } | ||
| /** | ||
| * Realm-safe guard for hydrated `SqlNamespaceBase` concretions. Checks | ||
| * `qualifyTable` structurally instead of `instanceof NamespaceBase`, so it | ||
| * survives duplicate-module boundaries (e.g. dist e2e where the target and | ||
| * the family carry separate copies of `@prisma-next/framework-components`). | ||
| * | ||
| * Every concrete `SqlNamespaceBase` subclass (`PostgresSchema`, `SqliteDatabase`, | ||
| * `TestSqlNamespace`, …) implements `qualifyTable`. Raw `SqlNamespaceInput` | ||
| * objects (`{ id, entries }`) do not. | ||
| */ | ||
| declare function isMaterializedSqlNamespace(x: unknown): x is SqlNamespaceBase; | ||
| declare class SqlStorage<THash extends string = string> extends SqlNode implements Storage { | ||
| readonly storageHash: StorageHashBase<THash>; | ||
| readonly namespaces: Readonly<Record<string, SqlNamespace>>; | ||
| readonly types?: Readonly<Record<string, StorageTypeInstance>>; | ||
| constructor(input: SqlStorageInput<THash>); | ||
| } | ||
| //#endregion | ||
| export { SqlNamespaceFactory as a, SqlStorageInput as c, isSqlAuthoringContributions as d, CODEC_INSTANCE_KIND as f, toStorageTypeInstance as g, isStorageTypeInstance as h, SqlNamespaceEntries as i, SqlStorageTypeEntry as l, StorageTypeInstanceInput as m, SqlNamespace as n, SqlNamespaceInput as o, StorageTypeInstance as p, SqlNamespaceBase as r, SqlStorage as s, SqlAuthoringContributions as t, isMaterializedSqlNamespace as u }; | ||
| //# sourceMappingURL=sql-storage-BRB55sCP.d.mts.map |
| {"version":3,"file":"sql-storage-BRB55sCP.d.mts","names":[],"sources":["../src/ir/storage-type-instance.ts","../src/ir/sql-storage.ts"],"mappings":";;;;;;;;;;;;;;;cASa,mBAAA;;;;AAA+C;AAU5D;;;;UAAiB,mBAAA,SAA4B,WAAA;EAAA,SAClC,IAAA,SAAa,mBAAA;EAAA,SACb,OAAA;EAAA,SACA,UAAA;EAAA,SACA,UAAA,EAAY,MAAA;AAAA;;;;;;;AAAM;UAUZ,wBAAA;EAAA,SACN,OAAA;EAAA,SACA,UAAA;EAAA,SACA,UAAA,GAAa,MAAM;AAAA;;;;;AAAA;iBAQd,qBAAA,CAAsB,KAAA,EAAO,wBAAA,GAA2B,mBAAmB;;;;;;iBAc3E,qBAAA,CAAsB,KAAA,YAAiB,KAAA,IAAS,mBAAmB;;;;AAjDnF;;;;AAA4D;AAU5D;KCOY,mBAAA,GAAsB,mBAAA,GAAsB,wBAAwB;AAAA,UAE/D,iBAAA;EAAA,SACN,EAAA;EAAA,SACA,OAAA,EAAS,QAAA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AA,CAAS,MAAA,SAAe,mBAAA;cAErC,KAAA,EAAO,eAAA,CAAgB,KAAA;AAAA"} |
| import { t as SqlNode } from "./sql-node-V214WXQD.mjs"; | ||
| import { n as ForeignKeyInput, t as ForeignKey } from "./foreign-key-DM1UTydh.mjs"; | ||
| import { ColumnDefault, ControlPolicy, ValueSetRef } from "@prisma-next/contract/types"; | ||
| //#region src/ir/check-constraint.d.ts | ||
| /** | ||
| * Hydration / construction input shape for {@link CheckConstraint}. | ||
| * Mirrors the on-disk storage JSON envelope so the serializer hydration | ||
| * walker can hand a validated literal straight to `new`. | ||
| */ | ||
| interface CheckConstraintInput { | ||
| readonly name: string; | ||
| readonly column: string; | ||
| readonly valueSet: ValueSetRef; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a table-level check constraint that restricts | ||
| * a column to the permitted values of a value-set. | ||
| * | ||
| * The constraint is **structured** (names a column and a value-set | ||
| * reference), not a raw SQL expression. Each target renders its own DDL | ||
| * from the structured form, keeping the contract target-agnostic. | ||
| * | ||
| * Construction is idempotent: passing an existing `CheckConstraint` | ||
| * instance as input produces a new instance with identical fields. | ||
| * The constructor does not use `instanceof` for input discrimination — | ||
| * it reads plain named properties, which is sufficient since | ||
| * `CheckConstraintInput` is a structural type. | ||
| */ | ||
| declare class CheckConstraint extends SqlNode { | ||
| readonly name: string; | ||
| readonly column: string; | ||
| readonly valueSet: ValueSetRef; | ||
| constructor(input: CheckConstraintInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/primary-key.d.ts | ||
| interface PrimaryKeyInput { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a table's primary-key constraint. | ||
| */ | ||
| declare class PrimaryKey extends SqlNode { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| constructor(input: PrimaryKeyInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/sql-index.d.ts | ||
| interface IndexInput { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| readonly type?: string; | ||
| readonly options?: Record<string, unknown>; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a table-level secondary index. | ||
| * | ||
| * Note that this class shadows the global TypeScript `Index` lib type | ||
| * at the family-shared name; consumer files that need both should | ||
| * alias one (e.g. | ||
| * `import { Index as SqlIndexNode } from '@prisma-next/sql-contract/types'`). | ||
| */ | ||
| declare class Index extends SqlNode { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| readonly type?: string; | ||
| readonly options?: Record<string, unknown>; | ||
| constructor(input: IndexInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/storage-column.d.ts | ||
| /** | ||
| * Hydration / construction input shape for {@link StorageColumn}. Mirrors | ||
| * the on-disk storage JSON envelope exactly so the family-base | ||
| * serializer's hydration walker can hand an arktype-validated literal | ||
| * straight to `new`. | ||
| * | ||
| * `typeParams` and `typeRef` remain mutually exclusive (one or the | ||
| * other, not both); the constructor preserves whichever caller-side | ||
| * choice the input encodes. | ||
| */ | ||
| interface StorageColumnInput { | ||
| readonly nativeType: string; | ||
| readonly codecId: string; | ||
| readonly nullable: boolean; | ||
| readonly many?: boolean; | ||
| readonly typeParams?: Record<string, unknown>; | ||
| readonly typeRef?: string; | ||
| readonly default?: ColumnDefault; | ||
| readonly control?: ControlPolicy; | ||
| readonly valueSet?: ValueSetRef; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a single column entry in `StorageTable.columns`. | ||
| * | ||
| * Single concrete family-shared class — every SQL target reads the | ||
| * same column shape today, so there is no per-target subclass. The | ||
| * class type accepts any caller that constructs via | ||
| * `new StorageColumn(input)`; literal construction sites must pass | ||
| * through the constructor or the family-base hydration walker. | ||
| * | ||
| * The column's `name` is not on the class — columns are keyed by name | ||
| * in the parent `StorageTable.columns: Record<string, StorageColumn>` | ||
| * map, so a `name` field would be redundant with the key. | ||
| */ | ||
| declare class StorageColumn extends SqlNode { | ||
| readonly nativeType: string; | ||
| readonly codecId: string; | ||
| readonly nullable: boolean; | ||
| readonly many?: boolean; | ||
| readonly typeParams?: Record<string, unknown>; | ||
| readonly typeRef?: string; | ||
| readonly default?: ColumnDefault; | ||
| readonly control?: ControlPolicy; | ||
| readonly valueSet?: ValueSetRef; | ||
| constructor(input: StorageColumnInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/unique-constraint.d.ts | ||
| interface UniqueConstraintInput { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a table-level unique constraint. | ||
| */ | ||
| declare class UniqueConstraint extends SqlNode { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| constructor(input: UniqueConstraintInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/storage-table.d.ts | ||
| interface StorageTableInput { | ||
| readonly columns: Record<string, StorageColumn | StorageColumnInput>; | ||
| readonly primaryKey?: PrimaryKey | PrimaryKeyInput; | ||
| readonly uniques: ReadonlyArray<UniqueConstraint | UniqueConstraintInput>; | ||
| readonly indexes: ReadonlyArray<Index | IndexInput>; | ||
| readonly foreignKeys: ReadonlyArray<ForeignKey | ForeignKeyInput>; | ||
| readonly control?: ControlPolicy; | ||
| readonly checks?: ReadonlyArray<CheckConstraint | CheckConstraintInput>; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a single table entry in a namespace's | ||
| * `tables` map. | ||
| * | ||
| * The constructor normalises nested IR-class fields (columns, primary | ||
| * key, uniques, indexes, foreign keys) into the appropriate class | ||
| * instances so downstream walks see a uniform AST regardless of whether | ||
| * the input was a JSON literal or an already-constructed class. | ||
| * | ||
| * The table's `name` is not on the class — tables are keyed by name in | ||
| * the parent namespace's `tables: Record<string, StorageTable>` map. | ||
| */ | ||
| declare class StorageTable extends SqlNode { | ||
| readonly columns: Readonly<Record<string, StorageColumn>>; | ||
| readonly uniques: ReadonlyArray<UniqueConstraint>; | ||
| readonly indexes: ReadonlyArray<Index>; | ||
| readonly foreignKeys: ReadonlyArray<ForeignKey>; | ||
| readonly primaryKey?: PrimaryKey; | ||
| readonly control?: ControlPolicy; | ||
| readonly checks?: ReadonlyArray<CheckConstraint>; | ||
| constructor(input: StorageTableInput); | ||
| /** | ||
| * Runtime guard that a namespace `table` entry is really a `StorageTable`. | ||
| * The compiler already types the entry as `StorageTable`, but a | ||
| * freshly-deserialized contract may carry plain JSON at that slot until | ||
| * hydration; this duck-types the structural shape. Accepts `undefined` so | ||
| * optional-chained entry lookups pass straight through. | ||
| */ | ||
| static is(value: StorageTable | undefined): value is StorageTable; | ||
| static assert(value: StorageTable | undefined, coordinate: string): asserts value is StorageTable; | ||
| } | ||
| //#endregion | ||
| export { StorageColumn as a, IndexInput as c, CheckConstraint as d, CheckConstraintInput as f, UniqueConstraintInput as i, PrimaryKey as l, StorageTableInput as n, StorageColumnInput as o, UniqueConstraint as r, Index as s, StorageTable as t, PrimaryKeyInput as u }; | ||
| //# sourceMappingURL=storage-table-Bj1ZN1P7.d.mts.map |
| {"version":3,"file":"storage-table-Bj1ZN1P7.d.mts","names":[],"sources":["../src/ir/check-constraint.ts","../src/ir/primary-key.ts","../src/ir/sql-index.ts","../src/ir/storage-column.ts","../src/ir/unique-constraint.ts","../src/ir/storage-table.ts"],"mappings":";;;;;;;;AASA;;UAAiB,oBAAA;EAAA,SACN,IAAA;EAAA,SACA,MAAA;EAAA,SACA,QAAA,EAAU,WAAW;AAAA;;;AAAA;AAiBhC;;;;;;;;;;;cAAa,eAAA,SAAwB,OAAA;EAAA,SAC1B,IAAA;EAAA,SACA,MAAA;EAAA,SACA,QAAA,EAAU,WAAA;cAEP,KAAA,EAAO,oBAAA;AAAA;;;UC/BJ,eAAA;EAAA,SACN,OAAA;EAAA,SACA,IAAI;AAAA;ADIf;;;AAAA,cCEa,UAAA,SAAmB,OAAO;EAAA,SAC5B,OAAA;EAAA,SACQ,IAAA;cAEL,KAAA,EAAO,eAAA;AAAA;;;UCZJ,UAAA;EAAA,SACN,OAAA;EAAA,SACA,IAAA;EAAA,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AAc,eAAA,GAAkB,oBAAA;AAAA;;;;;;;;;;;;;cAevC,YAAA,SAAqB,OAAA;EAAA,SACvB,OAAA,EAAS,QAAA,CAAS,MAAA,SAAe,aAAA;EAAA,SACjC,OAAA,EAAS,aAAA,CAAc,gBAAA;EAAA,SACvB,OAAA,EAAS,aAAA,CAAc,KAAA;EAAA,SACvB,WAAA,EAAa,aAAA,CAAc,UAAA;EAAA,SACnB,UAAA,GAAa,UAAA;EAAA,SACb,OAAA,GAAU,aAAA;EAAA,SACV,MAAA,GAAS,aAAA,CAAc,eAAA;cAE5B,KAAA,EAAO,iBAAA;;;AJpCN;AAMf;;;;SImES,EAAA,CAAG,KAAA,EAAO,YAAA,eAA2B,KAAA,IAAS,YAAA;EAAA,OAK9C,MAAA,CACL,KAAA,EAAO,YAAA,cACP,UAAA,mBACS,KAAA,IAAS,YAAA;AAAA"} |
| import { t as SqlNode } from "./sql-node-V214WXQD.mjs"; | ||
| import { JsonValue } from "@prisma-next/contract/types"; | ||
| //#region src/ir/storage-value-set.d.ts | ||
| /** | ||
| * Hydration / construction input shape for {@link StorageValueSet}. | ||
| * Mirrors the on-disk storage JSON envelope so the serializer hydration | ||
| * walker can hand a validated literal straight to `new`. | ||
| */ | ||
| interface StorageValueSetInput { | ||
| readonly kind: 'valueSet'; | ||
| /** Ordered permitted values, codec-encoded. Declaration order is preserved. */ | ||
| readonly values: readonly JsonValue[]; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a value-set entry in a namespace's `valueSet` | ||
| * map (`SqlNamespace.entries.valueSet`). | ||
| * | ||
| * A value-set records the ordered set of permitted codec-encoded values for | ||
| * an enum-like column restriction. It does not carry a `codecId` — the | ||
| * column that references it already holds the codec; the value-set holds | ||
| * only the permitted values. | ||
| * | ||
| * The node's `kind` is enumerable (`'valueSet'`) so the JSON envelope | ||
| * carries the discriminator and the serializer hydration walker can | ||
| * dispatch on it. This follows the per-leaf enumerable-kind convention | ||
| * established in the SQL-node comment (future polymorphic dispatch on | ||
| * namespace entries needs the discriminator in JSON). | ||
| * | ||
| * The entry's name is not on the class — value-sets are keyed by name in | ||
| * the parent namespace's `valueSet: Record<string, StorageValueSet>` map. | ||
| */ | ||
| declare class StorageValueSet extends SqlNode { | ||
| readonly kind: "valueSet"; | ||
| readonly values: readonly JsonValue[]; | ||
| constructor(input: StorageValueSetInput); | ||
| } | ||
| declare function isStorageValueSet(value: unknown): value is StorageValueSet; | ||
| //#endregion | ||
| export { StorageValueSetInput as n, isStorageValueSet as r, StorageValueSet as t }; | ||
| //# sourceMappingURL=storage-value-set-D-jww77l.d.mts.map |
| {"version":3,"file":"storage-value-set-D-jww77l.d.mts","names":[],"sources":["../src/ir/storage-value-set.ts"],"mappings":";;;;;;AASA;;;UAAiB,oBAAA;EAAA,SACN,IAAA;EAEA;EAAA,SAAA,MAAA,WAAiB,SAAS;AAAA;AAAA;AAqBrC;;;;;;;;;;;;;;;;AAIyC;AAzBJ,cAqBxB,eAAA,SAAwB,OAAA;EAAA,SACjB,IAAA;EAAA,SACT,MAAA,WAAiB,SAAA;cAEd,KAAA,EAAO,oBAAA;AAAA;AAAA,iBAOL,iBAAA,CAAkB,KAAA,YAAiB,KAAA,IAAS,eAAe"} |
| import { r as ReferentialAction } from "./foreign-key-DM1UTydh.mjs"; | ||
| import { CodecTrait } from "@prisma-next/framework-components/codec"; | ||
| import { ControlDriverInstance } from "@prisma-next/framework-components/control"; | ||
| //#region src/types.d.ts | ||
| interface SqlControlDriverInstance<T extends string = string> extends ControlDriverInstance<'sql', T> { | ||
| query<Row = Record<string, unknown>>(sql: string, params?: readonly unknown[]): Promise<{ | ||
| readonly rows: Row[]; | ||
| }>; | ||
| } | ||
| type ForeignKeyOptions = { | ||
| readonly name?: string; | ||
| readonly onDelete?: ReferentialAction; | ||
| readonly onUpdate?: ReferentialAction; | ||
| }; | ||
| type SqlModelFieldStorage = { | ||
| readonly column: string; | ||
| readonly codecId?: string; | ||
| readonly nullable?: boolean; | ||
| }; | ||
| type SqlModelStorage = { | ||
| readonly table: string; | ||
| readonly namespaceId: string; | ||
| readonly fields: Record<string, SqlModelFieldStorage>; | ||
| }; | ||
| declare const DEFAULT_FK_CONSTRAINT = true; | ||
| declare const DEFAULT_FK_INDEX = true; | ||
| declare function applyFkDefaults(fk: { | ||
| constraint?: boolean | undefined; | ||
| index?: boolean | undefined; | ||
| }, overrideDefaults?: { | ||
| constraint?: boolean | undefined; | ||
| index?: boolean | undefined; | ||
| }): { | ||
| constraint: boolean; | ||
| index: boolean; | ||
| }; | ||
| type NamespacedFieldTypeMap = Record<string, Record<string, Record<string, unknown>>>; | ||
| type NamespacedStorageColumnTypeMap = Record<string, Record<string, Record<string, unknown>>>; | ||
| type TypeMaps<TCodecTypes extends Record<string, { | ||
| output: unknown; | ||
| }> = Record<string, never>, TQueryOperationTypes extends Record<string, unknown> = Record<string, never>, TFieldOutputTypes extends NamespacedFieldTypeMap = Record<string, never>, TFieldInputTypes extends NamespacedFieldTypeMap = Record<string, never>, TStorageColumnTypes extends NamespacedStorageColumnTypeMap = Record<string, never>, TStorageColumnInputTypes extends NamespacedStorageColumnTypeMap = Record<string, never>> = { | ||
| readonly codecTypes: TCodecTypes; | ||
| readonly queryOperationTypes: TQueryOperationTypes; | ||
| readonly fieldOutputTypes: TFieldOutputTypes; | ||
| readonly fieldInputTypes: TFieldInputTypes; | ||
| readonly storageColumnTypes: TStorageColumnTypes; | ||
| readonly storageColumnInputTypes: TStorageColumnInputTypes; | ||
| }; | ||
| type CodecTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly codecTypes: infer C; | ||
| } ? C extends Record<string, { | ||
| output: unknown; | ||
| }> ? C : Record<string, never> : Record<string, never>; | ||
| /** | ||
| * Dispatch hint identifying the first-argument target of an operation. | ||
| * | ||
| * Used by ORM column helpers to decide whether an operation is reachable on a | ||
| * field. Names a concrete codec identity, a set of capability traits the | ||
| * field's codec must carry, or targets list-typed (`many`) fields. Element | ||
| * capability gating for list ops travels in `elementTraits`. | ||
| */ | ||
| type QueryOperationSelfSpec = { | ||
| readonly codecId: string; | ||
| readonly traits?: never; | ||
| readonly many?: never; | ||
| } | { | ||
| readonly traits: readonly CodecTrait[]; | ||
| readonly codecId?: never; | ||
| readonly many?: never; | ||
| } | { | ||
| readonly many: true; | ||
| readonly elementTraits?: readonly CodecTrait[]; | ||
| readonly codecId?: never; | ||
| readonly traits?: never; | ||
| }; | ||
| /** | ||
| * Structural shape an operation's impl must return: any value carrying a | ||
| * codec-exact `returnType` descriptor. `Expression<T>` (from | ||
| * `@prisma-next/sql-relational-core/expression`, with `T extends ScopeField`) | ||
| * extends this. Trait-targeted returns are deliberately excluded — predicate | ||
| * detection and result decoding both depend on knowing the concrete return | ||
| * codec. | ||
| */ | ||
| type QueryOperationReturn = { | ||
| readonly returnType: { | ||
| readonly codecId: string; | ||
| readonly nullable: boolean; | ||
| }; | ||
| }; | ||
| type QueryOperationTypeEntry = { | ||
| readonly self?: QueryOperationSelfSpec; | ||
| readonly impl: (...args: never[]) => QueryOperationReturn; | ||
| }; | ||
| type SqlQueryOperationTypes<_CT extends Record<string, { | ||
| readonly input: unknown; | ||
| readonly output: unknown; | ||
| }>, T extends Record<string, QueryOperationTypeEntry>> = T; | ||
| type QueryOperationTypesBase = Record<string, QueryOperationTypeEntry>; | ||
| type QueryOperationTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly queryOperationTypes: infer Q; | ||
| } ? Q extends Record<string, unknown> ? Q : Record<string, never> : Record<string, never>; | ||
| type TypeMapsPhantomKey = '__@prisma-next/sql-contract/typeMaps@__'; | ||
| type ContractWithTypeMaps<TContract, TTypeMaps> = TContract & { readonly [K in TypeMapsPhantomKey]?: TTypeMaps }; | ||
| type ExtractTypeMapsFromContract<T> = TypeMapsPhantomKey extends keyof T ? NonNullable<T[TypeMapsPhantomKey & keyof T]> : never; | ||
| type FieldOutputTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly fieldOutputTypes: infer F; | ||
| } ? F extends NamespacedFieldTypeMap ? F : Record<string, never> : Record<string, never>; | ||
| type FieldInputTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly fieldInputTypes: infer F; | ||
| } ? F extends NamespacedFieldTypeMap ? F : Record<string, never> : Record<string, never>; | ||
| type StorageColumnTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly storageColumnTypes: infer F; | ||
| } ? F extends NamespacedStorageColumnTypeMap ? F : Record<string, never> : Record<string, never>; | ||
| type StorageColumnInputTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly storageColumnInputTypes: infer F; | ||
| } ? F extends NamespacedStorageColumnTypeMap ? F : Record<string, never> : Record<string, never>; | ||
| type ExtractCodecTypes<T> = CodecTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ExtractQueryOperationTypes<T> = QueryOperationTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ExtractFieldOutputTypes<T> = FieldOutputTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ExtractFieldInputTypes<T> = FieldInputTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ExtractStorageColumnTypes<T> = StorageColumnTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ExtractStorageColumnInputTypes<T> = StorageColumnInputTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ResolveCodecTypes<TContract, TTypeMaps> = [TTypeMaps] extends [never] ? ExtractCodecTypes<TContract> : CodecTypesOf<TTypeMaps>; | ||
| //#endregion | ||
| export { TypeMapsPhantomKey as A, SqlControlDriverInstance as C, StorageColumnInputTypesOf as D, SqlQueryOperationTypes as E, StorageColumnTypesOf as O, ResolveCodecTypes as S, SqlModelStorage as T, QueryOperationReturn as _, ExtractCodecTypes as a, QueryOperationTypesBase as b, ExtractQueryOperationTypes as c, ExtractTypeMapsFromContract as d, FieldInputTypesOf as f, NamespacedStorageColumnTypeMap as g, NamespacedFieldTypeMap as h, DEFAULT_FK_INDEX as i, applyFkDefaults as j, TypeMaps as k, ExtractStorageColumnInputTypes as l, ForeignKeyOptions as m, ContractWithTypeMaps as n, ExtractFieldInputTypes as o, FieldOutputTypesOf as p, DEFAULT_FK_CONSTRAINT as r, ExtractFieldOutputTypes as s, CodecTypesOf as t, ExtractStorageColumnTypes as u, QueryOperationSelfSpec as v, SqlModelFieldStorage as w, QueryOperationTypesOf as x, QueryOperationTypeEntry as y }; | ||
| //# sourceMappingURL=types-zBvpNCmg.d.mts.map |
| {"version":3,"file":"types-zBvpNCmg.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;UAIiB,wBAAA,oCACP,qBAAA,QAA6B,CAAA;EACrC,KAAA,OAAY,MAAA,mBACV,GAAA,UACA,MAAA,wBACC,OAAA;IAAA,SAAmB,IAAA,EAAM,GAAA;EAAA;AAAA;AAAA,KAgDlB,iBAAA;EAAA,SACD,IAAA;EAAA,SACA,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAiB;AAAA;AAAA,KAG3B,oBAAA;EAAA,SACD,MAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA;AAAA;AAAA,KAGC,eAAA;EAAA,SACD,KAAA;EAAA,SACA,WAAA;EAAA,SACA,MAAA,EAAQ,MAAM,SAAS,oBAAA;AAAA;AAAA,cAGrB,qBAAA;AAAA,cACA,gBAAA;AAAA,iBAEG,eAAA,CACd,EAAA;EAAM,UAAA;EAAkC,KAAA;AAAA,GACxC,gBAAA;EAAqB,UAAA;EAAkC,KAAA;AAAA;EACpD,UAAA;EAAqB,KAAA;AAAA;AAAA,KASd,sBAAA,GAAyB,MAAA,SAAe,MAAA,SAAe,MAAA;AAAA,KAEvD,8BAAA,GAAiC,MAAA,SAE3C,MAAA,SAAe,MAAA;AAAA,KAGL,QAAA,qBACU,MAAA;EAAiB,MAAA;AAAA,KAAqB,MAAA,8CAC7B,MAAA,oBAA0B,MAAA,2CAC7B,sBAAA,GAAyB,MAAA,0CAC1B,sBAAA,GAA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mjs"; | ||
| //#region src/value-set-derivation-hook.d.ts | ||
| /** | ||
| * SQL-family extension to the framework entity-type authoring registry: a pack's entity-type | ||
| * `factory` output (framework `AuthoringEntityTypeFactoryOutput`) may derive a value-set from an | ||
| * entity it built (e.g. Postgres's `native_enum` deriving its ordered member values). The generic | ||
| * extension-block lowering pass (`contract-psl`'s interpreter) probes each entity-type descriptor's | ||
| * output for this hook after building the entity, and folds a non-undefined result into the same | ||
| * namespace's `valueSet` slot, keyed by the entity's block name. | ||
| * | ||
| * SQL-family concept — the returned shape ({@link StorageValueSetInput}) is SQL-specific, so this | ||
| * hook lives here instead of on the framework `AuthoringEntityTypeFactoryOutput` itself. | ||
| */ | ||
| interface SqlValueSetDerivingEntityTypeOutput { | ||
| /** | ||
| * TypeScript treats method-syntax declarations bivariantly, so a pack's concretely-typed | ||
| * `deriveValueSet(entity: PostgresNativeEnum) => …` is structurally compatible with this | ||
| * interface's `unknown` parameter — no `never`-parameter contravariance bridge needed. | ||
| */ | ||
| deriveValueSet(entity: unknown): StorageValueSetInput | undefined; | ||
| } | ||
| /** Structural check for {@link SqlValueSetDerivingEntityTypeOutput}: no casts. */ | ||
| declare function providesValueSetDerivation(output: unknown): output is SqlValueSetDerivingEntityTypeOutput; | ||
| /** | ||
| * If `output` (an entity-type descriptor's factory output) provides | ||
| * {@link SqlValueSetDerivingEntityTypeOutput.deriveValueSet}, invoke it on `entity` and return the | ||
| * derived value-set; otherwise return `undefined`. `contract-psl`'s generic extension-block | ||
| * lowering pass calls this after building each entity so a value-set-carrying pack entity can | ||
| * contribute its value-set without the pass naming any target discriminator. | ||
| */ | ||
| declare function deriveValueSetFromEntity(output: unknown, entity: unknown): StorageValueSetInput | undefined; | ||
| //#endregion | ||
| export { type SqlValueSetDerivingEntityTypeOutput, deriveValueSetFromEntity, providesValueSetDerivation }; | ||
| //# sourceMappingURL=value-set-derivation-hook.d.mts.map |
| {"version":3,"file":"value-set-derivation-hook.d.mts","names":[],"sources":["../src/value-set-derivation-hook.ts"],"mappings":";;;;;AAaA;;;;;;;;AAMuD;UANtC,mCAAA;EAUyB;;;;;EAJxC,cAAA,CAAe,MAAA,YAAkB,oBAAoB;AAAA;AAMP;AAAA,iBAFhC,0BAAA,CACd,MAAA,YACC,MAAA,IAAU,mCAAmC;;;;;;;;iBAehC,wBAAA,CACd,MAAA,WACA,MAAA,YACC,oBAAoB"} |
| //#region src/value-set-derivation-hook.ts | ||
| /** Structural check for {@link SqlValueSetDerivingEntityTypeOutput}: no casts. */ | ||
| function providesValueSetDerivation(output) { | ||
| if (typeof output !== "object" || output === null || !("deriveValueSet" in output)) return false; | ||
| const { deriveValueSet } = output; | ||
| return typeof deriveValueSet === "function"; | ||
| } | ||
| /** | ||
| * If `output` (an entity-type descriptor's factory output) provides | ||
| * {@link SqlValueSetDerivingEntityTypeOutput.deriveValueSet}, invoke it on `entity` and return the | ||
| * derived value-set; otherwise return `undefined`. `contract-psl`'s generic extension-block | ||
| * lowering pass calls this after building each entity so a value-set-carrying pack entity can | ||
| * contribute its value-set without the pass naming any target discriminator. | ||
| */ | ||
| function deriveValueSetFromEntity(output, entity) { | ||
| if (!providesValueSetDerivation(output)) return void 0; | ||
| return output.deriveValueSet(entity); | ||
| } | ||
| //#endregion | ||
| export { deriveValueSetFromEntity, providesValueSetDerivation }; | ||
| //# sourceMappingURL=value-set-derivation-hook.mjs.map |
| {"version":3,"file":"value-set-derivation-hook.mjs","names":[],"sources":["../src/value-set-derivation-hook.ts"],"sourcesContent":["import type { StorageValueSetInput } from './ir/storage-value-set';\n\n/**\n * SQL-family extension to the framework entity-type authoring registry: a pack's entity-type\n * `factory` output (framework `AuthoringEntityTypeFactoryOutput`) may derive a value-set from an\n * entity it built (e.g. Postgres's `native_enum` deriving its ordered member values). The generic\n * extension-block lowering pass (`contract-psl`'s interpreter) probes each entity-type descriptor's\n * output for this hook after building the entity, and folds a non-undefined result into the same\n * namespace's `valueSet` slot, keyed by the entity's block name.\n *\n * SQL-family concept — the returned shape ({@link StorageValueSetInput}) is SQL-specific, so this\n * hook lives here instead of on the framework `AuthoringEntityTypeFactoryOutput` itself.\n */\nexport interface SqlValueSetDerivingEntityTypeOutput {\n /**\n * TypeScript treats method-syntax declarations bivariantly, so a pack's concretely-typed\n * `deriveValueSet(entity: PostgresNativeEnum) => …` is structurally compatible with this\n * interface's `unknown` parameter — no `never`-parameter contravariance bridge needed.\n */\n deriveValueSet(entity: unknown): StorageValueSetInput | undefined;\n}\n\n/** Structural check for {@link SqlValueSetDerivingEntityTypeOutput}: no casts. */\nexport function providesValueSetDerivation(\n output: unknown,\n): output is SqlValueSetDerivingEntityTypeOutput {\n if (typeof output !== 'object' || output === null || !('deriveValueSet' in output)) {\n return false;\n }\n const { deriveValueSet } = output;\n return typeof deriveValueSet === 'function';\n}\n\n/**\n * If `output` (an entity-type descriptor's factory output) provides\n * {@link SqlValueSetDerivingEntityTypeOutput.deriveValueSet}, invoke it on `entity` and return the\n * derived value-set; otherwise return `undefined`. `contract-psl`'s generic extension-block\n * lowering pass calls this after building each entity so a value-set-carrying pack entity can\n * contribute its value-set without the pass naming any target discriminator.\n */\nexport function deriveValueSetFromEntity(\n output: unknown,\n entity: unknown,\n): StorageValueSetInput | undefined {\n if (!providesValueSetDerivation(output)) return undefined;\n return output.deriveValueSet(entity);\n}\n"],"mappings":";;AAuBA,SAAgB,2BACd,QAC+C;CAC/C,IAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,EAAE,oBAAoB,SACzE,OAAO;CAET,MAAM,EAAE,mBAAmB;CAC3B,OAAO,OAAO,mBAAmB;AACnC;;;;;;;;AASA,SAAgB,yBACd,QACA,QACkC;CAClC,IAAI,CAAC,2BAA2B,MAAM,GAAG,OAAO,KAAA;CAChD,OAAO,OAAO,eAAe,MAAM;AACrC"} |
| export type { SqlValueSetDerivingEntityTypeOutput } from '../value-set-derivation-hook'; | ||
| export { deriveValueSetFromEntity, providesValueSetDerivation } from '../value-set-derivation-hook'; |
| import type { StorageValueSetInput } from './ir/storage-value-set'; | ||
| /** | ||
| * SQL-family extension to the framework entity-type authoring registry: a pack's entity-type | ||
| * `factory` output (framework `AuthoringEntityTypeFactoryOutput`) may derive a value-set from an | ||
| * entity it built (e.g. Postgres's `native_enum` deriving its ordered member values). The generic | ||
| * extension-block lowering pass (`contract-psl`'s interpreter) probes each entity-type descriptor's | ||
| * output for this hook after building the entity, and folds a non-undefined result into the same | ||
| * namespace's `valueSet` slot, keyed by the entity's block name. | ||
| * | ||
| * SQL-family concept — the returned shape ({@link StorageValueSetInput}) is SQL-specific, so this | ||
| * hook lives here instead of on the framework `AuthoringEntityTypeFactoryOutput` itself. | ||
| */ | ||
| export interface SqlValueSetDerivingEntityTypeOutput { | ||
| /** | ||
| * TypeScript treats method-syntax declarations bivariantly, so a pack's concretely-typed | ||
| * `deriveValueSet(entity: PostgresNativeEnum) => …` is structurally compatible with this | ||
| * interface's `unknown` parameter — no `never`-parameter contravariance bridge needed. | ||
| */ | ||
| deriveValueSet(entity: unknown): StorageValueSetInput | undefined; | ||
| } | ||
| /** Structural check for {@link SqlValueSetDerivingEntityTypeOutput}: no casts. */ | ||
| export function providesValueSetDerivation( | ||
| output: unknown, | ||
| ): output is SqlValueSetDerivingEntityTypeOutput { | ||
| if (typeof output !== 'object' || output === null || !('deriveValueSet' in output)) { | ||
| return false; | ||
| } | ||
| const { deriveValueSet } = output; | ||
| return typeof deriveValueSet === 'function'; | ||
| } | ||
| /** | ||
| * If `output` (an entity-type descriptor's factory output) provides | ||
| * {@link SqlValueSetDerivingEntityTypeOutput.deriveValueSet}, invoke it on `entity` and return the | ||
| * derived value-set; otherwise return `undefined`. `contract-psl`'s generic extension-block | ||
| * lowering pass calls this after building each entity so a value-set-carrying pack entity can | ||
| * contribute its value-set without the pass naming any target discriminator. | ||
| */ | ||
| export function deriveValueSetFromEntity( | ||
| output: unknown, | ||
| entity: unknown, | ||
| ): StorageValueSetInput | undefined { | ||
| if (!providesValueSetDerivation(output)) return undefined; | ||
| return output.deriveValueSet(entity); | ||
| } |
@@ -1,2 +0,2 @@ | ||
| import { s as SqlStorage } from "./sql-storage-Dc1Dy3Vb.mjs"; | ||
| import { s as SqlStorage } from "./sql-storage-BRB55sCP.mjs"; | ||
| import { DefaultNamespaceEntries, NamespacedEntities, SingleNamespaceView } from "@prisma-next/framework-components/ir"; | ||
@@ -3,0 +3,0 @@ import { Contract } from "@prisma-next/contract/types"; |
@@ -1,2 +0,3 @@ | ||
| import { a as StorageTableInput, i as StorageTable, n as StorageValueSetInput, t as StorageValueSet } from "./storage-value-set-DXL-7PYo.mjs"; | ||
| import { n as StorageTableInput, t as StorageTable } from "./storage-table-Bj1ZN1P7.mjs"; | ||
| import { n as StorageValueSetInput, t as StorageValueSet } from "./storage-value-set-D-jww77l.mjs"; | ||
| import { AnyEntityKindDescriptor, EntityKindDescriptor } from "@prisma-next/framework-components/ir"; | ||
@@ -3,0 +4,0 @@ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"entity-kinds.d.mts","names":[],"sources":["../src/entity-kinds.ts"],"mappings":";;;;cAQa,eAAA,EAAiB,oBAAA,CAAqB,iBAAA,EAAmB,YAAA;AAAA,cAMzD,kBAAA,EAAoB,oBAAA,CAAqB,oBAAA,EAAsB,eAAA;;;;;;;;;iBAc5D,qBAAA,CACd,SAAA,YAAoB,uBAAA,KACnB,WAAA,SAAoB,uBAAA"} | ||
| {"version":3,"file":"entity-kinds.d.mts","names":[],"sources":["../src/entity-kinds.ts"],"mappings":";;;;;cAQa,eAAA,EAAiB,oBAAA,CAAqB,iBAAA,EAAmB,YAAA;AAAA,cAMzD,kBAAA,EAAoB,oBAAA,CAAqB,oBAAA,EAAsB,eAAA;AAN5E;;;;;;;;AAAA,iBAoBgB,qBAAA,CACd,SAAA,YAAoB,uBAAA,KACnB,WAAA,SAAoB,uBAAA"} |
@@ -1,4 +0,4 @@ | ||
| import { t as ForeignKey } from "./foreign-key-BATxB95l.mjs"; | ||
| import { c as StorageColumn, f as PrimaryKey, i as StorageTable, l as StorageColumnInput, o as UniqueConstraint, u as Index } from "./storage-value-set-DXL-7PYo.mjs"; | ||
| import { T as SqlModelStorage, m as ForeignKeyOptions, w as SqlModelFieldStorage } from "./types-ChH7hULD.mjs"; | ||
| import { a as StorageColumn, l as PrimaryKey, o as StorageColumnInput, r as UniqueConstraint, s as Index, t as StorageTable } from "./storage-table-Bj1ZN1P7.mjs"; | ||
| import { t as ForeignKey } from "./foreign-key-DM1UTydh.mjs"; | ||
| import { T as SqlModelStorage, m as ForeignKeyOptions, w as SqlModelFieldStorage } from "./types-zBvpNCmg.mjs"; | ||
| import { ScalarFieldType } from "@prisma-next/contract/types"; | ||
@@ -5,0 +5,0 @@ |
@@ -1,2 +0,2 @@ | ||
| import { s as SqlStorage } from "./sql-storage-Dc1Dy3Vb.mjs"; | ||
| import { s as SqlStorage } from "./sql-storage-BRB55sCP.mjs"; | ||
| import { a as IndexTypeRegistry } from "./index-types-Czsyu7Iw.mjs"; | ||
@@ -3,0 +3,0 @@ import { Contract } from "@prisma-next/contract/types"; |
@@ -1,2 +0,2 @@ | ||
| import { r as ReferentialAction } from "./foreign-key-BATxB95l.mjs"; | ||
| import { r as ReferentialAction } from "./foreign-key-DM1UTydh.mjs"; | ||
@@ -3,0 +3,0 @@ //#region src/referential-action-sql.d.ts |
@@ -1,3 +0,3 @@ | ||
| import { i as StorageTable } from "./storage-value-set-DXL-7PYo.mjs"; | ||
| import { s as SqlStorage } from "./sql-storage-Dc1Dy3Vb.mjs"; | ||
| import { t as StorageTable } from "./storage-table-Bj1ZN1P7.mjs"; | ||
| import { s as SqlStorage } from "./sql-storage-BRB55sCP.mjs"; | ||
@@ -4,0 +4,0 @@ //#region src/resolve-storage-table.d.ts |
+6
-4
@@ -1,5 +0,7 @@ | ||
| import { a as ForeignKeyReferenceInput, i as ForeignKeyReference, n as ForeignKeyInput, o as SqlNode, r as ReferentialAction, t as ForeignKey } from "./foreign-key-BATxB95l.mjs"; | ||
| import { a as StorageTableInput, c as StorageColumn, d as IndexInput, f as PrimaryKey, h as CheckConstraintInput, i as StorageTable, l as StorageColumnInput, m as CheckConstraint, n as StorageValueSetInput, o as UniqueConstraint, p as PrimaryKeyInput, r as isStorageValueSet, s as UniqueConstraintInput, t as StorageValueSet, u as Index } from "./storage-value-set-DXL-7PYo.mjs"; | ||
| import { a as SqlNamespaceFactory, c as SqlStorageInput, d as isSqlAuthoringContributions, f as CODEC_INSTANCE_KIND, g as toStorageTypeInstance, h as isStorageTypeInstance, i as SqlNamespaceEntries, l as SqlStorageTypeEntry, m as StorageTypeInstanceInput, n as SqlNamespace, o as SqlNamespaceInput, p as StorageTypeInstance, r as SqlNamespaceBase, s as SqlStorage, t as SqlAuthoringContributions, u as isMaterializedSqlNamespace } from "./sql-storage-Dc1Dy3Vb.mjs"; | ||
| import { A as TypeMapsPhantomKey, C as SqlControlDriverInstance, D as StorageColumnInputTypesOf, E as SqlQueryOperationTypes, O as StorageColumnTypesOf, S as ResolveCodecTypes, T as SqlModelStorage, _ as QueryOperationReturn, a as ExtractCodecTypes, b as QueryOperationTypesBase, c as ExtractQueryOperationTypes, d as ExtractTypeMapsFromContract, f as FieldInputTypesOf, g as NamespacedStorageColumnTypeMap, h as NamespacedFieldTypeMap, i as DEFAULT_FK_INDEX, j as applyFkDefaults, k as TypeMaps, l as ExtractStorageColumnInputTypes, m as ForeignKeyOptions, n as ContractWithTypeMaps, o as ExtractFieldInputTypes, p as FieldOutputTypesOf, r as DEFAULT_FK_CONSTRAINT, s as ExtractFieldOutputTypes, t as CodecTypesOf, u as ExtractStorageColumnTypes, v as QueryOperationSelfSpec, w as SqlModelFieldStorage, x as QueryOperationTypesOf, y as QueryOperationTypeEntry } from "./types-ChH7hULD.mjs"; | ||
| import { t as SqlNode } from "./sql-node-V214WXQD.mjs"; | ||
| import { a as StorageColumn, c as IndexInput, d as CheckConstraint, f as CheckConstraintInput, i as UniqueConstraintInput, l as PrimaryKey, n as StorageTableInput, o as StorageColumnInput, r as UniqueConstraint, s as Index, t as StorageTable, u as PrimaryKeyInput } from "./storage-table-Bj1ZN1P7.mjs"; | ||
| import { a as ForeignKeyReferenceInput, i as ForeignKeyReference, n as ForeignKeyInput, r as ReferentialAction, t as ForeignKey } from "./foreign-key-DM1UTydh.mjs"; | ||
| import { a as SqlNamespaceFactory, c as SqlStorageInput, d as isSqlAuthoringContributions, f as CODEC_INSTANCE_KIND, g as toStorageTypeInstance, h as isStorageTypeInstance, i as SqlNamespaceEntries, l as SqlStorageTypeEntry, m as StorageTypeInstanceInput, n as SqlNamespace, o as SqlNamespaceInput, p as StorageTypeInstance, r as SqlNamespaceBase, s as SqlStorage, t as SqlAuthoringContributions, u as isMaterializedSqlNamespace } from "./sql-storage-BRB55sCP.mjs"; | ||
| import { n as StorageValueSetInput, r as isStorageValueSet, t as StorageValueSet } from "./storage-value-set-D-jww77l.mjs"; | ||
| import { A as TypeMapsPhantomKey, C as SqlControlDriverInstance, D as StorageColumnInputTypesOf, E as SqlQueryOperationTypes, O as StorageColumnTypesOf, S as ResolveCodecTypes, T as SqlModelStorage, _ as QueryOperationReturn, a as ExtractCodecTypes, b as QueryOperationTypesBase, c as ExtractQueryOperationTypes, d as ExtractTypeMapsFromContract, f as FieldInputTypesOf, g as NamespacedStorageColumnTypeMap, h as NamespacedFieldTypeMap, i as DEFAULT_FK_INDEX, j as applyFkDefaults, k as TypeMaps, l as ExtractStorageColumnInputTypes, m as ForeignKeyOptions, n as ContractWithTypeMaps, o as ExtractFieldInputTypes, p as FieldOutputTypesOf, r as DEFAULT_FK_CONSTRAINT, s as ExtractFieldOutputTypes, t as CodecTypesOf, u as ExtractStorageColumnTypes, v as QueryOperationSelfSpec, w as SqlModelFieldStorage, x as QueryOperationTypesOf, y as QueryOperationTypeEntry } from "./types-zBvpNCmg.mjs"; | ||
@@ -6,0 +8,0 @@ //#region src/column-type-resolution.d.ts |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"types.d.mts","names":[],"sources":["../src/column-type-resolution.ts"],"mappings":";;;;;;KACY,kBAAA,4EAIa,GAAA,WAErB,IAAA,eAAmB,GAAA,wBACI,GAAA,CAAI,IAAA,YAEvB,SAAA,eAAwB,GAAA,CAAI,IAAA,IAC1B,GAAA,CAAI,IAAA,EAAM,SAAA;AAAA,KAIR,iCAAA,4EAKG,GAAA,GAAM,SAAA,eAAwB,GAAA,CAAI,EAAA,IAC3C,UAAA,eAAyB,GAAA,CAAI,EAAA,EAAI,SAAA,IAC/B,GAAA,CAAI,EAAA,EAAI,SAAA,EAAW,UAAA,0BAGnB,GAAA"} | ||
| {"version":3,"file":"types.d.mts","names":[],"sources":["../src/column-type-resolution.ts"],"mappings":";;;;;;;;KACY,kBAAA,4EAIa,GAAA,WAErB,IAAA,eAAmB,GAAA,wBACI,GAAA,CAAI,IAAA,YAEvB,SAAA,eAAwB,GAAA,CAAI,IAAA,IAC1B,GAAA,CAAI,IAAA,EAAM,SAAA;AAAA,KAIR,iCAAA,4EAKG,GAAA,GAAM,SAAA,eAAwB,GAAA,CAAI,EAAA,IAC3C,UAAA,eAAyB,GAAA,CAAI,EAAA,EAAI,SAAA,IAC/B,GAAA,CAAI,EAAA,EAAI,SAAA,EAAW,UAAA,0BAGnB,GAAA"} |
@@ -1,4 +0,4 @@ | ||
| import { n as ForeignKeyInput, r as ReferentialAction } from "./foreign-key-BATxB95l.mjs"; | ||
| import { p as PrimaryKeyInput, s as UniqueConstraintInput } from "./storage-value-set-DXL-7PYo.mjs"; | ||
| import { s as SqlStorage } from "./sql-storage-Dc1Dy3Vb.mjs"; | ||
| import { i as UniqueConstraintInput, u as PrimaryKeyInput } from "./storage-table-Bj1ZN1P7.mjs"; | ||
| import { n as ForeignKeyInput, r as ReferentialAction } from "./foreign-key-DM1UTydh.mjs"; | ||
| import { s as SqlStorage } from "./sql-storage-BRB55sCP.mjs"; | ||
| import { AnyEntityKindDescriptor } from "@prisma-next/framework-components/ir"; | ||
@@ -5,0 +5,0 @@ import { Type } from "arktype"; |
+8
-7
| { | ||
| "name": "@prisma-next/sql-contract", | ||
| "version": "0.14.0-dev.45", | ||
| "version": "0.14.0-dev.46", | ||
| "license": "Apache-2.0", | ||
@@ -9,11 +9,11 @@ "type": "module", | ||
| "dependencies": { | ||
| "@prisma-next/contract": "0.14.0-dev.45", | ||
| "@prisma-next/framework-components": "0.14.0-dev.45", | ||
| "@prisma-next/utils": "0.14.0-dev.45", | ||
| "@prisma-next/contract": "0.14.0-dev.46", | ||
| "@prisma-next/framework-components": "0.14.0-dev.46", | ||
| "@prisma-next/utils": "0.14.0-dev.46", | ||
| "arktype": "^2.2.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@prisma-next/test-utils": "0.14.0-dev.45", | ||
| "@prisma-next/tsconfig": "0.14.0-dev.45", | ||
| "@prisma-next/tsdown": "0.14.0-dev.45", | ||
| "@prisma-next/test-utils": "0.14.0-dev.46", | ||
| "@prisma-next/tsconfig": "0.14.0-dev.46", | ||
| "@prisma-next/tsdown": "0.14.0-dev.46", | ||
| "tsdown": "0.22.1", | ||
@@ -47,2 +47,3 @@ "typescript": "5.9.3", | ||
| "./validators": "./dist/validators.mjs", | ||
| "./value-set-derivation-hook": "./dist/value-set-derivation-hook.mjs", | ||
| "./package.json": "./package.json" | ||
@@ -49,0 +50,0 @@ }, |
| import { IRNodeBase } from "@prisma-next/framework-components/ir"; | ||
| import { NamespaceId } from "@prisma-next/contract/types"; | ||
| //#region src/ir/sql-node.d.ts | ||
| /** | ||
| * SQL family IR node base. Carries the family-level `kind` discriminator | ||
| * `'sql'` and inherits the framework's `freezeNode` affordance. | ||
| * | ||
| * Single family-level discriminator (not per-leaf) reflects the fact that | ||
| * SQL IR has no polymorphic dispatch today — verifiers and serializers | ||
| * walk by structural position (`storage.tables[name].columns[name]`), | ||
| * not by inspecting `kind`. The abstract bar for per-leaf discriminators | ||
| * isn't earned until a future polymorphic consumer arrives. | ||
| * | ||
| * `kind` is installed as a non-enumerable own property on every instance, | ||
| * which keeps three things clean simultaneously: | ||
| * | ||
| * - `JSON.stringify(node)` produces the canonical pre-lift JSON envelope | ||
| * shape (no `kind` field), so emitted contract.json files and the | ||
| * `validateSqlContractFully` arktype schemas stay unchanged. | ||
| * - Test assertions that use `toEqual({...})` against the pre-lift flat | ||
| * shape continue to pass — only enumerable own properties are | ||
| * compared. | ||
| * - Direct access (`node.kind`) and runtime narrowing | ||
| * (`if (node.kind === 'sql')`) still work, so future polymorphic | ||
| * dispatch can begin reading `kind` without a runtime change. | ||
| * | ||
| * Future per-leaf overrides land cleanly: a class that gains a | ||
| * polymorphic-dispatch consumer (e.g. an enum type instance walked | ||
| * alongside other types) overrides `kind` with its narrower literal | ||
| * at that leaf level. Per-leaf overrides will use enumerable kind | ||
| * (matching the Mongo per-class-discriminator precedent) because they | ||
| * encode dispatch-relevant information that callers need to see in | ||
| * JSON envelopes; the family-level `'sql'` is uniform across all SQL | ||
| * IR and carries no dispatch-relevant information. | ||
| */ | ||
| declare abstract class SqlNode extends IRNodeBase { | ||
| readonly kind?: string; | ||
| constructor(); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/foreign-key-reference.d.ts | ||
| /** | ||
| * Input for a foreign-key reference (one side of a foreign-key declaration). | ||
| * | ||
| * When `spaceId` is absent the reference is local — the referenced table lives | ||
| * in the same contract-space. When `spaceId` is present the reference is | ||
| * cross-space — the referenced table lives in a different contract-space | ||
| * identified by `spaceId`. | ||
| * | ||
| * Presence-based discrimination keeps local FK JSON byte-identical to | ||
| * contracts authored before cross-space support was added. | ||
| */ | ||
| interface ForeignKeyReferenceInput { | ||
| readonly namespaceId: string; | ||
| readonly tableName: string; | ||
| readonly columns: readonly string[]; | ||
| readonly spaceId?: string; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for one side (source or target) of a foreign-key | ||
| * declaration. Carries the full coordinate: namespace, table, and columns. | ||
| * | ||
| * Cross-space discrimination is based on `spaceId` presence: absent means | ||
| * local (same contract-space); present means cross-space (the referenced | ||
| * table lives in the contract-space identified by `spaceId`). | ||
| * | ||
| * For local references `spaceId` is absent from JSON, keeping the serialized | ||
| * shape byte-identical to contracts authored before cross-space support was | ||
| * added. For cross-space references `spaceId` appears in JSON so round-trips | ||
| * are lossless. | ||
| * | ||
| * Use `UNBOUND_NAMESPACE_ID` from `@prisma-next/framework-components/ir` | ||
| * as the sentinel `namespaceId` for single-namespace (unbound) references. | ||
| */ | ||
| declare class ForeignKeyReference extends SqlNode { | ||
| readonly namespaceId: NamespaceId; | ||
| readonly tableName: string; | ||
| readonly columns: readonly string[]; | ||
| readonly spaceId?: string; | ||
| constructor(input: ForeignKeyReferenceInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/foreign-key.d.ts | ||
| type ReferentialAction = 'noAction' | 'restrict' | 'cascade' | 'setNull' | 'setDefault'; | ||
| interface ForeignKeyInput { | ||
| readonly source: ForeignKeyReference | ForeignKeyReferenceInput; | ||
| readonly target: ForeignKeyReference | ForeignKeyReferenceInput; | ||
| readonly name?: string; | ||
| readonly onDelete?: ReferentialAction; | ||
| readonly onUpdate?: ReferentialAction; | ||
| /** Whether to emit FK constraint DDL (ALTER TABLE … ADD CONSTRAINT … FOREIGN KEY). */ | ||
| readonly constraint: boolean; | ||
| /** Whether to emit a backing index for the FK columns. */ | ||
| readonly index: boolean; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a table-level foreign-key declaration. | ||
| * | ||
| * Each FK carries explicit `source` and `target` {@link ForeignKeyReference} | ||
| * coordinates (namespace, table, columns). For single-namespace contracts the | ||
| * sentinel `UNBOUND_NAMESPACE_ID` appears on both sides. | ||
| * | ||
| * The nested references are normalised to {@link ForeignKeyReference} | ||
| * instances inside the constructor so downstream walks see a uniform AST | ||
| * regardless of whether the input was a JSON literal or an already-constructed | ||
| * class instance. | ||
| */ | ||
| declare class ForeignKey extends SqlNode { | ||
| readonly source: ForeignKeyReference; | ||
| readonly target: ForeignKeyReference; | ||
| readonly constraint: boolean; | ||
| readonly index: boolean; | ||
| readonly name?: string; | ||
| readonly onDelete?: ReferentialAction; | ||
| readonly onUpdate?: ReferentialAction; | ||
| constructor(input: ForeignKeyInput); | ||
| } | ||
| //#endregion | ||
| export { ForeignKeyReferenceInput as a, ForeignKeyReference as i, ForeignKeyInput as n, SqlNode as o, ReferentialAction as r, ForeignKey as t }; | ||
| //# sourceMappingURL=foreign-key-BATxB95l.d.mts.map |
| {"version":3,"file":"foreign-key-BATxB95l.d.mts","names":[],"sources":["../src/ir/sql-node.ts","../src/ir/foreign-key-reference.ts","../src/ir/foreign-key.ts"],"mappings":";;;;;;;AAkCA;;;;;;;;;;;;ACnBA;;;;;;;;;AAIkB;AAmBlB;;;;;;;uBDJsB,OAAA,SAAgB,UAAU;EAAA,SACrC,IAAA;;;;;;;AADX;;;;;;;;;UCnBiB,wBAAA;EAAA,SACN,WAAA;EAAA,SACA,SAAA;EAAA,SACA,OAAA;EAAA,SACA,OAAA;AAAA;;;;;;;AAAO;AAmBlB;;;;;;;;;cAAa,mBAAA,SAA4B,OAAA;EAAA,SAC9B,WAAA,EAAa,WAAA;EAAA,SACb,SAAA;EAAA,SACA,OAAA;EAAA,SACQ,OAAA;cAEL,KAAA,EAAO,wBAAA;AAAA;;;KCxCT,iBAAA;AAAA,UAEK,eAAA;EAAA,SACN,MAAA,EAAQ,mBAAA,GAAsB,wBAAA;EAAA,SAC9B,MAAA,EAAQ,mBAAA,GAAsB,wBAAA;EAAA,SAC9B,IAAA;EAAA,SACA,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAA;EFwBX;EAAA,SEtBA,UAAA;;WAEA,KAAA;AAAA;;;ADAX;;;;;;;;;AAIkB;cCWL,UAAA,SAAmB,OAAA;EAAA,SACrB,MAAA,EAAQ,mBAAA;EAAA,SACR,MAAA,EAAQ,mBAAA;EAAA,SACR,UAAA;EAAA,SACA,KAAA;EAAA,SACQ,IAAA;EAAA,SACA,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAA;cAEhB,KAAA,EAAO,eAAA;AAAA"} |
| import { o as SqlNode } from "./foreign-key-BATxB95l.mjs"; | ||
| import { i as StorageTable, t as StorageValueSet } from "./storage-value-set-DXL-7PYo.mjs"; | ||
| import { Namespace, NamespaceBase, Storage, StorageType } from "@prisma-next/framework-components/ir"; | ||
| import { StorageHashBase } from "@prisma-next/contract/types"; | ||
| import { AuthoringContributions } from "@prisma-next/framework-components/authoring"; | ||
| //#region src/ir/storage-type-instance.d.ts | ||
| /** | ||
| * Sentinel kind for the legacy codec-triple shape persisted under | ||
| * `SqlStorage.types`. Plain JSON-clean object literals carry this | ||
| * discriminator so the polymorphic slot dispatch can route them down | ||
| * the codec path while target-specific IR class instances (e.g. the | ||
| * Postgres enum class) keep their own narrower `kind` literal. | ||
| */ | ||
| declare const CODEC_INSTANCE_KIND: "codec-instance"; | ||
| /** | ||
| * Structural sub-interface of {@link StorageType} for codec-typed entries | ||
| * in `SqlStorage.types`. These are plain object literals — there is no | ||
| * runtime IR class, the JSON envelope round-trips through the slot | ||
| * unchanged. The `kind: 'codec-instance'` discriminator is the dispatch | ||
| * key that distinguishes codec-typed entries from any class-instance | ||
| * kinds a target pack contributes to the polymorphic slot. | ||
| */ | ||
| interface StorageTypeInstance extends StorageType { | ||
| readonly kind: typeof CODEC_INSTANCE_KIND; | ||
| readonly codecId: string; | ||
| readonly nativeType: string; | ||
| readonly typeParams: Record<string, unknown>; | ||
| } | ||
| /** | ||
| * Construction-time input for a codec-triple entry. Symmetric with the | ||
| * structural runtime shape minus the `kind` discriminator — callers may | ||
| * omit `kind`; the helper {@link toStorageTypeInstance} stamps it on. | ||
| * `typeParams` may be omitted on input; the constructor normalises a | ||
| * missing value to `{}` so the in-memory shape is always present. | ||
| */ | ||
| interface StorageTypeInstanceInput { | ||
| readonly codecId: string; | ||
| readonly nativeType: string; | ||
| readonly typeParams?: Record<string, unknown>; | ||
| } | ||
| /** | ||
| * Stamp the codec-instance `kind` discriminator on a caller-supplied | ||
| * codec triple. Idempotent: input that already carries the discriminator | ||
| * passes through unchanged. Missing `typeParams` is normalised to `{}`. | ||
| */ | ||
| declare function toStorageTypeInstance(input: StorageTypeInstanceInput): StorageTypeInstance; | ||
| /** | ||
| * Type-guard for codec-typed entries on the polymorphic | ||
| * `SqlStorage.types` slot. Distinguishes `StorageTypeInstance` from | ||
| * any class-instance kinds a target pack contributes. | ||
| */ | ||
| declare function isStorageTypeInstance(value: unknown): value is StorageTypeInstance; | ||
| //#endregion | ||
| //#region src/ir/sql-storage.d.ts | ||
| /** | ||
| * Polymorphic value type for document-scoped `SqlStorage.types` entries | ||
| * (codec aliases / parameterised native type registrations). | ||
| * | ||
| * Postgres native enum registrations live under the postgres-specific | ||
| * `entries.type` slot on `PostgresSchema` (target layer), not here. | ||
| */ | ||
| type SqlStorageTypeEntry = StorageTypeInstance | StorageTypeInstanceInput; | ||
| interface SqlNamespaceInput { | ||
| readonly id: string; | ||
| readonly entries: Readonly<Record<string, Readonly<Record<string, unknown>>>>; | ||
| } | ||
| /** | ||
| * Target-supplied factory that materializes a `Namespace` from a SQL | ||
| * `SqlNamespaceInput` (used to populate `SqlStorage.namespaces`). | ||
| */ | ||
| type SqlNamespaceFactory = (input: SqlNamespaceInput) => Namespace; | ||
| /** | ||
| * SQL-family extension of the framework `AuthoringContributions`. SQL target | ||
| * packs add a `createNamespace` factory so the PSL/TS authoring paths can | ||
| * materialize namespaces (and merge lowered extension-block entities) without | ||
| * each consumer re-specifying it. The factory is SQL-specific, so it lives here | ||
| * rather than on the framework `AuthoringContributions` base. | ||
| */ | ||
| interface SqlAuthoringContributions extends AuthoringContributions { | ||
| readonly createNamespace?: SqlNamespaceFactory; | ||
| } | ||
| /** | ||
| * Narrows framework `AuthoringContributions` to the SQL-family shape by testing | ||
| * for the SQL-specific `createNamespace` capability. | ||
| */ | ||
| declare function isSqlAuthoringContributions(authoring: AuthoringContributions | undefined): authoring is SqlAuthoringContributions; | ||
| interface SqlStorageInput<THash extends string = string> { | ||
| readonly storageHash: StorageHashBase<THash>; | ||
| readonly types?: Record<string, SqlStorageTypeEntry>; | ||
| readonly namespaces: Readonly<Record<string, SqlNamespaceBase>>; | ||
| } | ||
| /** | ||
| * SQL Contract IR root node for the `storage` field. | ||
| * | ||
| * Single concrete family-shared class — both Postgres and SQLite | ||
| * consume this class today. Per-target storage subclasses are | ||
| * introduced when each target's namespace shape earns its | ||
| * target-specific concretion (target-specific derived fields, | ||
| * target-specific storage extensions). | ||
| * | ||
| * Honours the framework `Storage` interface: every SQL IR carries a | ||
| * `namespaces` map keyed by namespace id. Callers must supply fully | ||
| * constructed `Namespace` instances — construction discipline lives | ||
| * in the authoring builders and deserializer hydration paths. | ||
| * | ||
| * The constructor normalises optional `types` into class instances. | ||
| * `types` is polymorphic per Decision 18 Option B: codec-triple inputs | ||
| * are stamped with `kind: 'codec-instance'`; hydration of raw JSON | ||
| * class-instance entries (carrying their narrower `kind` literal) is | ||
| * the per-target serializer's responsibility (so the family base does | ||
| * not import target-specific subclasses). | ||
| */ | ||
| /** | ||
| * The typed `entries` shape for SQL family namespaces. The open dictionary | ||
| * is intersected with optional known-kind maps so that `ns.entries.table` | ||
| * and `ns.entries.valueSet` resolve without a cast, while unknown pack- | ||
| * contributed kinds remain valid (the `Record` part allows any string key). | ||
| */ | ||
| type SqlNamespaceEntries = Readonly<Record<string, Readonly<Record<string, unknown>>>> & { | ||
| readonly table?: Readonly<Record<string, StorageTable>>; | ||
| readonly valueSet?: Readonly<Record<string, StorageValueSet>>; | ||
| }; | ||
| /** | ||
| * Structural interface for SQL family namespaces. Generated `.d.ts` contract | ||
| * types satisfy this structurally (no prototype methods). The runtime | ||
| * abstract class `SqlNamespaceBase` extends this. | ||
| * | ||
| * `qualifyTable` is optional so JSON-shaped contract types (which carry no | ||
| * methods) are accepted where `SqlNamespace` is required. Hydrated | ||
| * `SqlNamespaceBase` instances always have it. | ||
| */ | ||
| interface SqlNamespace { | ||
| readonly kind: string; | ||
| readonly id: string; | ||
| readonly entries: SqlNamespaceEntries; | ||
| qualifyTable?(tableName: string): string; | ||
| } | ||
| /** | ||
| * Abstract SQL family namespace base class. Target concretions (`PostgresSchema`, | ||
| * `SqliteDatabase`, …) extend this — it is never instantiated directly. | ||
| * `entries` is the open ADR 224 dictionary: `entries[entityKind][entityName]` | ||
| * addresses any entity. | ||
| */ | ||
| declare abstract class SqlNamespaceBase extends NamespaceBase implements SqlNamespace { | ||
| abstract readonly id: string; | ||
| abstract readonly entries: SqlNamespaceEntries; | ||
| abstract qualifyTable(tableName: string): string; | ||
| } | ||
| /** | ||
| * Realm-safe guard for hydrated `SqlNamespaceBase` concretions. Checks | ||
| * `qualifyTable` structurally instead of `instanceof NamespaceBase`, so it | ||
| * survives duplicate-module boundaries (e.g. dist e2e where the target and | ||
| * the family carry separate copies of `@prisma-next/framework-components`). | ||
| * | ||
| * Every concrete `SqlNamespaceBase` subclass (`PostgresSchema`, `SqliteDatabase`, | ||
| * `TestSqlNamespace`, …) implements `qualifyTable`. Raw `SqlNamespaceInput` | ||
| * objects (`{ id, entries }`) do not. | ||
| */ | ||
| declare function isMaterializedSqlNamespace(x: unknown): x is SqlNamespaceBase; | ||
| declare class SqlStorage<THash extends string = string> extends SqlNode implements Storage { | ||
| readonly storageHash: StorageHashBase<THash>; | ||
| readonly namespaces: Readonly<Record<string, SqlNamespace>>; | ||
| readonly types?: Readonly<Record<string, StorageTypeInstance>>; | ||
| constructor(input: SqlStorageInput<THash>); | ||
| } | ||
| //#endregion | ||
| export { SqlNamespaceFactory as a, SqlStorageInput as c, isSqlAuthoringContributions as d, CODEC_INSTANCE_KIND as f, toStorageTypeInstance as g, isStorageTypeInstance as h, SqlNamespaceEntries as i, SqlStorageTypeEntry as l, StorageTypeInstanceInput as m, SqlNamespace as n, SqlNamespaceInput as o, StorageTypeInstance as p, SqlNamespaceBase as r, SqlStorage as s, SqlAuthoringContributions as t, isMaterializedSqlNamespace as u }; | ||
| //# sourceMappingURL=sql-storage-Dc1Dy3Vb.d.mts.map |
| {"version":3,"file":"sql-storage-Dc1Dy3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AA,CAAS,MAAA,SAAe,YAAA;EAAA,SAChC,QAAA,GAAW,QAAA,CAAS,MAAA,SAAe,eAAA;AAAA;;;;;;;AApEa;AAO3D;;UAyEiB,YAAA;EAAA,SACN,IAAA;EAAA,SACA,EAAA;EAAA,SACA,OAAA,EAAS,mBAAmB;EACrC,YAAA,EAAc,SAAA;AAAA;AA7EyD;AASzE;;;;;AATyE,uBAsFnD,gBAAA,SAAyB,aAAA,YAAyB,YAAA;EAAA,kBAC3C,EAAA;EAAA,kBACA,OAAA,EAAS,mBAAA;EAAA,SAE3B,YAAA,CAAa,SAAA;AAAA;;;;;;;;;AAvEiB;AAOzC;iBA6EgB,0BAAA,CAA2B,CAAA,YAAa,CAAA,IAAK,gBAAgB;AAAA,cAKhE,UAAA,wCAAkD,OAAA,YAAmB,OAAA;EAAA,SACvE,WAAA,EAAa,eAAA,CAAgB,KAAA;EAAA,SAC7B,UAAA,EAAY,QAAA,CAAS,MAAA,SAAe,YAAA;EAAA,SAC5B,KAAA,GAAQ,QAAA,CAAS,MAAA,SAAe,mBAAA;cAErC,KAAA,EAAO,eAAA,CAAgB,KAAA;AAAA"} |
| import { n as ForeignKeyInput, o as SqlNode, t as ForeignKey } from "./foreign-key-BATxB95l.mjs"; | ||
| import { ColumnDefault, ControlPolicy, JsonValue, ValueSetRef } from "@prisma-next/contract/types"; | ||
| //#region src/ir/check-constraint.d.ts | ||
| /** | ||
| * Hydration / construction input shape for {@link CheckConstraint}. | ||
| * Mirrors the on-disk storage JSON envelope so the serializer hydration | ||
| * walker can hand a validated literal straight to `new`. | ||
| */ | ||
| interface CheckConstraintInput { | ||
| readonly name: string; | ||
| readonly column: string; | ||
| readonly valueSet: ValueSetRef; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a table-level check constraint that restricts | ||
| * a column to the permitted values of a value-set. | ||
| * | ||
| * The constraint is **structured** (names a column and a value-set | ||
| * reference), not a raw SQL expression. Each target renders its own DDL | ||
| * from the structured form, keeping the contract target-agnostic. | ||
| * | ||
| * Construction is idempotent: passing an existing `CheckConstraint` | ||
| * instance as input produces a new instance with identical fields. | ||
| * The constructor does not use `instanceof` for input discrimination — | ||
| * it reads plain named properties, which is sufficient since | ||
| * `CheckConstraintInput` is a structural type. | ||
| */ | ||
| declare class CheckConstraint extends SqlNode { | ||
| readonly name: string; | ||
| readonly column: string; | ||
| readonly valueSet: ValueSetRef; | ||
| constructor(input: CheckConstraintInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/primary-key.d.ts | ||
| interface PrimaryKeyInput { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a table's primary-key constraint. | ||
| */ | ||
| declare class PrimaryKey extends SqlNode { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| constructor(input: PrimaryKeyInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/sql-index.d.ts | ||
| interface IndexInput { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| readonly type?: string; | ||
| readonly options?: Record<string, unknown>; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a table-level secondary index. | ||
| * | ||
| * Note that this class shadows the global TypeScript `Index` lib type | ||
| * at the family-shared name; consumer files that need both should | ||
| * alias one (e.g. | ||
| * `import { Index as SqlIndexNode } from '@prisma-next/sql-contract/types'`). | ||
| */ | ||
| declare class Index extends SqlNode { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| readonly type?: string; | ||
| readonly options?: Record<string, unknown>; | ||
| constructor(input: IndexInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/storage-column.d.ts | ||
| /** | ||
| * Hydration / construction input shape for {@link StorageColumn}. Mirrors | ||
| * the on-disk storage JSON envelope exactly so the family-base | ||
| * serializer's hydration walker can hand an arktype-validated literal | ||
| * straight to `new`. | ||
| * | ||
| * `typeParams` and `typeRef` remain mutually exclusive (one or the | ||
| * other, not both); the constructor preserves whichever caller-side | ||
| * choice the input encodes. | ||
| */ | ||
| interface StorageColumnInput { | ||
| readonly nativeType: string; | ||
| readonly codecId: string; | ||
| readonly nullable: boolean; | ||
| readonly many?: boolean; | ||
| readonly typeParams?: Record<string, unknown>; | ||
| readonly typeRef?: string; | ||
| readonly default?: ColumnDefault; | ||
| readonly control?: ControlPolicy; | ||
| readonly valueSet?: ValueSetRef; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a single column entry in `StorageTable.columns`. | ||
| * | ||
| * Single concrete family-shared class — every SQL target reads the | ||
| * same column shape today, so there is no per-target subclass. The | ||
| * class type accepts any caller that constructs via | ||
| * `new StorageColumn(input)`; literal construction sites must pass | ||
| * through the constructor or the family-base hydration walker. | ||
| * | ||
| * The column's `name` is not on the class — columns are keyed by name | ||
| * in the parent `StorageTable.columns: Record<string, StorageColumn>` | ||
| * map, so a `name` field would be redundant with the key. | ||
| */ | ||
| declare class StorageColumn extends SqlNode { | ||
| readonly nativeType: string; | ||
| readonly codecId: string; | ||
| readonly nullable: boolean; | ||
| readonly many?: boolean; | ||
| readonly typeParams?: Record<string, unknown>; | ||
| readonly typeRef?: string; | ||
| readonly default?: ColumnDefault; | ||
| readonly control?: ControlPolicy; | ||
| readonly valueSet?: ValueSetRef; | ||
| constructor(input: StorageColumnInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/unique-constraint.d.ts | ||
| interface UniqueConstraintInput { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a table-level unique constraint. | ||
| */ | ||
| declare class UniqueConstraint extends SqlNode { | ||
| readonly columns: readonly string[]; | ||
| readonly name?: string; | ||
| constructor(input: UniqueConstraintInput); | ||
| } | ||
| //#endregion | ||
| //#region src/ir/storage-table.d.ts | ||
| interface StorageTableInput { | ||
| readonly columns: Record<string, StorageColumn | StorageColumnInput>; | ||
| readonly primaryKey?: PrimaryKey | PrimaryKeyInput; | ||
| readonly uniques: ReadonlyArray<UniqueConstraint | UniqueConstraintInput>; | ||
| readonly indexes: ReadonlyArray<Index | IndexInput>; | ||
| readonly foreignKeys: ReadonlyArray<ForeignKey | ForeignKeyInput>; | ||
| readonly control?: ControlPolicy; | ||
| readonly checks?: ReadonlyArray<CheckConstraint | CheckConstraintInput>; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a single table entry in a namespace's | ||
| * `tables` map. | ||
| * | ||
| * The constructor normalises nested IR-class fields (columns, primary | ||
| * key, uniques, indexes, foreign keys) into the appropriate class | ||
| * instances so downstream walks see a uniform AST regardless of whether | ||
| * the input was a JSON literal or an already-constructed class. | ||
| * | ||
| * The table's `name` is not on the class — tables are keyed by name in | ||
| * the parent namespace's `tables: Record<string, StorageTable>` map. | ||
| */ | ||
| declare class StorageTable extends SqlNode { | ||
| readonly columns: Readonly<Record<string, StorageColumn>>; | ||
| readonly uniques: ReadonlyArray<UniqueConstraint>; | ||
| readonly indexes: ReadonlyArray<Index>; | ||
| readonly foreignKeys: ReadonlyArray<ForeignKey>; | ||
| readonly primaryKey?: PrimaryKey; | ||
| readonly control?: ControlPolicy; | ||
| readonly checks?: ReadonlyArray<CheckConstraint>; | ||
| constructor(input: StorageTableInput); | ||
| /** | ||
| * Runtime guard that a namespace `table` entry is really a `StorageTable`. | ||
| * The compiler already types the entry as `StorageTable`, but a | ||
| * freshly-deserialized contract may carry plain JSON at that slot until | ||
| * hydration; this duck-types the structural shape. Accepts `undefined` so | ||
| * optional-chained entry lookups pass straight through. | ||
| */ | ||
| static is(value: StorageTable | undefined): value is StorageTable; | ||
| static assert(value: StorageTable | undefined, coordinate: string): asserts value is StorageTable; | ||
| } | ||
| //#endregion | ||
| //#region src/ir/storage-value-set.d.ts | ||
| /** | ||
| * Hydration / construction input shape for {@link StorageValueSet}. | ||
| * Mirrors the on-disk storage JSON envelope so the serializer hydration | ||
| * walker can hand a validated literal straight to `new`. | ||
| */ | ||
| interface StorageValueSetInput { | ||
| readonly kind: 'valueSet'; | ||
| /** Ordered permitted values, codec-encoded. Declaration order is preserved. */ | ||
| readonly values: readonly JsonValue[]; | ||
| } | ||
| /** | ||
| * SQL Contract IR node for a value-set entry in a namespace's `valueSet` | ||
| * map (`SqlNamespace.entries.valueSet`). | ||
| * | ||
| * A value-set records the ordered set of permitted codec-encoded values for | ||
| * an enum-like column restriction. It does not carry a `codecId` — the | ||
| * column that references it already holds the codec; the value-set holds | ||
| * only the permitted values. | ||
| * | ||
| * The node's `kind` is enumerable (`'valueSet'`) so the JSON envelope | ||
| * carries the discriminator and the serializer hydration walker can | ||
| * dispatch on it. This follows the per-leaf enumerable-kind convention | ||
| * established in the SQL-node comment (future polymorphic dispatch on | ||
| * namespace entries needs the discriminator in JSON). | ||
| * | ||
| * The entry's name is not on the class — value-sets are keyed by name in | ||
| * the parent namespace's `valueSet: Record<string, StorageValueSet>` map. | ||
| */ | ||
| declare class StorageValueSet extends SqlNode { | ||
| readonly kind: "valueSet"; | ||
| readonly values: readonly JsonValue[]; | ||
| constructor(input: StorageValueSetInput); | ||
| } | ||
| declare function isStorageValueSet(value: unknown): value is StorageValueSet; | ||
| //#endregion | ||
| export { StorageTableInput as a, StorageColumn as c, IndexInput as d, PrimaryKey as f, CheckConstraintInput as h, StorageTable as i, StorageColumnInput as l, CheckConstraint as m, StorageValueSetInput as n, UniqueConstraint as o, PrimaryKeyInput as p, isStorageValueSet as r, UniqueConstraintInput as s, StorageValueSet as t, Index as u }; | ||
| //# sourceMappingURL=storage-value-set-DXL-7PYo.d.mts.map |
| {"version":3,"file":"storage-value-set-DXL-7PYo.d.mts","names":[],"sources":["../src/ir/check-constraint.ts","../src/ir/primary-key.ts","../src/ir/sql-index.ts","../src/ir/storage-column.ts","../src/ir/unique-constraint.ts","../src/ir/storage-table.ts","../src/ir/storage-value-set.ts"],"mappings":";;;;;;AASA;;;UAAiB,oBAAA;EAAA,SACN,IAAA;EAAA,SACA,MAAA;EAAA,SACA,QAAA,EAAU,WAAW;AAAA;;AAAA;AAiBhC;;;;;;;;;;;;cAAa,eAAA,SAA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-components/codec"; | ||
| import { ControlDriverInstance } from "@prisma-next/framework-components/control"; | ||
| //#region src/types.d.ts | ||
| interface SqlControlDriverInstance<T extends string = string> extends ControlDriverInstance<'sql', T> { | ||
| query<Row = Record<string, unknown>>(sql: string, params?: readonly unknown[]): Promise<{ | ||
| readonly rows: Row[]; | ||
| }>; | ||
| } | ||
| type ForeignKeyOptions = { | ||
| readonly name?: string; | ||
| readonly onDelete?: ReferentialAction; | ||
| readonly onUpdate?: ReferentialAction; | ||
| }; | ||
| type SqlModelFieldStorage = { | ||
| readonly column: string; | ||
| readonly codecId?: string; | ||
| readonly nullable?: boolean; | ||
| }; | ||
| type SqlModelStorage = { | ||
| readonly table: string; | ||
| readonly namespaceId: string; | ||
| readonly fields: Record<string, SqlModelFieldStorage>; | ||
| }; | ||
| declare const DEFAULT_FK_CONSTRAINT = true; | ||
| declare const DEFAULT_FK_INDEX = true; | ||
| declare function applyFkDefaults(fk: { | ||
| constraint?: boolean | undefined; | ||
| index?: boolean | undefined; | ||
| }, overrideDefaults?: { | ||
| constraint?: boolean | undefined; | ||
| index?: boolean | undefined; | ||
| }): { | ||
| constraint: boolean; | ||
| index: boolean; | ||
| }; | ||
| type NamespacedFieldTypeMap = Record<string, Record<string, Record<string, unknown>>>; | ||
| type NamespacedStorageColumnTypeMap = Record<string, Record<string, Record<string, unknown>>>; | ||
| type TypeMaps<TCodecTypes extends Record<string, { | ||
| output: unknown; | ||
| }> = Record<string, never>, TQueryOperationTypes extends Record<string, unknown> = Record<string, never>, TFieldOutputTypes extends NamespacedFieldTypeMap = Record<string, never>, TFieldInputTypes extends NamespacedFieldTypeMap = Record<string, never>, TStorageColumnTypes extends NamespacedStorageColumnTypeMap = Record<string, never>, TStorageColumnInputTypes extends NamespacedStorageColumnTypeMap = Record<string, never>> = { | ||
| readonly codecTypes: TCodecTypes; | ||
| readonly queryOperationTypes: TQueryOperationTypes; | ||
| readonly fieldOutputTypes: TFieldOutputTypes; | ||
| readonly fieldInputTypes: TFieldInputTypes; | ||
| readonly storageColumnTypes: TStorageColumnTypes; | ||
| readonly storageColumnInputTypes: TStorageColumnInputTypes; | ||
| }; | ||
| type CodecTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly codecTypes: infer C; | ||
| } ? C extends Record<string, { | ||
| output: unknown; | ||
| }> ? C : Record<string, never> : Record<string, never>; | ||
| /** | ||
| * Dispatch hint identifying the first-argument target of an operation. | ||
| * | ||
| * Used by ORM column helpers to decide whether an operation is reachable on a | ||
| * field. Names a concrete codec identity, a set of capability traits the | ||
| * field's codec must carry, or targets list-typed (`many`) fields. Element | ||
| * capability gating for list ops travels in `elementTraits`. | ||
| */ | ||
| type QueryOperationSelfSpec = { | ||
| readonly codecId: string; | ||
| readonly traits?: never; | ||
| readonly many?: never; | ||
| } | { | ||
| readonly traits: readonly CodecTrait[]; | ||
| readonly codecId?: never; | ||
| readonly many?: never; | ||
| } | { | ||
| readonly many: true; | ||
| readonly elementTraits?: readonly CodecTrait[]; | ||
| readonly codecId?: never; | ||
| readonly traits?: never; | ||
| }; | ||
| /** | ||
| * Structural shape an operation's impl must return: any value carrying a | ||
| * codec-exact `returnType` descriptor. `Expression<T>` (from | ||
| * `@prisma-next/sql-relational-core/expression`, with `T extends ScopeField`) | ||
| * extends this. Trait-targeted returns are deliberately excluded — predicate | ||
| * detection and result decoding both depend on knowing the concrete return | ||
| * codec. | ||
| */ | ||
| type QueryOperationReturn = { | ||
| readonly returnType: { | ||
| readonly codecId: string; | ||
| readonly nullable: boolean; | ||
| }; | ||
| }; | ||
| type QueryOperationTypeEntry = { | ||
| readonly self?: QueryOperationSelfSpec; | ||
| readonly impl: (...args: never[]) => QueryOperationReturn; | ||
| }; | ||
| type SqlQueryOperationTypes<_CT extends Record<string, { | ||
| readonly input: unknown; | ||
| readonly output: unknown; | ||
| }>, T extends Record<string, QueryOperationTypeEntry>> = T; | ||
| type QueryOperationTypesBase = Record<string, QueryOperationTypeEntry>; | ||
| type QueryOperationTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly queryOperationTypes: infer Q; | ||
| } ? Q extends Record<string, unknown> ? Q : Record<string, never> : Record<string, never>; | ||
| type TypeMapsPhantomKey = '__@prisma-next/sql-contract/typeMaps@__'; | ||
| type ContractWithTypeMaps<TContract, TTypeMaps> = TContract & { readonly [K in TypeMapsPhantomKey]?: TTypeMaps }; | ||
| type ExtractTypeMapsFromContract<T> = TypeMapsPhantomKey extends keyof T ? NonNullable<T[TypeMapsPhantomKey & keyof T]> : never; | ||
| type FieldOutputTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly fieldOutputTypes: infer F; | ||
| } ? F extends NamespacedFieldTypeMap ? F : Record<string, never> : Record<string, never>; | ||
| type FieldInputTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly fieldInputTypes: infer F; | ||
| } ? F extends NamespacedFieldTypeMap ? F : Record<string, never> : Record<string, never>; | ||
| type StorageColumnTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly storageColumnTypes: infer F; | ||
| } ? F extends NamespacedStorageColumnTypeMap ? F : Record<string, never> : Record<string, never>; | ||
| type StorageColumnInputTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends { | ||
| readonly storageColumnInputTypes: infer F; | ||
| } ? F extends NamespacedStorageColumnTypeMap ? F : Record<string, never> : Record<string, never>; | ||
| type ExtractCodecTypes<T> = CodecTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ExtractQueryOperationTypes<T> = QueryOperationTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ExtractFieldOutputTypes<T> = FieldOutputTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ExtractFieldInputTypes<T> = FieldInputTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ExtractStorageColumnTypes<T> = StorageColumnTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ExtractStorageColumnInputTypes<T> = StorageColumnInputTypesOf<ExtractTypeMapsFromContract<T>>; | ||
| type ResolveCodecTypes<TContract, TTypeMaps> = [TTypeMaps] extends [never] ? ExtractCodecTypes<TContract> : CodecTypesOf<TTypeMaps>; | ||
| //#endregion | ||
| export { TypeMapsPhantomKey as A, SqlControlDriverInstance as C, StorageColumnInputTypesOf as D, SqlQueryOperationTypes as E, StorageColumnTypesOf as O, ResolveCodecTypes as S, SqlModelStorage as T, QueryOperationReturn as _, ExtractCodecTypes as a, QueryOperationTypesBase as b, ExtractQueryOperationTypes as c, ExtractTypeMapsFromContract as d, FieldInputTypesOf as f, NamespacedStorageColumnTypeMap as g, NamespacedFieldTypeMap as h, DEFAULT_FK_INDEX as i, applyFkDefaults as j, TypeMaps as k, ExtractStorageColumnInputTypes as l, ForeignKeyOptions as m, ContractWithTypeMaps as n, ExtractFieldInputTypes as o, FieldOutputTypesOf as p, DEFAULT_FK_CONSTRAINT as r, ExtractFieldOutputTypes as s, CodecTypesOf as t, ExtractStorageColumnTypes as u, QueryOperationSelfSpec as v, SqlModelFieldStorage as w, QueryOperationTypesOf as x, QueryOperationTypeEntry as y }; | ||
| //# sourceMappingURL=types-ChH7hULD.d.mts.map |
| {"version":3,"file":"types-ChH7hULD.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;UAIiB,wBAAA,oCACP,qBAAA,QAA6B,CAAA;EACrC,KAAA,OAAY,MAAA,mBACV,GAAA,UACA,MAAA,wBACC,OAAA;IAAA,SAAmB,IAAA,EAAM,GAAA;EAAA;AAAA;AAAA,KAgDlB,iBAAA;EAAA,SACD,IAAA;EAAA,SACA,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAiB;AAAA;AAAA,KAG3B,oBAAA;EAAA,SACD,MAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA;AAAA;AAAA,KAGC,eAAA;EAAA,SACD,KAAA;EAAA,SACA,WAAA;EAAA,SACA,MAAA,EAAQ,MAAM,SAAS,oBAAA;AAAA;AAAA,cAGrB,qBAAA;AAAA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