@prisma/orm-sqlite 8.0.0-rc.23-dev.2 → 8.0.0-rc.23-dev.4

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/config.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { PrismaNextConfig } from "@prisma/orm-framework/config/config-types";
1
+ import { FormatterConfig, PrismaNextConfig } from "@prisma/orm-framework/config/config-types";
2
2
  import { ControlExtensionDescriptor } from "@prisma/orm-framework/components/control";
3
3
  //#region ../../../3-targets/sqlite/9-facade/dist/config.d.mts
4
4
  //#region src/config/define-config.d.ts
@@ -12,6 +12,7 @@ interface SqliteConfigOptions {
12
12
  readonly migrations?: {
13
13
  readonly dir?: string;
14
14
  };
15
+ readonly formatter?: FormatterConfig;
15
16
  }
16
17
  declare function defineConfig(options: SqliteConfigOptions): PrismaNextConfig<'sql', 'sqlite'>;
17
18
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.mts","names":[],"sources":["../../../../3-targets/sqlite/9-facade/dist/config.d.mts"],"mappings":";;;;UAGU;WACC;WACA;WACA;aACE;;WAEF,sBAAsB;WACtB;aACE;;;iBAGI,aAAa,SAAS,sBAAsB"}
1
+ {"version":3,"file":"config.d.mts","names":[],"sources":["../../../../3-targets/sqlite/9-facade/dist/config.d.mts"],"mappings":";;;;UAGU;WACC;WACA;WACA;aACE;;WAEF,sBAAsB;WACtB;aACE;;WAEF,YAAY;;iBAEN,aAAa,SAAS,sBAAsB"}
package/dist/config.mjs CHANGED
@@ -30,7 +30,8 @@ function defineConfig(options) {
30
30
  }
31
31
  }),
32
32
  ...ifDefined("db", options.db),
33
- ...ifDefined("migrations", options.migrations)
33
+ ...ifDefined("migrations", options.migrations),
34
+ ...ifDefined("formatter", options.formatter)
34
35
  });
35
36
  }
36
37
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","names":[],"sources":["../../../../3-targets/sqlite/9-facade/dist/config.mjs"],"sourcesContent":["import sqliteAdapter from \"@internal/adapter-sqlite/control\";\nimport { defaultContractOutputPath, defineConfig as defineConfig$1 } from \"@internal/config/config-types\";\nimport sqliteDriver from \"@internal/driver-sqlite/control\";\nimport sql from \"@internal/family-sql/control\";\nimport { prismaContract } from \"@internal/sql-contract-psl/provider\";\nimport { typescriptContractFromPath } from \"@internal/sql-contract-ts/config-types\";\nimport { SQLITE_INTEGER_CODEC_ID, SQLITE_TEXT_CODEC_ID } from \"@internal/target-sqlite/codec-ids\";\nimport sqlite from \"@internal/target-sqlite/control\";\nimport sqlitePackRef from \"@internal/target-sqlite/pack\";\nimport { sqliteCreateNamespace } from \"@internal/target-sqlite/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { extname, join } from \"pathe\";\n//#region src/config/define-config.ts\nfunction defineConfig(options) {\n\tconst extensions = options.extensions ?? [];\n\tconst output = options.output !== void 0 ? join(options.output, \"contract.json\") : defaultContractOutputPath(options.contract);\n\treturn defineConfig$1({\n\t\tfamily: sql,\n\t\ttarget: sqlite,\n\t\tadapter: sqliteAdapter,\n\t\tdriver: sqliteDriver,\n\t\textensions,\n\t\tcontract: extname(options.contract) === \".ts\" ? typescriptContractFromPath(options.contract, output) : prismaContract(options.contract, {\n\t\t\toutput,\n\t\t\ttarget: sqlitePackRef,\n\t\t\tcreateNamespace: sqliteCreateNamespace,\n\t\t\tenumInferenceCodecs: {\n\t\t\t\ttext: SQLITE_TEXT_CODEC_ID,\n\t\t\t\tint: SQLITE_INTEGER_CODEC_ID\n\t\t\t}\n\t\t}),\n\t\t...ifDefined(\"db\", options.db),\n\t\t...ifDefined(\"migrations\", options.migrations)\n\t});\n}\n//#endregion\nexport { defineConfig };\n\n//# sourceMappingURL=config.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,aAAa,SAAS;CAC9B,MAAM,aAAa,QAAQ,cAAc,CAAC;CAC1C,MAAM,SAAS,QAAQ,WAAW,KAAK,IAAI,KAAK,QAAQ,QAAQ,eAAe,IAAI,0BAA0B,QAAQ,QAAQ;CAC7H,OAAO,eAAe;EACrB,QAAQ;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR;EACA,UAAU,QAAQ,QAAQ,QAAQ,MAAM,QAAQ,2BAA2B,QAAQ,UAAU,MAAM,IAAI,eAAe,QAAQ,UAAU;GACvI;GACA,QAAQ;GACR,iBAAiB;GACjB,qBAAqB;IACpB,MAAM;IACN,KAAK;GACN;EACD,CAAC;EACD,GAAG,UAAU,MAAM,QAAQ,EAAE;EAC7B,GAAG,UAAU,cAAc,QAAQ,UAAU;CAC9C,CAAC;AACF"}
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../../../../3-targets/sqlite/9-facade/dist/config.mjs"],"sourcesContent":["import sqliteAdapter from \"@internal/adapter-sqlite/control\";\nimport { defaultContractOutputPath, defineConfig as defineConfig$1 } from \"@internal/config/config-types\";\nimport sqliteDriver from \"@internal/driver-sqlite/control\";\nimport sql from \"@internal/family-sql/control\";\nimport { prismaContract } from \"@internal/sql-contract-psl/provider\";\nimport { typescriptContractFromPath } from \"@internal/sql-contract-ts/config-types\";\nimport { SQLITE_INTEGER_CODEC_ID, SQLITE_TEXT_CODEC_ID } from \"@internal/target-sqlite/codec-ids\";\nimport sqlite from \"@internal/target-sqlite/control\";\nimport sqlitePackRef from \"@internal/target-sqlite/pack\";\nimport { sqliteCreateNamespace } from \"@internal/target-sqlite/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { extname, join } from \"pathe\";\n//#region src/config/define-config.ts\nfunction defineConfig(options) {\n\tconst extensions = options.extensions ?? [];\n\tconst output = options.output !== void 0 ? join(options.output, \"contract.json\") : defaultContractOutputPath(options.contract);\n\treturn defineConfig$1({\n\t\tfamily: sql,\n\t\ttarget: sqlite,\n\t\tadapter: sqliteAdapter,\n\t\tdriver: sqliteDriver,\n\t\textensions,\n\t\tcontract: extname(options.contract) === \".ts\" ? typescriptContractFromPath(options.contract, output) : prismaContract(options.contract, {\n\t\t\toutput,\n\t\t\ttarget: sqlitePackRef,\n\t\t\tcreateNamespace: sqliteCreateNamespace,\n\t\t\tenumInferenceCodecs: {\n\t\t\t\ttext: SQLITE_TEXT_CODEC_ID,\n\t\t\t\tint: SQLITE_INTEGER_CODEC_ID\n\t\t\t}\n\t\t}),\n\t\t...ifDefined(\"db\", options.db),\n\t\t...ifDefined(\"migrations\", options.migrations),\n\t\t...ifDefined(\"formatter\", options.formatter)\n\t});\n}\n//#endregion\nexport { defineConfig };\n\n//# sourceMappingURL=config.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,aAAa,SAAS;CAC9B,MAAM,aAAa,QAAQ,cAAc,CAAC;CAC1C,MAAM,SAAS,QAAQ,WAAW,KAAK,IAAI,KAAK,QAAQ,QAAQ,eAAe,IAAI,0BAA0B,QAAQ,QAAQ;CAC7H,OAAO,eAAe;EACrB,QAAQ;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR;EACA,UAAU,QAAQ,QAAQ,QAAQ,MAAM,QAAQ,2BAA2B,QAAQ,UAAU,MAAM,IAAI,eAAe,QAAQ,UAAU;GACvI;GACA,QAAQ;GACR,iBAAiB;GACjB,qBAAqB;IACpB,MAAM;IACN,KAAK;GACN;EACD,CAAC;EACD,GAAG,UAAU,MAAM,QAAQ,EAAE;EAC7B,GAAG,UAAU,cAAc,QAAQ,UAAU;EAC7C,GAAG,UAAU,aAAa,QAAQ,SAAS;CAC5C,CAAC;AACF"}
package/dist/runtime.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as validateSqliteContract, t as buildSqliteStaticContext } from "./sqlite-static-DtKey_1v-BypVwxr_.mjs";
1
+ import { i as validateSqliteContract, t as buildSqliteStaticContext } from "./sqlite-static-C5wVr3oB-R_YI-5vb.mjs";
2
2
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
3
3
  import sqliteAdapter from "@prisma/orm-target-sqlite/adapter/runtime";
