@forinda/kickjs-db 8.11.3 → 8.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-B1aAO8fL.d.mts → adapter-o2we9YIw.d.mts} +2 -2
- package/dist/{adapter-B1aAO8fL.d.mts.map → adapter-o2we9YIw.d.mts.map} +1 -1
- package/dist/cli.d.mts +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/{create-Bsf7or0m.mjs → create-CWQcQNgu.mjs} +3 -3
- package/dist/create-CWQcQNgu.mjs.map +1 -0
- package/dist/{custom-type-B2LmdFuT.mjs → custom-type-ZuO--c_x.mjs} +2 -2
- package/dist/custom-type-ZuO--c_x.mjs.map +1 -0
- package/dist/devtools-events.d.mts +1 -1
- package/dist/devtools-events.mjs +1 -1
- package/dist/{index-Bot_2VFH.d.mts → index-BACCTsy5.d.mts} +122 -9
- package/dist/{index-Bot_2VFH.d.mts.map → index-BACCTsy5.d.mts.map} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +2 -2
- package/dist/mysql.d.mts +2 -2
- package/dist/mysql.mjs +2 -2
- package/dist/{pg-DCCDrhAN.mjs → pg-DV5SG4cf.mjs} +3 -3
- package/dist/pg-DV5SG4cf.mjs.map +1 -0
- package/dist/pg.d.mts +19 -5
- package/dist/pg.d.mts.map +1 -1
- package/dist/pg.mjs +2 -2
- package/dist/pglite.d.mts +1 -1
- package/dist/pglite.mjs +1 -1
- package/dist/{schema-BjwousYZ.d.mts → schema-jLdsVhUe.d.mts} +3 -3
- package/dist/{schema-BjwousYZ.d.mts.map → schema-jLdsVhUe.d.mts.map} +1 -1
- package/dist/{schema-types-BbQzqRfa.d.mts → schema-types-CdU4u-Ow.d.mts} +3 -3
- package/dist/{schema-types-BbQzqRfa.d.mts.map → schema-types-CdU4u-Ow.d.mts.map} +1 -1
- package/dist/schema.d.mts +1 -1
- package/dist/schema.mjs +2 -2
- package/dist/{split-statements-BqrIZ2Zr.mjs → split-statements-lMBXme3t.mjs} +2 -2
- package/dist/{split-statements-BqrIZ2Zr.mjs.map → split-statements-lMBXme3t.mjs.map} +1 -1
- package/dist/sqlite.d.mts +1 -1
- package/dist/sqlite.mjs +2 -2
- package/dist/{src-DUmaOaNW.mjs → src-LEmnUV3S.mjs} +3 -3
- package/dist/{src-DUmaOaNW.mjs.map → src-LEmnUV3S.mjs.map} +1 -1
- package/dist/{table-6E5JCtHD.d.mts → table-BGk08X3C.d.mts} +19 -3
- package/dist/table-BGk08X3C.d.mts.map +1 -0
- package/dist/testing.d.mts +2 -2
- package/dist/testing.mjs +2 -2
- package/dist/{types-OaIxajA4.d.mts → types-8xZUYm43.d.mts} +2 -2
- package/dist/{types-OaIxajA4.d.mts.map → types-8xZUYm43.d.mts.map} +1 -1
- package/dist/{types-Bz1G4t-q.d.mts → types-DB_xyeQT.d.mts} +77 -6
- package/dist/types-DB_xyeQT.d.mts.map +1 -0
- package/package.json +4 -4
- package/dist/create-Bsf7or0m.mjs.map +0 -1
- package/dist/custom-type-B2LmdFuT.mjs.map +0 -1
- package/dist/pg-DCCDrhAN.mjs.map +0 -1
- package/dist/table-6E5JCtHD.d.mts.map +0 -1
- package/dist/types-Bz1G4t-q.d.mts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"custom-type-B2LmdFuT.mjs","names":[],"sources":["../src/snapshot/types.ts","../src/dsl/columns/types.ts","../src/custom-type.ts"],"sourcesContent":["export type Dialect = 'postgres' | 'sqlite' | 'mysql'\n\n/** The foreign-key actions, in the snapshot's spelling. */\nexport const FK_ACTION_NAMES = [\n 'cascade',\n 'restrict',\n 'set_null',\n 'set_default',\n 'no_action',\n] as const\nexport type FkAction = (typeof FK_ACTION_NAMES)[number]\n\nexport interface ColumnSnapshot {\n name: string\n type: string\n nullable: boolean\n default: string | null\n /** `default` is SQL to evaluate (`.defaultSql()`), not a value. Absent means a value. */\n defaultSql?: true\n /**\n * Only on an introspected Postgres snapshot: `column_default` as the\n * database reports it. `default` is normalised and can't tell the literal\n * `'(f())'::text` from the expression `(f())::text`; the drift check can.\n */\n defaultRaw?: string\n primaryKey: boolean\n /** A column the database computes from others: `GENERATED ALWAYS AS (expression)`. */\n generated?: { expression: string; stored: boolean }\n /** An identity column (Postgres): `GENERATED ALWAYS | BY DEFAULT AS IDENTITY`. */\n identity?: 'always' | 'byDefault'\n /** The column's comment in the database (Postgres, MySQL). */\n comment?: string\n /**\n * Only on an introspected snapshot read back into keys: the database's own\n * name, when `casing` wouldn't give it back — rendered as `.colName()`.\n */\n colName?: string\n}\n\nexport interface IndexSnapshot {\n name: string\n /** Key parts in order: a column name, or an SQL expression wrapped in parentheses. */\n columns: string[]\n unique: boolean\n /** Partial index predicate (Postgres, SQLite), as SQL. */\n where?: string\n /** Index method, e.g. `gin`, `gist`, `hnsw` (Postgres) or `hash` (MySQL). Absent means the default. */\n using?: string\n /** Non-key columns stored in the index (Postgres `INCLUDE`). */\n include?: string[]\n /** Operator class per key part, keyed by the entry in `columns` (Postgres). */\n opclasses?: Record<string, string>\n /** Build and drop without locking writes (Postgres). Doesn't change the index itself. */\n concurrently?: boolean\n}\n\nexport interface ForeignKeySnapshot {\n name: string\n columns: string[]\n refTable: string\n refColumns: string[]\n onDelete: FkAction\n onUpdate: FkAction\n}\n\nexport interface CheckSnapshot {\n name: string\n expression: string\n}\n\nexport interface TableSnapshot {\n /**\n * Bare table name, unqualified. The schema (when any) lives in\n * {@link TableSnapshot.schema}; the map key on `SchemaSnapshot.tables` is\n * the qualified form (`billing.invoices`).\n */\n name: string\n /**\n * Named SQL schema, from `pgSchema('x').table(...)`. Absent for tables in\n * the connection's default search_path, which keeps pre-schema snapshots\n * byte-identical (and their migration hashes valid).\n */\n schema?: string\n columns: Record<string, ColumnSnapshot>\n indexes: IndexSnapshot[]\n foreignKeys: ForeignKeySnapshot[]\n checks: CheckSnapshot[]\n /**\n * The key declared with `primaryKey(name?).on(...)`: its name and column\n * order. The columns also carry `primaryKey: true`. Absent for a key\n * declared on columns, so those snapshots — and migration hashes — stay\n * as they were.\n */\n primaryKey?: { name?: string; columns: string[] }\n /** The table's comment in the database (Postgres, MySQL). */\n comment?: string\n /** Row-level security is on (Postgres); `force` applies it to the table's owner too. */\n rls?: { force?: true }\n /** Row-level security policies (Postgres). */\n policies?: PolicySnapshot[]\n}\n\n/**\n * PostgreSQL ENUM type declaration. Currently PG-only; the field is\n * optional on `SchemaSnapshot` so other dialects don't have to carry\n * a phantom `enums: {}`.\n */\nexport interface EnumSnapshot {\n name: string\n /** Allowed values, in declaration order. PG preserves the order. */\n values: readonly string[]\n}\n\n/**\n * Resolved relation graph attached as a sidecar on the snapshot.\n * Lives on `SchemaSnapshot.relations` (optional). Keyed\n * sourceTable → relationName → resolved entry. Consumed by the\n * relational-query compiler in `packages/db/src/query/`. The\n * migration pipeline does not read this field — relations are\n * query-time sugar, not DDL.\n *\n * Shaped this way (rather than re-using the runtime `RelationsDecl`)\n * so the snapshot stays JSON-serializable: no function thunks, no\n * back-references to table objects.\n */\nexport interface RelationSnapshot {\n kind: 'one' | 'many'\n /** Target table name. */\n target: string\n /** Columns on the source table that participate in the join. */\n sourceColumns: readonly string[]\n /** Columns on the target table that participate in the join. */\n targetColumns: readonly string[]\n /**\n * Optional pairing tag from `relationName: 'foo'` on both sides of\n * the relation. Disambiguates multi-FK schemas.\n */\n relationName?: string\n /**\n * For a many-to-many: the junction table, and its columns that hold the\n * source's `sourceColumns` and the target's `targetColumns`.\n */\n through?: { table: string; sourceColumns: readonly string[]; targetColumns: readonly string[] }\n /**\n * For a `morphMany` / `morphOne`: the target's type column and the value it must hold\n * (bound as a parameter). There's no foreign key behind the join.\n */\n morph?: { column: string; value: string }\n /**\n * For a `morphTo`: the source's type column, and per type value the table\n * and key column the source's id column (`sourceColumns[0]`) points at.\n * `target` holds the first of those tables.\n */\n morphTo?: {\n column: string\n targets: ReadonlyArray<{ value: string; table: string; key: string }>\n }\n}\n\n/** A row-level security policy (Postgres). */\nexport interface PolicySnapshot {\n name: string\n as: 'permissive' | 'restrictive'\n command: 'all' | 'select' | 'insert' | 'update' | 'delete'\n /** Role names; `public` is everyone. */\n to: string[]\n using?: string\n withCheck?: string\n}\n\n/** A Postgres role the schema declares (created if missing, never dropped). */\nexport interface RoleSnapshot {\n name: string\n login?: boolean\n createDb?: boolean\n createRole?: boolean\n /** Default true: privileges of roles it's a member of apply to it. */\n inherit?: boolean\n bypassRls?: boolean\n}\n\nexport interface ViewSnapshot {\n name: string\n /** The `SELECT`, as declared (or as the database reports it, when introspected). */\n definition: string\n /** A materialized view (Postgres). */\n materialized?: true\n /** Indexes on a materialized view. */\n indexes?: IndexSnapshot[]\n /**\n * The columns, when introspected — for `kick db introspect` to render.\n * Not compared: the definition decides what a view returns.\n */\n columns?: Record<string, ColumnSnapshot>\n}\n\nexport interface SchemaSnapshot {\n version: 1\n dialect: Dialect\n /**\n * Keyed by QUALIFIED name — `billing.invoices` for a table declared through\n * `pgSchema('billing')`, the bare name otherwise. Qualifying the key is what\n * lets two schemas hold same-named tables without colliding, and it makes\n * every `table: string` field on a diff `Change` already schema-correct:\n * `quoteIdent` splits on `.`, rendering `\"billing\".\"invoices\"`.\n */\n tables: Record<string, TableSnapshot>\n /**\n * Named schemas the tables in this snapshot live in, sorted. Drives\n * `CREATE SCHEMA IF NOT EXISTS` emission. PG-only; absent when no table\n * declares a schema, so existing snapshots keep their exact shape.\n */\n schemas?: readonly string[]\n /** ENUM types declared via `pgEnum()`. PG-only; absent on other dialects. */\n enums?: Record<string, EnumSnapshot>\n /**\n * Views, in declaration order — the order they're created in, so a view can\n * select from one declared before it. Absent when there are none.\n */\n views?: Record<string, ViewSnapshot>\n /** Roles declared with `pgRole()` (Postgres). Absent when none. */\n roles?: Record<string, RoleSnapshot>\n /**\n * Optional relation sidecar populated when the schema includes\n * `relations()` declarations. Absent when no relations are\n * declared so M0/M1 callers see the same snapshot shape they\n * always did.\n */\n relations?: Record<string, Record<string, RelationSnapshot>>\n}\n","import { FK_ACTION_NAMES, type ColumnSnapshot, type FkAction } from '../../snapshot/types'\n\n/**\n * Runtime + type representation of a column reference (e.g. `users.id`).\n * Carries the parent table name, the column's own name, plus runtime\n * accessors used by FK thunks and constraint builders.\n *\n * Exported so adopters can annotate self-referencing thunks without\n * spelling the shape inline:\n *\n * parentId: uuid().references((): ColumnRef => categories.id)\n *\n * Without the annotation the initializer of a self-referencing const\n * trips TS7022 — TS needs to infer the const while the initializer\n * already references it.\n */\nexport interface ColumnRef {\n __tableName: string\n __name: string\n __builder: ColumnBuilder\n __state: () => ReturnType<ColumnBuilder['__state']>\n}\n\n/**\n * Resolved FK spec — `table` / `column` are pulled by invoking `thunk()`\n * lazily. The thunk pattern lets self-referencing tables work:\n *\n * const categories = table('categories', {\n * id: uuid().primaryKey().defaultRandom(),\n * parentId: uuid().references((): ColumnRef => categories.id),\n * })\n *\n * If we resolved at `.references()` call time, `categories` would TDZ-fail\n * inside its own initializer. Storing the thunk and resolving on read\n * (extract / render / emit) defers until after the const binding lands.\n */\n/**\n * A column ref that knows its column's value type — what lets a foreign key\n * be checked against the column it points at (`fk()`). Assignable to\n * `ColumnRef`, so every existing ref-taking API keeps working.\n */\nexport type TypedColumnRef<T> = ColumnRef & { readonly __valueType?: T }\n\n/** Typed refs for a column record — one per column. */\nexport type TypedColumnRefs<C> = {\n [K in keyof C]: TypedColumnRef<C[K] extends ColumnBuilder<infer T> ? T : never>\n}\n\nexport interface FkSpec {\n thunk: () => ColumnRef\n onDelete: FkAction\n onUpdate: FkAction\n /**\n * The constraint's name in the database.\n *\n * Omitted for schemas written by hand — the name is then derived as\n * `<table>_<column>_fk`. It is set when the schema was generated by\n * `kick db introspect`, because a database names its constraints itself:\n * Postgres' own default is `<table>_<column>_fkey`, and a DBA may have\n * chosen anything. Dropping the real name would make the next diff want to\n * rename every foreign key in the schema.\n */\n name?: string\n}\n\n/** Postgres array literal text: `{1,2}`, `{\"a\",\"b c\"}`. */\nfunction arrayLiteral(value: unknown[]): string {\n const item = (v: unknown): string =>\n v === null || v === undefined\n ? 'NULL'\n : Array.isArray(v)\n ? arrayLiteral(v)\n : typeof v === 'string' || v instanceof Date\n ? `\"${(typeof v === 'string' ? v : dateLiteral(v)).replace(/[\"\\\\]/g, '\\\\$&')}\"`\n : String(v)\n return `{${value.map(item).join(',')}}`\n}\n\n/** A Date's UTC time that Postgres, MySQL and SQLite all read: no `T`, no `Z`. */\nfunction dateLiteral(d: Date): string {\n return d.toISOString().replace('T', ' ').replace('Z', '+00:00')\n}\n\nexport interface ColumnState {\n type: string\n nullable: boolean\n default: string | null\n /** `default` is SQL to evaluate (`.defaultSql()`), not a value. */\n defaultSql?: boolean\n primaryKey: boolean\n unique: boolean\n references: FkSpec | null\n /**\n * A column kick/db maintains itself: `'updatedAt'` (set on every update),\n * `'version'` (incremented on every update), `'softDelete'` (rows with it\n * set are skipped by relational reads). Never part of the snapshot — it\n * changes queries, not the schema.\n */\n managed?: 'updatedAt' | 'version' | 'softDelete'\n generated?: { expression: string; stored: boolean }\n identity?: 'always' | 'byDefault'\n /**\n * How a bigint / numeric value is read back (`bigint({ mode })`,\n * `numeric(p, s, { mode })`). Unset, the driver's own value is returned.\n */\n mode?: 'bigint' | 'number' | 'string'\n /** `.comment()`: stored in the database on Postgres and MySQL. */\n comment?: string\n /** `.colName()`: the column's name in the database, when it isn't the key (or its `casing`). */\n colName?: string\n /** `tenantKey(tenancy)`: this is the table's tenant column. */\n tenancy?: { strategy: string; setting: string }\n /** `$defaultFn`: computed in JS for each inserted row that doesn't set it. */\n defaultFn?: () => unknown\n /** `$onUpdate`: computed in JS for each update that doesn't set it. */\n onUpdateFn?: () => unknown\n}\n\n/**\n * Type-only brand attached to a column when it's auto-assigned by the\n * database (serial / bigserial / smallserial), has a runtime default\n * (`.default(...)`), or carries an expression default\n * (`uuid().defaultRandom()`, `timestamp().defaultNow()`). `SchemaToTypes<S>`\n * reads this marker and wraps the column type in Kysely's `Generated<T>` so\n * adopters can omit the column on insert.\n *\n * Runtime is a no-op — the symbol never reaches a value.\n */\nexport const KICK_GENERATED = Symbol.for('@forinda/kickjs-db/Generated')\nexport type GeneratedBrand = { readonly [KICK_GENERATED]?: true }\n\n/**\n * Type-only brand for a column the database always computes — a generated\n * column, or an identity `GENERATED ALWAYS`. `SchemaToTypes<S>` wraps it in\n * Kysely's `GeneratedAlways<T>`, so it can't be inserted or updated.\n */\nexport const KICK_GENERATED_ALWAYS = Symbol.for('@forinda/kickjs-db/GeneratedAlways')\nexport type GeneratedAlwaysBrand = { readonly [KICK_GENERATED_ALWAYS]?: true }\n\n/**\n * Type-only brand attached to a column when `.notNull()` or `.primaryKey()`\n * is called. `SchemaToTypes<S>` reads this brand to decide whether the\n * column type is `T` (NOT NULL) or `T | null` (default nullable).\n *\n * Why a brand instead of a class generic: chained methods (notNull,\n * primaryKey) can return `this & NotNullBrand` to narrow nullability while\n * preserving the subclass identity — so `uuid().primaryKey().defaultRandom()`\n * still resolves `defaultRandom()` on `UuidBuilder`. A class generic\n * `<TNullable>` would collapse the subclass back to the parent.\n */\nexport const KICK_NOT_NULL = Symbol.for('@forinda/kickjs-db/NotNull')\nexport type NotNullBrand = { readonly [KICK_NOT_NULL]?: true }\n\n/**\n * Re-attach the nullability / generated brands after a transform that\n * must return a *new* builder type (e.g. `.array()` widening `T` to\n * `T[]`). Without this, `integer().notNull().array()` silently dropped\n * `NotNullBrand` and the row type regressed to `number[] | null`.\n *\n * Uses the same `extends` checks as `SchemaToTypes` (client/schema-types.ts)\n * so detection stays consistent in both directions.\n */\nexport type PreserveBrands<Self, Out> = Out &\n (Self extends NotNullBrand ? NotNullBrand : unknown) &\n (Self extends GeneratedBrand ? GeneratedBrand : unknown) &\n (Self extends GeneratedAlwaysBrand ? GeneratedAlwaysBrand : unknown)\n\n/**\n * Phantom-typed column builder. The `T` generic carries the column's TS\n * value type (number / string / Date / etc.); nullability is tracked via\n * the `NotNullBrand` intersection rather than a class generic so chain\n * methods preserve subclass identity.\n *\n * Both `T` and the brand are erased at runtime; they exist purely so\n * `SchemaToTypes<S>` can pull them out per column.\n */\nexport class ColumnBuilder<T = unknown> {\n // Phantom param shows up in the public surface so the type system sees\n // it. Reading it at runtime is intentionally not supported.\n declare readonly __t?: T\n\n protected state: ColumnState\n\n constructor(type: string, defaults: Partial<ColumnState> = {}) {\n this.state = {\n type,\n nullable: defaults.nullable ?? true,\n default: defaults.default ?? null,\n primaryKey: defaults.primaryKey ?? false,\n unique: defaults.unique ?? false,\n references: defaults.references ?? null,\n ...(defaults.mode ? { mode: defaults.mode } : {}),\n }\n }\n\n notNull(): this & NotNullBrand {\n this.state.nullable = false\n return this as this & NotNullBrand\n }\n\n primaryKey(): this & NotNullBrand {\n this.state.primaryKey = true\n this.state.nullable = false\n return this as this & NotNullBrand\n }\n\n unique(): this {\n this.state.unique = true\n return this\n }\n\n array(): PreserveBrands<this, ColumnBuilder<T[]>> {\n this.state.type = `${this.state.type}[]`\n return this as unknown as PreserveBrands<this, ColumnBuilder<T[]>>\n }\n\n references(\n target: () => ColumnRef,\n opts: { onDelete?: FkAction; onUpdate?: FkAction; name?: string } = {},\n ): this {\n // Checked here, where it's written: the schema is loaded without a type\n // check by `kick db generate`, and an unknown action reached the SQL as `undefined`.\n for (const key of ['onDelete', 'onUpdate'] as const) {\n const action = opts[key]\n if (action !== undefined && !(FK_ACTION_NAMES as readonly string[]).includes(action))\n throw new Error(\n `references(): ${key} '${action}' isn't an action — use ${FK_ACTION_NAMES.map(\n (a) => `'${a}'`,\n )\n .join(', ')\n .replace(/, ([^,]*)$/, ' or $1')}`,\n )\n }\n // Store the thunk — do NOT invoke it here. Self-referencing tables\n // pass `() => self.id` whose binding does not exist yet.\n this.state.references = {\n thunk: target,\n onDelete: opts.onDelete ?? 'no_action',\n onUpdate: opts.onUpdate ?? 'no_action',\n // Only carried when given: an absent name means \"derive it\", and\n // storing the derived value here would make it indistinguishable from\n // an explicit one that happens to match.\n ...(opts.name === undefined ? {} : { name: opts.name }),\n }\n return this\n }\n\n /**\n * Mark the column as having a runtime / DB-assigned default. The\n * `GeneratedBrand` flows into `SchemaToTypes<S>` so the column wraps\n * in `Generated<T>` — adopters can `INSERT` without specifying it.\n *\n * Accepts the natural literal for the column type — `boolean().default(false)`,\n * `integer().default(0)`, `varchar().default('active')`. Non-string\n * literals are normalised to their SQL-literal text so the snapshot\n * (`ColumnSnapshot.default: string | null`) and migration emitter stay\n * string-only. For a quoted string default the text is the value\n * itself (`'active'`); booleans/numbers emit bare (`false`, `0`). A JSON\n * column takes its value (`jsonb().default({})` stores `{}`), an array\n * column its array literal (`integer().array().default([1, 2])` stores\n * `{1,2}`), and a `Date` its UTC time (`2026-01-02 03:04:05.000+00:00`).\n */\n default(value: string | number | boolean | T): this & GeneratedBrand {\n this.state.default =\n typeof value === 'string'\n ? value\n : Array.isArray(value) && this.state.type.endsWith('[]')\n ? arrayLiteral(value)\n : value instanceof Date\n ? dateLiteral(value)\n : typeof value === 'object' && value !== null\n ? JSON.stringify(value)\n : String(value)\n this.state.defaultSql = false\n return this as this & GeneratedBrand\n }\n\n /**\n * A default that is SQL, evaluated by the database for each new row —\n * `id: text().primaryKey().defaultSql('gen_random_uuid()::text')`,\n * `slug: text().defaultSql(\"lower(hex(randomblob(8)))\")`. `.default()` is a\n * value: on a text column `.default('now()')` stores the string `now()`.\n * Written as given, so it's your dialect's SQL.\n */\n defaultSql(expression: string): this & GeneratedBrand {\n this.state.default = expression\n this.state.defaultSql = true\n return this as this & GeneratedBrand\n }\n\n /**\n * A default computed in JS for each inserted row that doesn't set this\n * column — an id generator, a slug, a value from config:\n * `id: text().primaryKey().$defaultFn(() => ulid())`. Not part of the\n * schema: the database has no default, so raw SQL inserts must set it.\n */\n $defaultFn(fn: () => T): this & GeneratedBrand {\n this.state.defaultFn = fn\n return this as this & GeneratedBrand\n }\n\n /**\n * A value computed in JS for each update (and an upsert's update branch)\n * that doesn't set this column: `revisedBy: text().$onUpdate(() => currentUser())`.\n * Like `onUpdateNow()`, with your own value. Inserts don't call it.\n */\n $onUpdate(fn: () => T): this {\n this.state.onUpdateFn = fn\n return this\n }\n\n /**\n * Set this column to the current time on every update that doesn't set it\n * itself — `updatedAt: timestamp().notNull().defaultNow().onUpdateNow()`.\n */\n onUpdateNow(): this {\n this.state.managed = 'updatedAt'\n return this\n }\n\n /**\n * Mark this column — a nullable timestamp — as the soft-delete marker:\n * relational reads (`db.query`) skip rows where it's set, at every level,\n * unless asked `withDeleted: true`. Soft-delete by setting it.\n */\n softDelete(): this {\n this.state.managed = 'softDelete'\n return this\n }\n\n /**\n * Computed by the database from other columns, on every write:\n * `total: numeric(12, 2).generatedAlwaysAs('price * quantity')`. The SQL is\n * passed through as written. Stored by default; `{ stored: false }` makes\n * it virtual, computed on read (MySQL, SQLite, Postgres 18+). It can't be\n * inserted or updated.\n */\n generatedAlwaysAs(\n expression: string,\n options: { stored?: boolean } = {},\n ): this & GeneratedAlwaysBrand {\n this.state.generated = { expression, stored: options.stored ?? true }\n return this as this & GeneratedAlwaysBrand\n }\n\n /**\n * An identity column the database numbers and won't let you set (Postgres)\n * — the SQL-standard successor to `serial`.\n */\n generatedAlwaysAsIdentity(): this & NotNullBrand & GeneratedAlwaysBrand {\n this.state.identity = 'always'\n this.state.nullable = false\n return this as this & NotNullBrand & GeneratedAlwaysBrand\n }\n\n /** An identity column the database numbers unless a value is given (Postgres). */\n generatedByDefaultAsIdentity(): this & NotNullBrand & GeneratedBrand {\n this.state.identity = 'byDefault'\n this.state.nullable = false\n return this as this & NotNullBrand & GeneratedBrand\n }\n\n /**\n * A comment stored with the column in the database, for whoever reads the\n * schema there (Postgres, MySQL; SQLite has none). Changing it migrates.\n */\n comment(text: string): this {\n this.state.comment = text\n return this\n }\n\n /**\n * The column's name in the database, when it isn't the key — a legacy\n * `EMAIL_ADDR` behind an `email` key. Taken as written: `casing` doesn't\n * change it. Queries, `db.query` and migrations use it; your code keeps the key.\n */\n colName(name: string): this {\n this.state.colName = name\n return this\n }\n\n /** The role kick/db maintains this column in, if any. */\n managedAs(): ColumnState['managed'] {\n return this.state.managed\n }\n\n toJSON(name: string): ColumnSnapshot {\n return {\n name,\n type: this.state.type,\n nullable: this.state.nullable,\n default: this.state.default,\n ...(this.state.defaultSql ? { defaultSql: true as const } : {}),\n primaryKey: this.state.primaryKey,\n // Only when set, so other columns serialize as they always have.\n ...(this.state.generated ? { generated: { ...this.state.generated } } : {}),\n ...(this.state.identity ? { identity: this.state.identity } : {}),\n ...(this.state.comment !== undefined ? { comment: this.state.comment } : {}),\n }\n }\n\n // Internal accessor for table()/diff to read full state including unique/references.\n __state(): Readonly<ColumnState> {\n return this.state\n }\n}\n","// customType<T>() — adopter-defined column type with optional driver\n// codecs. Lets a project introduce a typed column that doesn't ship\n// in the built-in DSL (encrypted strings, custom JSON shapes, citext,\n// PostGIS geometry, etc.) without forking the package.\n//\n// Schema usage:\n//\n// const encrypted = customType<EncryptedString>({\n// dataType: () => 'text',\n// toDriver: (s) => encrypt(s),\n// fromDriver: (raw) => decrypt(String(raw)),\n// })\n//\n// export const secrets = table('secrets', {\n// id: serial().primaryKey(),\n// value: encrypted().notNull(),\n// })\n//\n// `SchemaToTypes<typeof schema>` reads the phantom T from the\n// CustomColumnBuilder so `db.selectFrom('secrets').select('value')`\n// types `value: EncryptedString` (not `string`). Driver codecs flow\n// through the lifecycle plugin landing in M2.F-T19; until then they\n// are stored on the builder for the runtime hookup to pick up.\n\nimport { ColumnBuilder } from './dsl/columns/types'\n\nexport interface CustomTypeOptions<TJs, TDriver = unknown> {\n /**\n * SQL data type as it would appear in `CREATE TABLE` — `'text'`,\n * `'jsonb'`, `'citext'`, `'geometry(Point, 4326)'`, etc. Returned\n * via a thunk so adopters can compute the type from runtime config\n * (e.g. dialect-specific overrides).\n */\n dataType: () => string\n /** Optional encode hook applied at insert / update time. */\n toDriver?: (value: TJs) => TDriver\n /** Optional decode hook applied to selected rows. */\n fromDriver?: (driver: TDriver) => TJs\n}\n\n/**\n * ColumnBuilder subclass produced by `customType()`. Carries the\n * driver codecs so the (future) hooks pipeline can wire them through\n * a Kysely plugin without each consumer re-declaring its mapping.\n *\n * The phantom `T` flows through `SchemaToTypes<S>` exactly like any\n * other ColumnBuilder<T>, so adopters get full row-shape inference\n * for free.\n */\nexport class CustomColumnBuilder<TJs> extends ColumnBuilder<TJs> {\n /** Encode hook — run on values heading into the database. */\n readonly toDriver?: (value: TJs) => unknown\n /** Decode hook — run on row values coming out of the database. */\n readonly fromDriver?: (driver: unknown) => TJs\n\n constructor(opts: CustomTypeOptions<TJs>) {\n super(opts.dataType())\n this.toDriver = opts.toDriver as never\n this.fromDriver = opts.fromDriver as never\n }\n}\n\n/**\n * Build a reusable column factory for a custom type. The returned\n * function is what callers use inside `table('foo', { col: factory() })`\n * — same shape as the built-in `varchar()`, `text()`, etc.\n *\n * @example\n * ```ts\n * const ulid = customType<string>({\n * dataType: () => 'char(26)',\n * toDriver: (s) => s,\n * fromDriver: (raw) => String(raw),\n * })\n *\n * const events = table('events', {\n * id: ulid().primaryKey(),\n * ts: timestamp().notNull().defaultNow(),\n * })\n * ```\n */\nexport function customType<TJs>(opts: CustomTypeOptions<TJs>): () => CustomColumnBuilder<TJs> {\n return () => new CustomColumnBuilder<TJs>(opts)\n}\n"],"mappings":";;;;;;;;;;AAGA,MAAa,gBAAkB,CAC7B,UACA,WACA,WACA,cACA,WACF,ECyDA,SAAS,aAAa,MAA0B,CAS9C,MAAO,IAAI,MAAM,IARH,GACZ,GAAM,KACF,OACA,MAAM,QAAQ,CAAC,EACb,aAAa,CAAC,EACd,OAAO,GAAM,UAAY,aAAa,KACpC,KAAK,OAAO,GAAM,SAAW,EAAI,YAAY,CAAC,EAAA,CAAG,QAAQ,SAAU,MAAM,EAAE,GAC3E,OAAO,CAAC,CACO,CAAC,CAAC,KAAK,GAAG,EAAE,EACvC,CAGA,SAAS,YAAY,EAAiB,CACpC,OAAO,EAAE,YAAY,CAAC,CAAC,QAAQ,IAAK,GAAG,CAAC,CAAC,QAAQ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E,GAAI,KAAK,MAAM,SAAW,CAAE,SAAU,KAAK,MAAM,QAAS,EAAI,CAAC,EAC/D,GAAI,KAAK,MAAM,UAAY,IAAA,GAA8C,CAAC,EAAnC,CAAE,QAAS,KAAK,MAAM,OAAQ,CACvE,CACF,CAGA,SAAiC,CAC/B,OAAO,KAAK,KACd,CACF,ECpWa,oBAAb,cAA8C,aAAmB,CAE/D,SAEA,WAEA,YAAY,KAA8B,CACxC,MAAM,KAAK,SAAS,CAAC,EACrB,KAAK,SAAW,KAAK,SACrB,KAAK,WAAa,KAAK,UACzB,CACF,EAqBA,SAAgB,WAAgB,KAA8D,CAC5F,UAAa,IAAI,oBAAyB,IAAI,CAChD"}
|
package/dist/pg-DCCDrhAN.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pg-DCCDrhAN.mjs","names":[],"sources":["../src/dsl/columns/pg.ts"],"sourcesContent":["import { CustomColumnBuilder } from '../../custom-type'\nimport { ColumnBuilder } from './types'\n\n// PG-only column types. Phantom T per builder so SchemaToTypes<S> can narrow\n// each column to a useful TS shape — strings for the text-y types, number[]\n// for vector embeddings, etc.\n\n/**\n * Declare a PostgreSQL ENUM type.\n *\n * @example\n * ```ts\n * export const taskStatus = pgEnum('task_status', 'todo', 'in_progress', 'done')\n *\n * export const tasks = table('tasks', {\n * id: uuid().primaryKey().defaultRandom(),\n * status: taskStatus().notNull().default('todo'),\n * })\n * ```\n *\n * The factory returns a column builder whose phantom type narrows to\n * the union of the declared values — `db.selectFrom('tasks').select('status')`\n * types `status: 'todo' | 'in_progress' | 'done'`.\n *\n * Schema-level state (the enum name + values) is attached to every\n * column the factory produces so introspection / drift / emit can pick\n * it up: `kick db generate` emits the `CREATE TYPE <name> AS ENUM (...)`\n * before the first table that uses it, and later value changes as\n * migrations.\n */\nexport interface PgEnumBuilder<TName extends string, TValues extends readonly string[]> {\n (): PgEnumColumnBuilder<TName, TValues>\n /** The SQL identifier — used by emit + drift detection. */\n readonly enumName: TName\n /** Allowed literal values, in declaration order. */\n readonly values: TValues\n}\n\nexport class PgEnumColumnBuilder<\n TName extends string,\n TValues extends readonly string[],\n> extends ColumnBuilder<TValues[number]> {\n /** The enum's SQL identifier — preserved for emit + drift detection. */\n readonly enumName: TName\n /** Allowed values — readonly to prevent mutation across columns. */\n readonly values: TValues\n\n constructor(enumName: TName, values: TValues) {\n // The SQL data type IS the enum identifier — `status task_status`,\n // not `status text` — so PG enforces the membership constraint.\n super(enumName)\n this.enumName = enumName\n this.values = values\n }\n}\n\n// Variadic rest forces TS to infer EACH value as its literal type, so\n// `pgEnum('s', 'todo', 'done')` resolves to\n// `PgEnumBuilder<'s', ['todo', 'done']>`. Without rest, an array\n// literal stored in a variable would widen to `string[]` and the\n// column phantom would collapse to plain `string`, defeating the\n// entire point of the helper. Adopters with a pre-existing array\n// can still spread it: `pgEnum('s', ...VALUES as const)`.\nexport function pgEnum<TName extends string, const TValues extends readonly [string, ...string[]]>(\n name: TName,\n ...values: TValues\n): PgEnumBuilder<TName, TValues> {\n const factory = (): PgEnumColumnBuilder<TName, TValues> =>\n new PgEnumColumnBuilder<TName, TValues>(name, values)\n // Attach metadata to the factory itself so introspection that walks\n // `Object.values(schema)` can discover enum declarations even when\n // they're declared standalone (without a column reference).\n return Object.assign(factory, { enumName: name, values }) as PgEnumBuilder<TName, TValues>\n}\n\nexport function tsvector(): ColumnBuilder<string> {\n return new ColumnBuilder<string>('tsvector')\n}\n\n/**\n * A built-in column whose values the driver doesn't convert, with the codecs\n * that do. Validators still know its type (a custom type reads as \"any\").\n * Codecs are shared module-level functions: they're keyed by column name, and\n * one instance per type keeps same-named columns in different tables quiet.\n */\nexport class PgCodecColumnBuilder<T> extends CustomColumnBuilder<T> {}\n\n/** pgvector's text form is `[1,2,3]`: valid JSON both ways. */\nconst vectorToDriver = (v: number[]) => `[${v.join(',')}]`\nconst vectorFromDriver = (raw: unknown): number[] =>\n typeof raw === 'string' ? (JSON.parse(raw) as number[]) : (raw as number[])\n\nfunction vectorColumn(base: string, dim?: number): PgCodecColumnBuilder<number[]> {\n return new PgCodecColumnBuilder<number[]>({\n dataType: () => (dim === undefined ? base : `${base}(${dim})`),\n toDriver: vectorToDriver,\n fromDriver: vectorFromDriver,\n })\n}\n\n/** A pgvector embedding (`vector(n)`), as `number[]`. Needs the `vector` extension. */\nexport function vector(dim?: number): PgCodecColumnBuilder<number[]> {\n return vectorColumn('vector', dim)\n}\n\n/** A half-precision pgvector embedding (`halfvec(n)`, pgvector 0.7+), as `number[]`. */\nexport function halfvec(dim?: number): PgCodecColumnBuilder<number[]> {\n return vectorColumn('halfvec', dim)\n}\n\n/** A point on a plane. */\nexport interface PgPoint {\n x: number\n y: number\n}\n\nconst pointToDriver = (p: PgPoint) => `(${p.x},${p.y})`\nconst pointFromDriver = (raw: unknown): PgPoint => {\n if (typeof raw !== 'string') return raw as PgPoint // `pg` already parses it\n const [x, y] = raw\n .replace(/[()\\s]/g, '')\n .split(',')\n .map(Number)\n return { x: x!, y: y! }\n}\n\n/** Postgres' geometric `point`, as `{ x, y }`. */\nexport function point(): PgCodecColumnBuilder<PgPoint> {\n return new PgCodecColumnBuilder<PgPoint>({\n dataType: () => 'point',\n toDriver: pointToDriver,\n fromDriver: pointFromDriver,\n })\n}\n\n/**\n * A PostGIS geometry: `geometry('Point', 4326)` → `geometry(Point, 4326)`.\n * The value is what PostGIS returns (hex EWKB) and takes text in (WKT or\n * EWKT, `'SRID=4326;POINT(36.8 -1.28)'`); convert with `ST_AsGeoJSON` /\n * `ST_GeomFromGeoJSON` in SQL. Needs the `postgis` extension.\n */\nexport function geometry(type?: string, srid?: number): ColumnBuilder<string> {\n const args = [type, srid].filter((a) => a !== undefined)\n return new ColumnBuilder<string>(args.length ? `geometry(${args.join(', ')})` : 'geometry')\n}\n\n/** A MAC address (`08:00:2b:01:02:03`). */\nexport function macaddr(): ColumnBuilder<string> {\n return new ColumnBuilder<string>('macaddr')\n}\n\n/** An EUI-64 MAC address. */\nexport function macaddr8(): ColumnBuilder<string> {\n return new ColumnBuilder<string>('macaddr8')\n}\n\nexport function citext(): ColumnBuilder<string> {\n return new ColumnBuilder<string>('citext')\n}\n\nexport function money(): ColumnBuilder<string> {\n return new ColumnBuilder<string>('money')\n}\n\nexport function inet(): ColumnBuilder<string> {\n return new ColumnBuilder<string>('inet')\n}\n\nexport function cidr(): ColumnBuilder<string> {\n return new ColumnBuilder<string>('cidr')\n}\n\nexport function xml(): ColumnBuilder<string> {\n return new ColumnBuilder<string>('xml')\n}\n"],"mappings":";;;;;;;;;;oFAsCA,IAAa,oBAAb,cAGU,aAA+B,CAEvC,SAEA,OAEA,YAAY,SAAiB,OAAiB,CAG5C,MAAM,QAAQ,EACd,KAAK,SAAW,SAChB,KAAK,OAAS,MAChB,CACF,EASA,SAAgB,OACd,KACA,GAAG,OAC4B,CAM/B,OAAO,OAAO,WAJZ,IAAI,oBAAoC,KAAM,MAAM,EAIxB,CAAE,SAAU,KAAM,MAAO,CAAC,CAC1D,CAEA,SAAgB,UAAkC,CAChD,OAAO,IAAI,cAAsB,UAAU,CAC7C,CAQA,IAAa,qBAAb,cAA6C,mBAAuB,CAAC,EAGrE,MAAM,eAAkB,GAAgB,IAAI,EAAE,KAAK,GAAG,EAAE,GAClD,iBAAoB,KACxB,OAAO,KAAQ,SAAY,KAAK,MAAM,GAAG,EAAkB,IAE7D,SAAS,aAAa,KAAc,IAA8C,CAChF,OAAO,IAAI,qBAA+B,CACxC,aAAiB,MAAQ,IAAA,GAAY,KAAO,GAAG,KAAK,GAAG,IAAI,GAC3D,SAAU,eACV,WAAY,gBACd,CAAC,CACH,CAGA,SAAgB,OAAO,IAA8C,CACnE,OAAO,aAAa,SAAU,GAAG,CACnC,CAGA,SAAgB,QAAQ,IAA8C,CACpE,OAAO,aAAa,UAAW,GAAG,CACpC,CAQA,MAAM,cAAiB,GAAe,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,GAC/C,gBAAmB,KAA0B,CACjD,GAAI,OAA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