4
4
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-targets/sqlite/9-facade/dist/runtime.mjs"],"sourcesContent":["import { i as validateSqliteContract, t as buildSqliteStaticContext } from \"./sqlite-static-DtKey_1v.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport sqliteAdapter from \"@internal/adapter-sqlite/runtime\";\nimport sqliteDriver from \"@internal/driver-sqlite/runtime\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { createRawLane, sql } from \"@internal/sql-builder/runtime\";\nimport { orm, prepareQuery } from \"@internal/sql-orm-client\";\nimport { SqlRuntimeBase, activitySource, createExecutionContext, createSqlExecutionStack, delegatingActivitySource, delegatingRuntime, toRuntimeOptions, withTransaction, withTransactionMembers } from \"@internal/sql-runtime\";\nimport sqliteTarget from \"@internal/target-sqlite/runtime\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/errors.ts\nfunction sqliteError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/runtime/binding.ts\nfunction resolveSqliteBinding(input) {\n\treturn {\n\t\tkind: \"path\",\n\t\tpath: input.path\n\t};\n}\nfunction resolveOptionalSqliteBinding(options) {\n\tif (options.path === void 0) return;\n\treturn {\n\t\tkind: \"path\",\n\t\tpath: options.path\n\t};\n}\n//#endregion\n//#region src/runtime/sqlite-runtime.ts\nvar SqliteRuntimeImpl = class extends SqlRuntimeBase {};\n//#endregion\n//#region src/runtime/sqlite.ts\nfunction sqliteOrm(orm) {\n\tconst namespace = orm[UNBOUND_NAMESPACE_ID];\n\tassertDefined(namespace, \"the unbound namespace always exists on a sqlite builder output\");\n\treturn blindCast(Reflect.get(namespace, \"fragment\") === void 0 ? Object.create(namespace, { fragment: { value: Reflect.get(orm, \"fragment\") } }) : namespace);\n}\n/**\n* Builds the members of a SQLite transaction over `txCtx`, so every statement they run goes through the transaction. Preparing sends nothing to the database, so `prepare` uses `prepareRuntime`; the prepared statement runs on the queryable it is given.\n*/\nfunction buildSqliteTransactionMembers(options, txCtx) {\n\tconst { context, collections, rawCodecInferer, enums, toSql, prepareRuntime } = options;\n\tconst sqlNamespace = sql({\n\t\tcontext,\n\t\trawCodecInferer\n\t})[UNBOUND_NAMESPACE_ID];\n\tassertDefined(sqlNamespace, \"the unbound namespace always exists on a sqlite builder output\");\n\treturn {\n\t\tsql: blindCast(sqlNamespace),\n\t\torm: sqliteOrm(orm({\n\t\t\truntime: {\n\t\t\t\tquery(plan) {\n\t\t\t\t\treturn txCtx.query(plan);\n\t\t\t\t},\n\t\t\t\texecute(plan) {\n\t\t\t\t\treturn txCtx.execute(plan);\n\t\t\t\t},\n\t\t\t\t[activitySource]: delegatingActivitySource(() => txCtx)\n\t\t\t},\n\t\t\tcontext,\n\t\t\t...ifDefined(\"collections\", collections)\n\t\t})),\n\t\traw: createRawLane({\n\t\t\tcontext,\n\t\t\trawCodecInferer\n\t\t}),\n\t\tenums,\n\t\ttoSql,\n\t\tprepare(declaration, callback) {\n\t\t\treturn prepareQuery(prepareRuntime, declaration, callback);\n\t\t}\n\t};\n}\n/**\n* Creates a lazy SQLite client. The client infers its contract type from `contract`: a value from\n* `contractFromJson` for an emitted contract, or a TypeScript-authored contract. A contract is\n* validated once, however many clients are built from it. The database opens on the first query\n* or `connect()`.\n*\n* @example\n* ```ts\n* import { contractFromJson } from '@prisma/orm-sqlite/static';\n* import sqlite from '@prisma/orm-sqlite/runtime';\n* import type { Contract } from './contract.d';\n* import contractJson from './contract.json' with { type: 'json' };\n*\n* export const contract = contractFromJson<Contract>(contractJson);\n* export const db = sqlite({ contract, path: './dev.db' });\n* ```\n*/\nfunction sqlite(options) {\n\tconst contract = validateSqliteContract(options.contract);\n\tlet binding = resolveOptionalSqliteBinding(options);\n\tconst stack = createSqlExecutionStack({\n\t\ttarget: sqliteTarget,\n\t\tadapter: sqliteAdapter,\n\t\tdriver: sqliteDriver,\n\t\textensions: options.extensions ?? []\n\t});\n\tconst context = createExecutionContext({\n\t\tcontract,\n\t\tstack,\n\t\tdriver: sqliteDriver\n\t});\n\tconst { sql, raw: rawSqlTag, enums, toSql } = buildSqliteStaticContext(contract, context, stack);\n\tlet runtimeInstance;\n\tlet runtimeDriver;\n\tlet driverConnected = false;\n\tlet connectPromise;\n\tlet closePromise;\n\tlet backgroundConnectError;\n\tlet closed = false;\n\tlet ownedDispose;\n\tconst closedError = () => sqliteError(\"DRIVER.NOT_CONNECTED\", \"SQLite client is closed\", { meta: { extension: \"sqlite\" } });\n\tconst connectDriver = async (resolvedBinding) => {\n\t\tif (driverConnected) return;\n\t\tif (!runtimeDriver) throw new InternalError(\"SQLite runtime driver missing\");\n\t\tif (connectPromise) return connectPromise;\n\t\tconnectPromise = runtimeDriver.connect(resolvedBinding).then(() => {\n\t\t\tdriverConnected = true;\n\t\t}).catch((err) => {\n\t\t\tbackgroundConnectError = err;\n\t\t\tconnectPromise = void 0;\n\t\t\tthrow err;\n\t\t});\n\t\treturn connectPromise;\n\t};\n\tconst getRuntime = () => {\n\t\tif (closed) throw closedError();\n\t\tif (backgroundConnectError !== void 0) throw backgroundConnectError;\n\t\tif (runtimeInstance) return runtimeInstance;\n\t\tconst adapter = stack.adapter.create(stack);\n\t\tconst driver = stack.driver.create();\n\t\townedDispose = () => driver.close();\n\t\truntimeDriver = driver;\n\t\tif (binding !== void 0) connectDriver(binding).catch(() => void 0);\n\t\truntimeInstance = new SqliteRuntimeImpl({\n\t\t\tcontext,\n\t\t\tadapter,\n\t\t\tdriver,\n\t\t\t...toRuntimeOptions(options),\n\t\t\tcloseRefusal: \"at-once\"\n\t\t});\n\t\treturn runtimeInstance;\n\t};\n\tconst workRuntime = delegatingRuntime(getRuntime);\n\tconst orm$1 = sqliteOrm(orm({\n\t\tcontext,\n\t\t...ifDefined(\"collections\", options.collections),\n\t\truntime: workRuntime\n\t}));\n\tfunction prepare(declaration, callback) {\n\t\treturn prepareQuery(workRuntime, declaration, callback);\n\t}\n\treturn {\n\t\tsql,\n\t\torm: orm$1,\n\t\tenums,\n\t\traw: rawSqlTag,\n\t\ttoSql,\n\t\tcontext,\n\t\tcontract,\n\t\tstack,\n\t\tquery(plan, execOptions) {\n\t\t\treturn workRuntime.query(plan, execOptions);\n\t\t},\n\t\texecute(plan, execOptions) {\n\t\t\treturn workRuntime.execute(plan, execOptions);\n\t\t},\n\t\tasync connect(bindingInput) {\n\t\t\tif (closed) throw closedError();\n\t\t\tif (driverConnected || connectPromise) {\n\t\t\t\tif (bindingInput !== void 0) throw sqliteError(\"DRIVER.ALREADY_CONNECTED\", \"SQLite client is already bound\", {\n\t\t\t\t\twhy: \"connect() was given options after the client was bound to a database.\",\n\t\t\t\t\tfix: \"Call connect() without options, or create a new client for another database.\",\n\t\t\t\t\tmeta: { extension: \"sqlite\" }\n\t\t\t\t});\n\t\t\t\tconst runtime = getRuntime();\n\t\t\t\tawait connectPromise;\n\t\t\t\tif (closed) throw closedError();\n\t\t\t\treturn runtime;\n\t\t\t}\n\t\t\tbackgroundConnectError = void 0;\n\t\t\tif (bindingInput !== void 0) binding = resolveSqliteBinding(bindingInput);\n\t\t\tif (binding === void 0) throw sqliteError(\"RUNTIME.BINDING_MISSING\", \"SQLite binding not configured. Pass path to sqlite(...) or call db.connect({ path }).\", { meta: { extension: \"sqlite\" } });\n\t\t\tconst runtime = getRuntime();\n\t\t\tif (driverConnected) return runtime;\n\t\t\tawait connectDriver(binding);\n\t\t\tif (closed) throw closedError();\n\t\t\treturn runtime;\n\t\t},\n\t\truntime() {\n\t\t\treturn getRuntime();\n\t\t},\n\t\tprepare,\n\t\ttransaction(fn) {\n\t\t\treturn withTransaction(workRuntime, (txCtx) => {\n\t\t\t\treturn fn(withTransactionMembers(txCtx, buildSqliteTransactionMembers({\n\t\t\t\t\tcontext,\n\t\t\t\t\tcollections: options.collections,\n\t\t\t\t\trawCodecInferer: stack.adapter.rawCodecInferer,\n\t\t\t\t\tenums,\n\t\t\t\t\ttoSql,\n\t\t\t\t\tprepareRuntime: workRuntime\n\t\t\t\t}, txCtx)));\n\t\t\t});\n\t\t},\n\t\tclose() {\n\t\t\tif (closePromise) return closePromise;\n\t\t\tclosed = true;\n\t\t\tclosePromise = (async () => {\n\t\t\t\tawait connectPromise?.catch(() => void 0);\n\t\t\t\tawait ownedDispose?.();\n\t\t\t})();\n\t\t\treturn closePromise;\n\t\t},\n\t\t[Symbol.asyncDispose]() {\n\t\t\treturn this.close();\n\t\t}\n\t};\n}\n//#endregion\nexport { SqliteRuntimeImpl, sqlite as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,YAAY,MAAM,SAAS,SAAS;CAC5C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;AAGA,SAAS,qBAAqB,OAAO;CACpC,OAAO;EACN,MAAM;EACN,MAAM,MAAM;CACb;AACD;AACA,SAAS,6BAA6B,SAAS;CAC9C,IAAI,QAAQ,SAAS,KAAK,GAAG;CAC7B,OAAO;EACN,MAAM;EACN,MAAM,QAAQ;CACf;AACD;AAGA,IAAI,oBAAoB,cAAc,eAAe,CAAC;AAGtD,SAAS,UAAU,KAAK;CACvB,MAAM,YAAY,IAAI;CACtB,cAAc,WAAW,gEAAgE;CACzF,OAAO,UAAU,QAAQ,IAAI,WAAW,UAAU,MAAM,KAAK,IAAI,OAAO,OAAO,WAAW,EAAE,UAAU,EAAE,OAAO,QAAQ,IAAI,KAAK,UAAU,EAAE,EAAE,CAAC,IAAI,SAAS;AAC7J;;;;AAIA,SAAS,8BAA8B,SAAS,OAAO;CACtD,MAAM,EAAE,SAAS,aAAa,iBAAiB,OAAO,OAAO,mBAAmB;CAChF,MAAM,eAAe,IAAI;EACxB;EACA;CACD,CAAC,CAAC,CAAC;CACH,cAAc,cAAc,gEAAgE;CAC5F,OAAO;EACN,KAAK,UAAU,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AAM,YAAY,2BAA2B,yFAAyF,EAAE,MAAM,EAAE,WAAW,SAAS,EAAE,CAAC;GAC/L,MAAM,UAAU,WAAW;GAC3B,IAAI,iBAAiB,OAAO;GAC5B,MAAM,cAAc,OAAO;GAC3B,IAAI,QAAQ,MAAM,YAAY;GAC9B,OAAO;EACR;EACA,UAAU;GACT,OAAO,WAAW;EACnB;EACA;EACA,YAAY,IAAI;GACf,OAAO,gBAAgB,cAAc,UAAU;IAC9C,OAAO,GAAG,uBAAuB,OAAO,8BAA8B;KACrE;KACA,aAAa,QAAQ;KACrB,iBAAiB,MAAM,QAAQ;KAC/B;KACA;KACA,gBAAgB;IACjB,GAAG,KAAK,CAAC,CAAC;GACX,CAAC;EACF;EACA,QAAQ;GACP,IAAI,cAAc,OAAO;GACzB,SAAS;GACT,gBAAgB,YAAY;IAC3B,MAAM,gBAAgB,YAAY,KAAK,CAAC;IACxC,MAAM,eAAe;GACtB,EAAA,CAAG;GACH,OAAO;EACR;EACA,CAAC,OAAO,gBAAgB;GACvB,OAAO,KAAK,MAAM;EACnB;CACD;AACD"}
1
+ {"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-targets/sqlite/9-facade/dist/runtime.mjs"],"sourcesContent":["import { i as validateSqliteContract, t as buildSqliteStaticContext } from \"./sqlite-static-C5wVr3oB.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport sqliteAdapter from \"@internal/adapter-sqlite/runtime\";\nimport sqliteDriver from \"@internal/driver-sqlite/runtime\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { createRawLane, sql } from \"@internal/sql-builder/runtime\";\nimport { orm, prepareQuery } from \"@internal/sql-orm-client\";\nimport { SqlRuntimeBase, activitySource, createExecutionContext, createSqlExecutionStack, delegatingActivitySource, delegatingRuntime, toRuntimeOptions, withTransaction, withTransactionMembers } from \"@internal/sql-runtime\";\nimport sqliteTarget from \"@internal/target-sqlite/runtime\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/errors.ts\nfunction sqliteError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/runtime/binding.ts\nfunction resolveSqliteBinding(input) {\n\treturn {\n\t\tkind: \"path\",\n\t\tpath: input.path\n\t};\n}\nfunction resolveOptionalSqliteBinding(options) {\n\tif (options.path === void 0) return;\n\treturn {\n\t\tkind: \"path\",\n\t\tpath: options.path\n\t};\n}\n//#endregion\n//#region src/runtime/sqlite-runtime.ts\nvar SqliteRuntimeImpl = class extends SqlRuntimeBase {};\n//#endregion\n//#region src/runtime/sqlite.ts\nfunction sqliteOrm(orm) {\n\tconst namespace = orm[UNBOUND_NAMESPACE_ID];\n\tassertDefined(namespace, \"the unbound namespace always exists on a sqlite builder output\");\n\treturn blindCast(Reflect.get(namespace, \"fragment\") === void 0 ? Object.create(namespace, { fragment: { value: Reflect.get(orm, \"fragment\") } }) : namespace);\n}\n/**\n* Builds the members of a SQLite transaction over `txCtx`, so every statement they run goes through the transaction. Preparing sends nothing to the database, so `prepare` uses `prepareRuntime`; the prepared statement runs on the queryable it is given.\n*/\nfunction buildSqliteTransactionMembers(options, txCtx) {\n\tconst { context, collections, rawCodecInferer, enums, toSql, prepareRuntime } = options;\n\tconst sqlNamespace = sql({\n\t\tcontext,\n\t\trawCodecInferer\n\t})[UNBOUND_NAMESPACE_ID];\n\tassertDefined(sqlNamespace, \"the unbound namespace always exists on a sqlite builder output\");\n\treturn {\n\t\tsql: blindCast(sqlNamespace),\n\t\torm: sqliteOrm(orm({\n\t\t\truntime: {\n\t\t\t\tquery(plan) {\n\t\t\t\t\treturn txCtx.query(plan);\n\t\t\t\t},\n\t\t\t\texecute(plan) {\n\t\t\t\t\treturn txCtx.execute(plan);\n\t\t\t\t},\n\t\t\t\t[activitySource]: delegatingActivitySource(() => txCtx)\n\t\t\t},\n\t\t\tcontext,\n\t\t\t...ifDefined(\"collections\", collections)\n\t\t})),\n\t\traw: createRawLane({\n\t\t\tcontext,\n\t\t\trawCodecInferer\n\t\t}),\n\t\tenums,\n\t\ttoSql,\n\t\tprepare(declaration, callback) {\n\t\t\treturn prepareQuery(prepareRuntime, declaration, callback);\n\t\t}\n\t};\n}\n/**\n* Creates a lazy SQLite client. The client infers its contract type from `contract`: a value from\n* `contractFromJson` for an emitted contract, or a TypeScript-authored contract. A contract is\n* validated once, however many clients are built from it. The database opens on the first query\n* or `connect()`.\n*\n* @example\n* ```ts\n* import { contractFromJson } from '@prisma/orm-sqlite/static';\n* import sqlite from '@prisma/orm-sqlite/runtime';\n* import type { Contract } from './contract.d';\n* import contractJson from './contract.json' with { type: 'json' };\n*\n* export const contract = contractFromJson<Contract>(contractJson);\n* export const db = sqlite({ contract, path: './dev.db' });\n* ```\n*/\nfunction sqlite(options) {\n\tconst contract = validateSqliteContract(options.contract);\n\tlet binding = resolveOptionalSqliteBinding(options);\n\tconst stack = createSqlExecutionStack({\n\t\ttarget: sqliteTarget,\n\t\tadapter: sqliteAdapter,\n\t\tdriver: sqliteDriver,\n\t\textensions: options.extensions ?? []\n\t});\n\tconst context = createExecutionContext({\n\t\tcontract,\n\t\tstack,\n\t\tdriver: sqliteDriver\n\t});\n\tconst { sql, raw: rawSqlTag, enums, toSql } = buildSqliteStaticContext(contract, context, stack);\n\tlet runtimeInstance;\n\tlet runtimeDriver;\n\tlet driverConnected = false;\n\tlet connectPromise;\n\tlet closePromise;\n\tlet backgroundConnectError;\n\tlet closed = false;\n\tlet ownedDispose;\n\tconst closedError = () => sqliteError(\"DRIVER.NOT_CONNECTED\", \"SQLite client is closed\", { meta: { extension: \"sqlite\" } });\n\tconst connectDriver = async (resolvedBinding) => {\n\t\tif (driverConnected) return;\n\t\tif (!runtimeDriver) throw new InternalError(\"SQLite runtime driver missing\");\n\t\tif (connectPromise) return connectPromise;\n\t\tconnectPromise = runtimeDriver.connect(resolvedBinding).then(() => {\n\t\t\tdriverConnected = true;\n\t\t}).catch((err) => {\n\t\t\tbackgroundConnectError = err;\n\t\t\tconnectPromise = void 0;\n\t\t\tthrow err;\n\t\t});\n\t\treturn connectPromise;\n\t};\n\tconst getRuntime = () => {\n\t\tif (closed) throw closedError();\n\t\tif (backgroundConnectError !== void 0) throw backgroundConnectError;\n\t\tif (runtimeInstance) return runtimeInstance;\n\t\tconst adapter = stack.adapter.create(stack);\n\t\tconst driver = stack.driver.create();\n\t\townedDispose = () => driver.close();\n\t\truntimeDriver = driver;\n\t\tif (binding !== void 0) connectDriver(binding).catch(() => void 0);\n\t\truntimeInstance = new SqliteRuntimeImpl({\n\t\t\tcontext,\n\t\t\tadapter,\n\t\t\tdriver,\n\t\t\t...toRuntimeOptions(options),\n\t\t\tcloseRefusal: \"at-once\"\n\t\t});\n\t\treturn runtimeInstance;\n\t};\n\tconst workRuntime = delegatingRuntime(getRuntime);\n\tconst orm$1 = sqliteOrm(orm({\n\t\tcontext,\n\t\t...ifDefined(\"collections\", options.collections),\n\t\truntime: workRuntime\n\t}));\n\tfunction prepare(declaration, callback) {\n\t\treturn prepareQuery(workRuntime, declaration, callback);\n\t}\n\treturn {\n\t\tsql,\n\t\torm: orm$1,\n\t\tenums,\n\t\traw: rawSqlTag,\n\t\ttoSql,\n\t\tcontext,\n\t\tcontract,\n\t\tstack,\n\t\tquery(plan, execOptions) {\n\t\t\treturn workRuntime.query(plan, execOptions);\n\t\t},\n\t\texecute(plan, execOptions) {\n\t\t\treturn workRuntime.execute(plan, execOptions);\n\t\t},\n\t\tasync connect(bindingInput) {\n\t\t\tif (closed) throw closedError();\n\t\t\tif (driverConnected || connectPromise) {\n\t\t\t\tif (bindingInput !== void 0) throw sqliteError(\"DRIVER.ALREADY_CONNECTED\", \"SQLite client is already bound\", {\n\t\t\t\t\twhy: \"connect() was given options after the client was bound to a database.\",\n\t\t\t\t\tfix: \"Call connect() without options, or create a new client for another database.\",\n\t\t\t\t\tmeta: { extension: \"sqlite\" }\n\t\t\t\t});\n\t\t\t\tconst runtime = getRuntime();\n\t\t\t\tawait connectPromise;\n\t\t\t\tif (closed) throw closedError();\n\t\t\t\treturn runtime;\n\t\t\t}\n\t\t\tbackgroundConnectError = void 0;\n\t\t\tif (bindingInput !== void 0) binding = resolveSqliteBinding(bindingInput);\n\t\t\tif (binding === void 0) throw sqliteError(\"RUNTIME.BINDING_MISSING\", \"SQLite binding not configured. Pass path to sqlite(...) or call db.connect({ path }).\", { meta: { extension: \"sqlite\" } });\n\t\t\tconst runtime = getRuntime();\n\t\t\tif (driverConnected) return runtime;\n\t\t\tawait connectDriver(binding);\n\t\t\tif (closed) throw closedError();\n\t\t\treturn runtime;\n\t\t},\n\t\truntime() {\n\t\t\treturn getRuntime();\n\t\t},\n\t\tprepare,\n\t\ttransaction(fn) {\n\t\t\treturn withTransaction(workRuntime, (txCtx) => {\n\t\t\t\treturn fn(withTransactionMembers(txCtx, buildSqliteTransactionMembers({\n\t\t\t\t\tcontext,\n\t\t\t\t\tcollections: options.collections,\n\t\t\t\t\trawCodecInferer: stack.adapter.rawCodecInferer,\n\t\t\t\t\tenums,\n\t\t\t\t\ttoSql,\n\t\t\t\t\tprepareRuntime: workRuntime\n\t\t\t\t}, txCtx)));\n\t\t\t});\n\t\t},\n\t\tclose() {\n\t\t\tif (closePromise) return closePromise;\n\t\t\tclosed = true;\n\t\t\tclosePromise = (async () => {\n\t\t\t\tawait connectPromise?.catch(() => void 0);\n\t\t\t\tawait ownedDispose?.();\n\t\t\t})();\n\t\t\treturn closePromise;\n\t\t},\n\t\t[Symbol.asyncDispose]() {\n\t\t\treturn this.close();\n\t\t}\n\t};\n}\n//#endregion\nexport { SqliteRuntimeImpl, sqlite as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,YAAY,MAAM,SAAS,SAAS;CAC5C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;AAGA,SAAS,qBAAqB,O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GACtB,EAAA,CAAG;GACH,OAAO;EACR;EACA,CAAC,OAAO,gBAAgB;GACvB,OAAO,KAAK,MAAM;EACnB;CACD;AACD"}
@@ -7,8 +7,8 @@ import { assertDefined } from "@prisma/orm-framework/utils/assertions";
7
7
  import { blindCast } from "@prisma/orm-framework/utils/casts";
8
8
  import { validateContractOnce } from "@prisma/orm-framework/contract/validate-once";
9
9
  import { buildNamespacedEnums } from "@prisma/orm-framework/contract/enum-accessor";
10
- //#region ../../../3-targets/sqlite/9-facade/dist/sqlite-static-DtKey_1v.mjs
11
- var version = "8.0.0-rc.23-dev.2";
10
+ //#region ../../../3-targets/sqlite/9-facade/dist/sqlite-static-C5wVr3oB.mjs
11
+ var version = "8.0.0-rc.23-dev.4";
12
12
  const serializer = new SqliteContractSerializer();
13
13
  const validator = `${sqliteTarget.targetId}@${version}`;
14
14
  /**
@@ -80,4 +80,4 @@ function sqliteStatic(options) {
80
80
  //#endregion
81
81
  export { validateSqliteContract as i, contractFromJson as n, sqliteStatic as r, buildSqliteStaticContext as t };
82
82
 
83
- //# sourceMappingURL=sqlite-static-DtKey_1v-BypVwxr_.mjs.map
83
+ //# sourceMappingURL=sqlite-static-C5wVr3oB-R_YI-5vb.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sqlite-static-DtKey_1v-BypVwxr_.mjs","names":[],"sources":["../../../../3-targets/sqlite/9-facade/dist/sqlite-static-DtKey_1v.mjs"],"sourcesContent":["import sqliteAdapter from \"@internal/adapter-sqlite/runtime\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { createRawLane, sql } from \"@internal/sql-builder/runtime\";\nimport { createExecutionContext, createSqlExecutionStack, createToSql } from \"@internal/sql-runtime\";\nimport sqliteTarget, { SqliteContractSerializer } from \"@internal/target-sqlite/runtime\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { validateContractOnce } from \"@internal/contract/validate-once\";\nimport { buildNamespacedEnums } from \"@internal/contract/enum-accessor\";\n//#region package.json\nvar version = \"8.0.0-rc.23-dev.2\";\n//#endregion\n//#region src/static/contract-from-json.ts\nconst serializer = new SqliteContractSerializer();\nconst validator = `${sqliteTarget.targetId}@${version}`;\n/**\n* Validates an emitted SQLite `contract.json` and returns it as the contract type the application\n* names, ready to pass to `sqlite({ contract })` and `sqliteStatic({ contract })`. Clients built\n* from the result do not validate it again.\n*\n* The returned value's top level is frozen; its nested objects are not. Do not change `json` or the\n* returned value after the call: clients built from the value later do not validate it again.\n*\n* @example\n* ```ts\n* import type { Contract } from './contract.d';\n* import contractJson from './contract.json' with { type: 'json' };\n*\n* export const contract = contractFromJson<Contract>(contractJson);\n* ```\n*/\nfunction contractFromJson(json) {\n\treturn validateContractOnce(json, validator, (input) => serializer.deserializeContract(input));\n}\nfunction validateSqliteContract(contract) {\n\treturn validateContractOnce(contract, validator, () => serializer.deserializeContract(serializer.serializeContract(contract)));\n}\n//#endregion\n//#region src/static/sqlite-static.ts\nfunction buildSqliteStaticContext(contract, context, stack) {\n\tconst { rawCodecInferer } = stack.adapter;\n\tconst sqlNamespace = sql({\n\t\tcontext,\n\t\trawCodecInferer\n\t})[UNBOUND_NAMESPACE_ID];\n\tassertDefined(sqlNamespace, \"the unbound namespace always exists on a sqlite builder output\");\n\tconst sqlDb = blindCast(sqlNamespace);\n\tconst raw = createRawLane({\n\t\tcontext,\n\t\trawCodecInferer\n\t});\n\tconst enums = Object.freeze(buildNamespacedEnums(context.contract.domain, (codecId) => context.contractCodecs.forCodecRef({ codecId })))[UNBOUND_NAMESPACE_ID];\n\tassertDefined(enums, \"the unbound namespace always exists on a sqlite builder output\");\n\treturn {\n\t\tcontext,\n\t\tcontract,\n\t\tenums,\n\t\tsql: sqlDb,\n\t\traw,\n\t\ttoSql: createToSql(stack, contract)\n\t};\n}\n/**\n* The query surfaces of a SQLite client without a driver: `sql`, `raw`, `enums` and `toSql`. Use\n* it where loading `node:sqlite` is not wanted.\n*\n* @example\n* ```ts\n* const { enums } = sqliteStatic({ contract: contractFromJson<Contract>(contractJson) });\n* ```\n*/\nfunction sqliteStatic(options) {\n\tconst contract = validateSqliteContract(options.contract);\n\tconst stack = createSqlExecutionStack({\n\t\ttarget: sqliteTarget,\n\t\tadapter: sqliteAdapter,\n\t\textensions: options.extensions ?? []\n\t});\n\treturn buildSqliteStaticContext(contract, createExecutionContext({\n\t\tcontract,\n\t\tstack\n\t}), stack);\n}\n//#endregion\nexport { validateSqliteContract as i, sqliteStatic as n, contractFromJson as r, buildSqliteStaticContext as t };\n\n//# sourceMappingURL=sqlite-static-DtKey_1v.mjs.map"],"mappings":";;;;;;;;;;AAUA,IAAI,UAAU;AAGd,MAAM,aAAa,IAAI,yBAAyB;AAChD,MAAM,YAAY,GAAG,aAAa,SAAS,GAAG;;;;;;;;;;;;;;;;;AAiB9C,SAAS,iBAAiB,MAAM;CAC/B,OAAO,qBAAqB,MAAM,YAAY,UAAU,WAAW,oBAAoB,KAAK,CAAC;AAC9F;AACA,SAAS,uBAAuB,UAAU;CACzC,OAAO,qBAAqB,UAAU,iBAAiB,WAAW,oBAAoB,WAAW,kBAAkB,QAAQ,CAAC,CAAC;AAC9H;AAGA,SAAS,yBAAyB,UAAU,SAAS,OAAO;CAC3D,MAAM,EAAE,oBAAoB,MAAM;CAClC,MAAM,eAAe,IAAI;EACxB;EACA;CACD,CAAC,CAAC,CAAC;CACH,cAAc,cAAc,gEAAgE;CAC5F,MAAM,QAAQ,UAAU,YAAY;CACpC,MAAM,MAAM,cAAc;EACzB;EACA;CACD,CAAC;CACD,MAAM,QAAQ,OAAO,OAAO,qBAAqB,QAAQ,SAAS,SAAS,YAAY,QAAQ,eAAe,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;CACzI,cAAc,OAAO,gEAAgE;CACrF,OAAO;EACN;EACA;EACA;EACA,KAAK;EACL;EACA,OAAO,YAAY,OAAO,QAAQ;CACnC;AACD;;;;;;;;;;AAUA,SAAS,aAAa,SAAS;CAC9B,MAAM,WAAW,uBAAuB,QAAQ,QAAQ;CACxD,MAAM,QAAQ,wBAAwB;EACrC,QAAQ;EACR,SAAS;EACT,YAAY,QAAQ,cAAc,CAAC;CACpC,CAAC;CACD,OAAO,yBAAyB,UAAU,uBAAuB;EAChE;EACA;CACD,CAAC,GAAG,KAAK;AACV"}
1
+ {"version":3,"file":"sqlite-static-C5wVr3oB-R_YI-5vb.mjs","names":[],"sources":["../../../../3-targets/sqlite/9-facade/dist/sqlite-static-C5wVr3oB.mjs"],"sourcesContent":["import sqliteAdapter from \"@internal/adapter-sqlite/runtime\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { createRawLane, sql } from \"@internal/sql-builder/runtime\";\nimport { createExecutionContext, createSqlExecutionStack, createToSql } from \"@internal/sql-runtime\";\nimport sqliteTarget, { SqliteContractSerializer } from \"@internal/target-sqlite/runtime\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { validateContractOnce } from \"@internal/contract/validate-once\";\nimport { buildNamespacedEnums } from \"@internal/contract/enum-accessor\";\n//#region package.json\nvar version = \"8.0.0-rc.23-dev.4\";\n//#endregion\n//#region src/static/contract-from-json.ts\nconst serializer = new SqliteContractSerializer();\nconst validator = `${sqliteTarget.targetId}@${version}`;\n/**\n* Validates an emitted SQLite `contract.json` and returns it as the contract type the application\n* names, ready to pass to `sqlite({ contract })` and `sqliteStatic({ contract })`. Clients built\n* from the result do not validate it again.\n*\n* The returned value's top level is frozen; its nested objects are not. Do not change `json` or the\n* returned value after the call: clients built from the value later do not validate it again.\n*\n* @example\n* ```ts\n* import type { Contract } from './contract.d';\n* import contractJson from './contract.json' with { type: 'json' };\n*\n* export const contract = contractFromJson<Contract>(contractJson);\n* ```\n*/\nfunction contractFromJson(json) {\n\treturn validateContractOnce(json, validator, (input) => serializer.deserializeContract(input));\n}\nfunction validateSqliteContract(contract) {\n\treturn validateContractOnce(contract, validator, () => serializer.deserializeContract(serializer.serializeContract(contract)));\n}\n//#endregion\n//#region src/static/sqlite-static.ts\nfunction buildSqliteStaticContext(contract, context, stack) {\n\tconst { rawCodecInferer } = stack.adapter;\n\tconst sqlNamespace = sql({\n\t\tcontext,\n\t\trawCodecInferer\n\t})[UNBOUND_NAMESPACE_ID];\n\tassertDefined(sqlNamespace, \"the unbound namespace always exists on a sqlite builder output\");\n\tconst sqlDb = blindCast(sqlNamespace);\n\tconst raw = createRawLane({\n\t\tcontext,\n\t\trawCodecInferer\n\t});\n\tconst enums = Object.freeze(buildNamespacedEnums(context.contract.domain, (codecId) => context.contractCodecs.forCodecRef({ codecId })))[UNBOUND_NAMESPACE_ID];\n\tassertDefined(enums, \"the unbound namespace always exists on a sqlite builder output\");\n\treturn {\n\t\tcontext,\n\t\tcontract,\n\t\tenums,\n\t\tsql: sqlDb,\n\t\traw,\n\t\ttoSql: createToSql(stack, contract)\n\t};\n}\n/**\n* The query surfaces of a SQLite client without a driver: `sql`, `raw`, `enums` and `toSql`. Use\n* it where loading `node:sqlite` is not wanted.\n*\n* @example\n* ```ts\n* const { enums } = sqliteStatic({ contract: contractFromJson<Contract>(contractJson) });\n* ```\n*/\nfunction sqliteStatic(options) {\n\tconst contract = validateSqliteContract(options.contract);\n\tconst stack = createSqlExecutionStack({\n\t\ttarget: sqliteTarget,\n\t\tadapter: sqliteAdapter,\n\t\textensions: options.extensions ?? []\n\t});\n\treturn buildSqliteStaticContext(contract, createExecutionContext({\n\t\tcontract,\n\t\tstack\n\t}), stack);\n}\n//#endregion\nexport { validateSqliteContract as i, sqliteStatic as n, contractFromJson as r, buildSqliteStaticContext as t };\n\n//# sourceMappingURL=sqlite-static-C5wVr3oB.mjs.map"],"mappings":";;;;;;;;;;AAUA,IAAI,UAAU;AAGd,MAAM,aAAa,IAAI,yBAAyB;AAChD,MAAM,YAAY,GAAG,aAAa,SAAS,GAAG;;;;;;;;;;;;;;;;;AAiB9C,SAAS,iBAAiB,MAAM;CAC/B,OAAO,qBAAqB,MAAM,YAAY,UAAU,WAAW,oBAAoB,KAAK,CAAC;AAC9F;AACA,SAAS,uBAAuB,UAAU;CACzC,OAAO,qBAAqB,UAAU,iBAAiB,WAAW,oBAAoB,WAAW,kBAAkB,QAAQ,CAAC,CAAC;AAC9H;AAGA,SAAS,yBAAyB,UAAU,SAAS,OAAO;CAC3D,MAAM,EAAE,oBAAoB,MAAM;CAClC,MAAM,eAAe,IAAI;EACxB;EACA;CACD,CAAC,CAAC,CAAC;CACH,cAAc,cAAc,gEAAgE;CAC5F,MAAM,QAAQ,UAAU,YAAY;CACpC,MAAM,MAAM,cAAc;EACzB;EACA;CACD,CAAC;CACD,MAAM,QAAQ,OAAO,OAAO,qBAAqB,QAAQ,SAAS,SAAS,YAAY,QAAQ,eAAe,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;CACzI,cAAc,OAAO,gEAAgE;CACrF,OAAO;EACN;EACA;EACA;EACA,KAAK;EACL;EACA,OAAO,YAAY,OAAO,QAAQ;CACnC;AACD;;;;;;;;;;AAUA,SAAS,aAAa,SAAS;CAC9B,MAAM,WAAW,uBAAuB,QAAQ,QAAQ;CACxD,MAAM,QAAQ,wBAAwB;EACrC,QAAQ;EACR,SAAS;EACT,YAAY,QAAQ,cAAc,CAAC;CACpC,CAAC;CACD,OAAO,yBAAyB,UAAU,uBAAuB;EAChE;EACA;CACD,CAAC,GAAG,KAAK;AACV"}
package/dist/static.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as contractFromJson, r as sqliteStatic } from "./sqlite-static-DtKey_1v-BypVwxr_.mjs";
1
+ import { n as contractFromJson, r as sqliteStatic } from "./sqlite-static-C5wVr3oB-R_YI-5vb.mjs";
2
2
  export { contractFromJson, sqliteStatic as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-sqlite",
3
- "version": "8.0.0-rc.23-dev.2",
3
+ "version": "8.0.0-rc.23-dev.4",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -10,18 +10,18 @@
10
10
  "skills"
11
11
  ],
12
12
  "dependencies": {
13
- "@prisma/orm-family-sql": "8.0.0-rc.23-dev.2",
14
- "@prisma/orm-framework": "8.0.0-rc.23-dev.2",
15
- "@prisma/orm-target-sqlite": "8.0.0-rc.23-dev.2",
16
- "@prisma/orm-toolchain": "8.0.0-rc.23-dev.2",
13
+ "@prisma/orm-family-sql": "8.0.0-rc.23-dev.4",
14
+ "@prisma/orm-framework": "8.0.0-rc.23-dev.4",
15
+ "@prisma/orm-target-sqlite": "8.0.0-rc.23-dev.4",
16
+ "@prisma/orm-toolchain": "8.0.0-rc.23-dev.4",
17
17
  "pathe": "^2.0.3",
18
18
  "tinyglobby": "^0.2.17",
19
19
  "temporal-spec": "1.0.1"
20
20
  },
21
21
  "devDependencies": {
22
- "@internal/sqlite": "8.0.0-rc.23-dev.2",
23
- "@repo/tsconfig": "8.0.0-rc.23-dev.2",
24
- "@repo/tsdown": "8.0.0-rc.23-dev.2",
22
+ "@internal/sqlite": "8.0.0-rc.23-dev.4",
23
+ "@repo/tsconfig": "8.0.0-rc.23-dev.4",
24
+ "@repo/tsdown": "8.0.0-rc.23-dev.4",
25
25
  "tsdown": "0.22.14",
26
26
  "typescript": "5.9.3"
27
27
  },
@@ -15,7 +15,7 @@ description: >-
15
15
  ORM 7 or earlier (schema.prisma + @prisma/client).
16
16
  metadata:
17
17
  library: '@prisma/orm-sqlite'
18
- library_version: '8.0.0-rc.23-dev.2'
18
+ library_version: '8.0.0-rc.23-dev.4'
19
19
  version: '2026-09-12'
20
20
  ---
21
21
 
@@ -46,7 +46,7 @@ Both files are **emitted artefacts**. Edit the source; never the JSON or `.d.ts`
46
46
  - **`contract.prisma` (PSL)** — schema-flavoured DSL. Canonical for typical apps and brownfield Prisma users. Wired by `contract: './<path>/contract.prisma'` — the target config (`ormConfig`, below) detects the `.prisma` extension and routes through the PSL provider. The first line of every `.prisma` file is `// use prisma-8`; `orm init` and `contract infer` write it, and the language server only serves diagnostics, completion, and formatting on files that carry it (it still recognises the header earlier releases wrote and rewrites it on Format).
47
47
  - **`contract.ts` (TypeScript builder)** — programmatic authoring with `defineContract({...}, ({ field, model, rel, type }) => ({...}))` from `@internal/postgres/contract-builder` (or `@internal/mongo/contract-builder`). Wired by `contract: './<path>/contract.ts'` — the façade detects the `.ts` extension and routes through the TS provider. Use when you need programmatic composition (per-tenant variants, generated fields) or constructs PSL doesn't yet express (e.g. registering a parameterised extension type — see pgvector's contract).
48
48
  - **An existing Prisma schema, during adoption.** A project that still runs an earlier Prisma can point `contract:` at its current `schema.prisma` instead of writing a Prisma 8 contract: `contract: prisma6Schema('prisma/schema.prisma')` from `@internal/mongo/config` reads a Prisma 6 MongoDB schema, and `prisma7Schema` from `@internal/postgres/config` reads a Prisma 7 Postgres schema. The earlier Prisma keeps owning the database; after each change there, run `contract emit` and `db sign`. A construct Prisma 8 cannot express fails `contract emit` with a `PSL.PRISMA6_MONGO_*` or `PSL.PRISMA7_*` diagnostic. See the façade READMEs for the details.
49
- - **`prisma.config.ts`.** Wires the contract source, the database connection, the migrations directory, and any installed extensions. The file is an *envelope*: the unified CLI's `definePrismaConfig({...})` from `@prisma/cli-engine` wraps an `orm:` section built by the target's `defineConfig` — conventionally imported as `ormConfig` from `@internal/postgres/config` (or `@internal/mongo/config`). There is no flat form; a bare `defineConfig({ contract, ... })` default export fails with `CONFIG.VERSION_MARKER_MISSING`.
49
+ - **`prisma.config.ts`.** Wires the contract source, the database connection, the migrations directory, and any installed extensions. The file is an *envelope*: the unified CLI's `definePrismaConfig({...})` from `@prisma/cli-engine` wraps an `orm:` section built by the target's `defineConfig` — conventionally imported as `ormConfig` from `@internal/postgres/config` (or `@internal/mongo/config`). There is no flat form; a bare `defineConfig({ contract, ... })` default export fails with `CONFIG.VERSION_MARKER_MISSING`. Pass `formatter: { indent, newline }` to `ormConfig` to set how `prisma contract format` and the language server lay out PSL files: `indent` is a whole number of spaces, 1 or more (default 2), or `'tab'`. `newline` is `'LF'` or `'CRLF'`; without it, `contract format` uses the operating system's line ending and the language server uses LF.
50
50
 
51
51
  ```typescript
52
52
  // prisma.config.ts — what `prisma orm init` scaffolds
@@ -62,7 +62,7 @@ Both files are **emitted artefacts**. Edit the source; never the JSON or `.d.ts`
62
62
  });
63
63
  ```
64
64
 
65
- The fields `ormConfig` accepts: `contract` (path string — `.prisma` or `.ts`), `output` (optional override for where `contract.json` lands), `db` (`{ connection?: string }`), `extensions` (array of control descriptors), `migrations` (`{ dir?: string }`). Without `output`, the path for `contract.json` is derived from `contract` (e.g. `./src/prisma/contract.prisma` → `./src/prisma/contract.json`). Keep `import 'dotenv/config'` when the config reads `process.env`.
65
+ The fields `ormConfig` accepts: `contract` (path string — `.prisma` or `.ts`), `output` (optional override for where `contract.json` lands), `db` (`{ connection?: string }`), `extensions` (array of control descriptors), `migrations` (`{ dir?: string }`), `formatter` (`{ indent?: number | 'tab'; newline?: 'LF' | 'CRLF' }`). Without `output`, the path for `contract.json` is derived from `contract` (e.g. `./src/prisma/contract.prisma` → `./src/prisma/contract.json`). Keep `import 'dotenv/config'` when the config reads `process.env`.
66
66
  - **Emit pipeline.** `prisma contract emit --config <path>?` reads `prisma.config.ts`, calls the provider the façade picked, validates the resulting Contract, then atomically writes `contract.json` + `contract.d.ts` colocated with the source.
67
67
  - **Extension namespaces.** Extensions contribute namespaced constructors (`pgvector.Vector(length: 1536)`, `postgis.Geometry(...)`) and type aliases. Install them by adding the descriptor to **two** places — both fields are named `extensions`, but the two surfaces consume two different descriptor types and shapes:
68
68
  - **In the config (façade and core):** `extensions: [pgvector]` — array of *control* descriptors imported from `@internal/extension-<name>/control`.
@@ -122,7 +122,7 @@ changes:
122
122
  - 'import\s+(?:type\s+)?\{[^}]*(?<![\w$])Interval(?![\w$])[^}]*\}\s*from\s*[\x27"]@prisma/orm-postgres/(?:contract-builder|target/codec-types)[\x27"]'
123
123
  - id: branded-time-types-removed
124
124
  summary: |
125
- The string types `Timestamp`, `Timestamptz`, `Time` and `Interval` are no longer exported from `@prisma/orm-postgres/target/codec-types` (and `Interval` no longer from `@prisma/orm-postgres/contract-builder`). No column was typed by the first three. Remove each of these names from the import that names it, and delete the import if it names nothing else. A `contract.d.ts` written by an earlier release, such as one in a migration snapshot, imports them without using them, so removing them from its import is the only change it needs.
125
+ The string types `Timestamp`, `Timestamptz`, `Time` and `Interval` are no longer exported from `@prisma/orm-postgres/target/codec-types` (and `Interval` no longer from `@prisma/orm-postgres/contract-builder`). No column was typed by the first three. Remove each of these names from the import that names it, and delete the import if it names nothing else. An emitted `contract.d.ts` imports them without using them. Re-emit it with `prisma contract emit`; do not edit it by hand. Only a frozen copy in a migration snapshot, `migrations/snapshots/<hash>/contract.d.ts`, is never re-emitted: remove the names from its import by hand, and change nothing else in it.
126
126
  detection:
127
127
  glob: "**/*.{ts,mts,cts,tsx}"
128
128
  matches:
@@ -136,7 +136,7 @@ changes:
136
136
  - '(?<![\s\S])(?![\s\S]*import\s+(?:type\s+)?\{[^}]*(?<![\w$])Temporal(?![\w$])(?!\s+as(?![\w$]))[^}]*\}\s*from\s*[\x27"]temporal-spec[\x27"])[\s\S]*toEqualTypeOf<\s*Temporal\.'
137
137
  - id: contract-types-list-new-aggregates
138
138
  summary: |
139
- Optional. An emitted `contract.d.ts` lists the aggregates of every codec in the stack, so `prisma contract emit` now adds rows for the three new codecs to it, and the contract itself does not change. Re-emit when you next change the contract; until then the existing `contract.d.ts` keeps working. A migration snapshot's `contract.d.ts` does not need the new rows; it needs only the import change `branded-time-types-removed` describes.
139
+ Optional. An emitted `contract.d.ts` lists the aggregates of every codec in the stack, so `prisma contract emit` now adds rows for the three new codecs to it, and the contract itself does not change. Re-emit when you next change the contract; until then the existing `contract.d.ts` keeps working. A frozen `contract.d.ts` in a migration snapshot, `migrations/snapshots/<hash>/contract.d.ts`, is never re-emitted and does not need the new rows; it needs only the hand edit to its import that `branded-time-types-removed` describes.
140
140
  - id: iso-string-date-time-values
141
141
  summary: |
142
142
  The PostgreSQL text date and time types (`TimestamptzString`, `TimestampString`, `DateString`, `TimeString`, `Timetz`) read and write ISO 8601, the form the contract stores, instead of the text PostgreSQL prints. A `timestamptz` reads as the instant in UTC whatever the session's time zone, as in `2024-01-01T00:00:00Z`. A literal default or enum member on these types must be written in that form.
@@ -213,13 +213,13 @@ Do the steps in this order, and skip a step that does not apply to the project:
213
213
 
214
214
  1. Upgrade the Prisma packages.
215
215
  2. Change a MongoDB contract source as the MongoDB entries below say: pass the target pack to `mongoContract` (`mongo-contract-target-option`), rename the contract types (`mongo-contract-input`, `mongo-model-definition-removed`), and fix any discriminator, index or enum the contract now refuses (`mongo-ts-polymorphism-rules`, `mongo-index-shape-rules`, `mongo-value-object-enum-check`).
216
- 3. Change a PostgreSQL contract source: rename the date and time types (`psl-temporal-type-renames`, `ts-temporal-type-helpers-renamed`), and write each literal default or enum member of a text date or time type in ISO 8601 (`iso-string-date-time-values`).
216
+ 3. Change a PostgreSQL contract source: rename the date and time types (`psl-temporal-type-renames`, `ts-temporal-type-helpers-renamed`), remove the date and time types no longer exported from its imports (`branded-time-types-removed`), and write each literal default or enum member of a text date or time type in ISO 8601 (`iso-string-date-time-values`).
217
217
  4. Rewrite every field preset and `field.generated(...)` in the contract sources and query fragments, with the type constructors, aliases and attributes the tables in "Field presets are removed" give (`psl-field-presets-removed`, `ts-field-presets-removed`, `ts-field-generated-removed`). Do this after step 3, because the tables use the new date and time type names.
218
- 5. Run `prisma contract emit` (this also covers `contract-types-list-new-aggregates`, `prisma7-schema-now-default-writes-on-create` and `contract-artifacts-restamp`).
218
+ 5. Run `prisma contract emit` for every contract the project emits, and run it again with `--output-path` for each directory the project emits to that way (this also covers `contract-types-list-new-aggregates`, `prisma7-schema-now-default-writes-on-create` and `contract-artifacts-restamp`).
219
219
  6. Run `prisma db sign` against every database when the project reads a Prisma 6 MongoDB schema whose storage hash changed (`mongo-prisma6-merged-indexes`).
220
220
  7. On Postgres and SQLite, answer the question about a removed enum value the next time you run `migration plan` or `db update` (`removed-enum-value-questions`).
221
221
  8. Change the application code: await client calls inside `try` blocks (`client-members-reject-instead-of-throwing`), stop using a runtime captured before `close()` (`close-ends-the-client-not-your-pool`), catch the connection error for a bad SQLite path (`sqlite-open-failure-is-a-connection-error`), pass `markerLocation` to `verifyContractSpaces` (`verify-contract-spaces-marker-location`), and, in code that calls the control API, drop `refuseMarkerOutsideGraph`, pass `invocation` to `executeMigrateShowPlan` and read the new `MIGRATION.MARKER_MISMATCH` fields (`refuse-marker-outside-graph-removed`, `execute-migrate-show-plan-requires-invocation`, `marker-mismatch-meta`).
222
- 9. Change the code that uses PostgreSQL date and time values: remove the date and time types no longer exported from imports, including those in migration snapshots (`branded-time-types-removed`, `interval-with-precision-typed-as-parts`), import `Temporal` from `temporal-spec` in type tests (`temporal-types-from-temporal-spec`), read text date and time values as ISO 8601 (`iso-string-date-time-values`), and remove any statement that sets a `DateStyle` other than `ISO` (`date-style-iso-required`).
222
+ 9. Change the code that uses PostgreSQL date and time values: remove the date and time types no longer exported from the imports in your other source files and, by hand, in the frozen `contract.d.ts` copies under `migrations/snapshots/<hash>/`; every other `contract.d.ts` was re-emitted in step 5 (`branded-time-types-removed`, `interval-with-precision-typed-as-parts`), import `Temporal` from `temporal-spec` in type tests (`temporal-types-from-temporal-spec`), read text date and time values as ISO 8601 (`iso-string-date-time-values`), and remove any statement that sets a `DateStyle` other than `ISO` (`date-style-iso-required`).
223
223
 
224
224
  ## `mongoContract` takes the target pack
225
225
 
@@ -462,7 +462,7 @@ const span: PgInterval = row.span; // an IntervalParts(6) column
462
462
 
463
463
  ### `branded-time-types-removed`
464
464
 
465
- Remove the four names from the import, and leave the rest of the file as it is:
465
+ In source files you wrote, remove the four names from the import. Re-emit every emitted `contract.d.ts` with `prisma contract emit` instead of editing it. The only `contract.d.ts` files to edit by hand are the frozen copies in migration snapshots, `migrations/snapshots/<hash>/contract.d.ts`, which are never re-emitted. In those, remove the four names from the import and leave the rest of the file as it is:
466
466
 
467
467
  ```ts
468
468
  import type {
@@ -130,7 +130,7 @@ changes:
130
130
  - 'import\s+(?:type\s+)?\{[^}]*(?<![\w$])Interval(?![\w$])[^}]*\}\s*from\s*[\x27"]@prisma/orm-postgres/(?:contract-builder|target/codec-types)[\x27"]'
131
131
  - id: branded-time-types-removed
132
132
  summary: |
133
- The string types `Timestamp`, `Timestamptz`, `Time` and `Interval` are no longer exported from `@prisma/orm-postgres/target/codec-types` (and `Interval` no longer from `@prisma/orm-postgres/contract-builder`). No column was typed by the first three. Remove each of these names from the import that names it, and delete the import if it names nothing else. A `contract.d.ts` written by an earlier release, such as one in a migration snapshot, imports them without using them, so removing them from its import is the only change it needs.
133
+ The string types `Timestamp`, `Timestamptz`, `Time` and `Interval` are no longer exported from `@prisma/orm-postgres/target/codec-types` (and `Interval` no longer from `@prisma/orm-postgres/contract-builder`). No column was typed by the first three. Remove each of these names from the import that names it, and delete the import if it names nothing else. An emitted `contract.d.ts` imports them without using them. Re-emit it with `prisma contract emit`; do not edit it by hand. Only a frozen copy in a migration snapshot, `migrations/snapshots/<hash>/contract.d.ts`, is never re-emitted: remove the names from its import by hand, and change nothing else in it.
134
134
  detection:
135
135
  glob: "**/*.{ts,mts,cts,tsx}"
136
136
  matches:
@@ -144,7 +144,7 @@ changes:
144
144
  - '(?<![\s\S])(?![\s\S]*import\s+(?:type\s+)?\{[^}]*(?<![\w$])Temporal(?![\w$])(?!\s+as(?![\w$]))[^}]*\}\s*from\s*[\x27"]temporal-spec[\x27"])[\s\S]*toEqualTypeOf<\s*Temporal\.'
145
145
  - id: contract-types-list-new-aggregates
146
146
  summary: |
147
- Optional. An emitted `contract.d.ts` lists the aggregates of every codec in the stack, so `prisma contract emit` now adds rows for the three new codecs to it, and the contract itself does not change. An extension that commits an emitted `contract.d.ts` re-emits it when it next changes the contract; until then the existing `contract.d.ts` keeps working. A migration snapshot's `contract.d.ts` does not need the new rows; it needs only the import change `branded-time-types-removed` describes.
147
+ Optional. An emitted `contract.d.ts` lists the aggregates of every codec in the stack, so `prisma contract emit` now adds rows for the three new codecs to it, and the contract itself does not change. An extension that commits an emitted `contract.d.ts` re-emits it when it next changes the contract; until then the existing `contract.d.ts` keeps working. A frozen `contract.d.ts` in a migration snapshot, `migrations/snapshots/<hash>/contract.d.ts`, is never re-emitted and does not need the new rows; it needs only the hand edit to its import that `branded-time-types-removed` describes.
148
148
  - id: driver-ensures-target-session-settings
149
149
  summary: |
150
150
  A target descriptor may declare `sessionSettings`, the settings its codecs need on every database session; the PostgreSQL target declares `DateStyle=ISO`. A stack passes them to each driver it creates: a runtime driver descriptor's `create(options, sessionSettings)` receives them as a second argument, and a control driver's connect options carry them as `sessionSettings`. A driver for a target that declares them must ensure them on every connection it hands out. A wrapper around a driver descriptor's `create` passes `sessionSettings` on.
@@ -435,7 +435,7 @@ const span: PgInterval = row.span; // an IntervalParts(6) column
435
435
 
436
436
  ### `branded-time-types-removed`
437
437
 
438
- Remove the four names from the import, and leave the rest of the file as it is:
438
+ In source files you wrote, remove the four names from the import. Re-emit every emitted `contract.d.ts` with `prisma contract emit` instead of editing it. The only `contract.d.ts` files to edit by hand are the frozen copies in migration snapshots, `migrations/snapshots/<hash>/contract.d.ts`, which are never re-emitted. In those, remove the four names from the import and leave the rest of the file as it is:
439
439
 
440
440
  ```ts
441
441
  import type {