@prisma/orm-sqlite 8.0.0-rc.11-dev.10 → 8.0.0-rc.11-dev.11
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/runtime.d.mts +1 -1
- package/dist/runtime.mjs +23 -20
- package/dist/runtime.mjs.map +1 -1
- package/dist/{sqlite-D2JUSooi-BCJK5urO.d.mts → sqlite-VTg9YLdO-DlPr4NSi.d.mts} +6 -6
- package/dist/sqlite-VTg9YLdO-DlPr4NSi.d.mts.map +1 -0
- package/dist/static.d.mts +1 -1
- package/package.json +8 -8
- package/skills/prisma-8/SKILL.md +1 -1
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/instructions.md +23 -1
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/instructions.md +51 -1
- package/dist/sqlite-D2JUSooi-BCJK5urO.d.mts.map +0 -1
package/dist/runtime.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SqliteOptionsWithContractJson, c as sqlite, i as SqliteOptionsWithContract, n as SqliteOptions, r as SqliteOptionsBase, s as SqliteTargetId, t as SqliteClient } from "./sqlite-
|
|
1
|
+
import { a as SqliteOptionsWithContractJson, c as sqlite, i as SqliteOptionsWithContract, n as SqliteOptions, r as SqliteOptionsBase, s as SqliteTargetId, t as SqliteClient } from "./sqlite-VTg9YLdO-DlPr4NSi.mjs";
|
|
2
2
|
import { Runtime, SqlRuntimeBase } from "@prisma/orm-family-sql/runtime";
|
|
3
3
|
import "@prisma/orm-target-sqlite/driver/runtime";
|
|
4
4
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
package/dist/runtime.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { assertDefined } from "@prisma/orm-framework/utils/assertions";
|
|
|
9
9
|
import { blindCast, castAs } from "@prisma/orm-framework/utils/casts";
|
|
10
10
|
import sqliteDriver from "@prisma/orm-target-sqlite/driver/runtime";
|
|
11
11
|
import { instantiateExecutionStack } from "@prisma/orm-framework/components/execution";
|
|
12
|
-
import { orm } from "@prisma/orm-family-sql/orm-client";
|
|
12
|
+
import { orm, prepareQuery } from "@prisma/orm-family-sql/orm-client";
|
|
13
13
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
14
14
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
15
15
|
//#region ../../../3-extensions/sqlite/dist/runtime.mjs
|
|
@@ -37,9 +37,10 @@ function unboundOrm(orm) {
|
|
|
37
37
|
}
|
|
38
38
|
function resolveContract(options) {
|
|
39
39
|
const serializer = new SqliteContractSerializer();
|
|
40
|
-
if ("contractJson" in options && options.contractJson !== void 0) return serializer.deserializeContract(options.contractJson);
|
|
40
|
+
if ("contractJson" in options && options.contractJson !== void 0) return blindCast(serializer.deserializeContract(options.contractJson));
|
|
41
41
|
const contract = options.contract;
|
|
42
|
-
|
|
42
|
+
assertDefined(contract, "a contract or contractJson is required");
|
|
43
|
+
return blindCast(serializer.deserializeContract(serializer.serializeContract(contract)));
|
|
43
44
|
}
|
|
44
45
|
function sqlite(options) {
|
|
45
46
|
const contract = resolveContract(options);
|
|
@@ -97,22 +98,26 @@ function sqlite(options) {
|
|
|
97
98
|
});
|
|
98
99
|
return runtimeInstance;
|
|
99
100
|
};
|
|
101
|
+
const orm$1 = unboundOrm(orm({
|
|
102
|
+
context,
|
|
103
|
+
runtime: {
|
|
104
|
+
query(plan) {
|
|
105
|
+
return getRuntime().query(plan);
|
|
106
|
+
},
|
|
107
|
+
execute(plan) {
|
|
108
|
+
return getRuntime().execute(plan);
|
|
109
|
+
},
|
|
110
|
+
connection() {
|
|
111
|
+
return getRuntime().connection();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}));
|
|
115
|
+
function prepare(declaration, callback) {
|
|
116
|
+
return prepareQuery(getRuntime(), declaration, callback);
|
|
117
|
+
}
|
|
100
118
|
return {
|
|
101
119
|
sql: sql$1,
|
|
102
|
-
orm:
|
|
103
|
-
context,
|
|
104
|
-
runtime: {
|
|
105
|
-
query(plan) {
|
|
106
|
-
return getRuntime().query(plan);
|
|
107
|
-
},
|
|
108
|
-
execute(plan) {
|
|
109
|
-
return getRuntime().execute(plan);
|
|
110
|
-
},
|
|
111
|
-
connection() {
|
|
112
|
-
return getRuntime().connection();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
})),
|
|
120
|
+
orm: orm$1,
|
|
116
121
|
enums,
|
|
117
122
|
raw: rawSqlTag,
|
|
118
123
|
context,
|
|
@@ -132,9 +137,7 @@ function sqlite(options) {
|
|
|
132
137
|
runtime() {
|
|
133
138
|
return getRuntime();
|
|
134
139
|
},
|
|
135
|
-
prepare
|
|
136
|
-
return getRuntime().prepare(declaration, (params) => callback(sql$1, params));
|
|
137
|
-
},
|
|
140
|
+
prepare,
|
|
138
141
|
transaction(fn) {
|
|
139
142
|
let runtime;
|
|
140
143
|
try {
|
package/dist/runtime.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-extensions/sqlite/dist/runtime.mjs"],"sourcesContent":["import { t as buildSqliteStaticContext } from \"./sqlite-static-BRccXxAU.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport sqliteAdapter from \"@internal/adapter-sqlite/runtime\";\nimport sqliteDriver from \"@internal/driver-sqlite/runtime\";\nimport { instantiateExecutionStack } from \"@internal/framework-components/execution\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { sql } from \"@internal/sql-builder/runtime\";\nimport { orm } from \"@internal/sql-orm-client\";\nimport { SqlRuntimeBase, createExecutionContext, createSqlExecutionStack, withTransaction } from \"@internal/sql-runtime\";\nimport sqliteTarget, { SqliteContractSerializer } from \"@internal/target-sqlite/runtime\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { blindCast, castAs } 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 unboundOrm(orm) {\n\tconst value = orm[UNBOUND_NAMESPACE_ID];\n\tassertDefined(value, \"the unbound namespace always exists on a sqlite builder output\");\n\treturn blindCast(value);\n}\nfunction resolveContract(options) {\n\tconst serializer = new SqliteContractSerializer();\n\tif (\"contractJson\" in options && options.contractJson !== void 0) return serializer.deserializeContract(options.contractJson);\n\tconst contract = options.contract;\n\treturn serializer.deserializeContract(serializer.serializeContract(contract));\n}\nfunction sqlite(options) {\n\tconst contract = resolveContract(options);\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: sql$1, raw: rawSqlTag, enums } = buildSqliteStaticContext(context, stack.adapter.rawCodecInferer);\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 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 sqliteError(\"DRIVER.NOT_CONNECTED\", \"SQLite client is closed\", { meta: { extension: \"sqlite\" } });\n\t\tif (backgroundConnectError !== void 0) throw backgroundConnectError;\n\t\tif (runtimeInstance) return runtimeInstance;\n\t\tconst stackInstance = instantiateExecutionStack(stack);\n\t\tconst driverDescriptor = stack.driver;\n\t\tif (!driverDescriptor) throw new InternalError(\"Driver descriptor missing from execution stack\");\n\t\tconst driver = driverDescriptor.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: stackInstance.adapter,\n\t\t\tdriver,\n\t\t\t...ifDefined(\"verifyMarker\", options.verifyMarker),\n\t\t\t...ifDefined(\"middleware\", options.middleware)\n\t\t});\n\t\treturn runtimeInstance;\n\t};\n\treturn {\n\t\tsql: sql$1,\n\t\torm: unboundOrm(orm({\n\t\t\tcontext,\n\t\t\truntime: {\n\t\t\t\tquery(plan) {\n\t\t\t\t\treturn getRuntime().query(plan);\n\t\t\t\t},\n\t\t\t\texecute(plan) {\n\t\t\t\t\treturn getRuntime().execute(plan);\n\t\t\t\t},\n\t\t\t\tconnection() {\n\t\t\t\t\treturn getRuntime().connection();\n\t\t\t\t}\n\t\t\t}\n\t\t})),\n\t\tenums,\n\t\traw: rawSqlTag,\n\t\tcontext,\n\t\tcontract,\n\t\tstack,\n\t\tasync connect(bindingInput) {\n\t\t\tif (closed) throw sqliteError(\"DRIVER.NOT_CONNECTED\", \"SQLite client is closed\", { meta: { extension: \"sqlite\" } });\n\t\t\tif (driverConnected || connectPromise) throw sqliteError(\"DRIVER.ALREADY_CONNECTED\", \"SQLite client already connected\", { meta: { extension: \"sqlite\" } });\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\treturn runtime;\n\t\t},\n\t\truntime() {\n\t\t\treturn getRuntime();\n\t\t},\n\t\tprepare(declaration, callback) {\n\t\t\treturn getRuntime().prepare(declaration, (params) => callback(sql$1, params));\n\t\t},\n\t\ttransaction(fn) {\n\t\t\tlet runtime;\n\t\t\ttry {\n\t\t\t\truntime = getRuntime();\n\t\t\t} catch (err) {\n\t\t\t\treturn Promise.reject(err);\n\t\t\t}\n\t\t\treturn withTransaction(runtime, (txCtx) => {\n\t\t\t\tconst rawCodecInferer = stack.adapter.rawCodecInferer;\n\t\t\t\tconst txSqlNamespace = sql({\n\t\t\t\t\tcontext,\n\t\t\t\t\trawCodecInferer\n\t\t\t\t})[UNBOUND_NAMESPACE_ID];\n\t\t\t\tassertDefined(txSqlNamespace, \"the unbound namespace always exists on a sqlite builder output\");\n\t\t\t\tconst txSql = blindCast(txSqlNamespace);\n\t\t\t\tconst txOrm = unboundOrm(orm({\n\t\t\t\t\truntime: {\n\t\t\t\t\t\tquery(plan) {\n\t\t\t\t\t\t\treturn txCtx.query(plan);\n\t\t\t\t\t\t},\n\t\t\t\t\t\texecute(plan) {\n\t\t\t\t\t\t\treturn txCtx.execute(plan);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcontext\n\t\t\t\t}));\n\t\t\t\treturn fn(Object.assign(castAs(Object.create(txCtx)), {\n\t\t\t\t\tsql: txSql,\n\t\t\t\t\torm: txOrm,\n\t\t\t\t\tenums\n\t\t\t\t}));\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":";;;;;;;;;;;;;;;AAeA,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,WAAW,KAAK;CACxB,MAAM,QAAQ,IAAI;CAClB,cAAc,OAAO,gEAAgE;CACrF,OAAO,UAAU,KAAK;AACvB;AACA,SAAS,gBAAgB,SAAS;CACjC,MAAM,aAAa,IAAI,yBAAyB;CAChD,IAAI,kBAAkB,WAAW,QAAQ,iBAAiB,KAAK,GAAG,OAAO,WAAW,oBAAoB,QAAQ,YAAY;CAC5H,MAAM,WAAW,QAAQ;CACzB,OAAO,WAAW,oBAAoB,WAAW,kBAAkB,QAAQ,CAAC;AAC7E;AACA,SAAS,OAAO,SAAS;CACxB,MAAM,WAAW,gBAAgB,OAAO;CACxC,IAAI,UAAU,6BAA6B,OAAO;CAClD,MAAM,QAAQ,wBAAwB;EACrC,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,YAA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S;MACR,MAAM,MAAM;OACX,OAAO,MAAM,MAAM,IAAI;MACxB;MACA,QAAQ,MAAM;OACb,OAAO,MAAM,QAAQ,IAAI;MAC1B;KACD;KACA;IACD,CAAC,CAAC;IACF,OAAO,GAAG,OAAO,OAAO,OAAO,OAAO,OAAO,KAAK,CAAC,GAAG;KACrD,KAAK;KACL,KAAK;KACL;IACD,CAAC,CAAC;GACH,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-extensions/sqlite/dist/runtime.mjs"],"sourcesContent":["import { t as buildSqliteStaticContext } from \"./sqlite-static-BRccXxAU.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport sqliteAdapter from \"@internal/adapter-sqlite/runtime\";\nimport sqliteDriver from \"@internal/driver-sqlite/runtime\";\nimport { instantiateExecutionStack } from \"@internal/framework-components/execution\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { sql } from \"@internal/sql-builder/runtime\";\nimport { orm, prepareQuery } from \"@internal/sql-orm-client\";\nimport { SqlRuntimeBase, createExecutionContext, createSqlExecutionStack, withTransaction } from \"@internal/sql-runtime\";\nimport sqliteTarget, { SqliteContractSerializer } from \"@internal/target-sqlite/runtime\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { blindCast, castAs } 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 unboundOrm(orm) {\n\tconst value = orm[UNBOUND_NAMESPACE_ID];\n\tassertDefined(value, \"the unbound namespace always exists on a sqlite builder output\");\n\treturn blindCast(value);\n}\nfunction resolveContract(options) {\n\tconst serializer = new SqliteContractSerializer();\n\tif (\"contractJson\" in options && options.contractJson !== void 0) return blindCast(serializer.deserializeContract(options.contractJson));\n\tconst contract = options.contract;\n\tassertDefined(contract, \"a contract or contractJson is required\");\n\treturn blindCast(serializer.deserializeContract(serializer.serializeContract(contract)));\n}\nfunction sqlite(options) {\n\tconst contract = resolveContract(options);\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: sql$1, raw: rawSqlTag, enums } = buildSqliteStaticContext(context, stack.adapter.rawCodecInferer);\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 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 sqliteError(\"DRIVER.NOT_CONNECTED\", \"SQLite client is closed\", { meta: { extension: \"sqlite\" } });\n\t\tif (backgroundConnectError !== void 0) throw backgroundConnectError;\n\t\tif (runtimeInstance) return runtimeInstance;\n\t\tconst stackInstance = instantiateExecutionStack(stack);\n\t\tconst driverDescriptor = stack.driver;\n\t\tif (!driverDescriptor) throw new InternalError(\"Driver descriptor missing from execution stack\");\n\t\tconst driver = driverDescriptor.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: stackInstance.adapter,\n\t\t\tdriver,\n\t\t\t...ifDefined(\"verifyMarker\", options.verifyMarker),\n\t\t\t...ifDefined(\"middleware\", options.middleware)\n\t\t});\n\t\treturn runtimeInstance;\n\t};\n\tconst orm$1 = unboundOrm(orm({\n\t\tcontext,\n\t\truntime: {\n\t\t\tquery(plan) {\n\t\t\t\treturn getRuntime().query(plan);\n\t\t\t},\n\t\t\texecute(plan) {\n\t\t\t\treturn getRuntime().execute(plan);\n\t\t\t},\n\t\t\tconnection() {\n\t\t\t\treturn getRuntime().connection();\n\t\t\t}\n\t\t}\n\t}));\n\tfunction prepare(declaration, callback) {\n\t\treturn prepareQuery(getRuntime(), declaration, callback);\n\t}\n\treturn {\n\t\tsql: sql$1,\n\t\torm: orm$1,\n\t\tenums,\n\t\traw: rawSqlTag,\n\t\tcontext,\n\t\tcontract,\n\t\tstack,\n\t\tasync connect(bindingInput) {\n\t\t\tif (closed) throw sqliteError(\"DRIVER.NOT_CONNECTED\", \"SQLite client is closed\", { meta: { extension: \"sqlite\" } });\n\t\t\tif (driverConnected || connectPromise) throw sqliteError(\"DRIVER.ALREADY_CONNECTED\", \"SQLite client already connected\", { meta: { extension: \"sqlite\" } });\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\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\tlet runtime;\n\t\t\ttry {\n\t\t\t\truntime = getRuntime();\n\t\t\t} catch (err) {\n\t\t\t\treturn Promise.reject(err);\n\t\t\t}\n\t\t\treturn withTransaction(runtime, (txCtx) => {\n\t\t\t\tconst rawCodecInferer = stack.adapter.rawCodecInferer;\n\t\t\t\tconst txSqlNamespace = sql({\n\t\t\t\t\tcontext,\n\t\t\t\t\trawCodecInferer\n\t\t\t\t})[UNBOUND_NAMESPACE_ID];\n\t\t\t\tassertDefined(txSqlNamespace, \"the unbound namespace always exists on a sqlite builder output\");\n\t\t\t\tconst txSql = blindCast(txSqlNamespace);\n\t\t\t\tconst txOrm = unboundOrm(orm({\n\t\t\t\t\truntime: {\n\t\t\t\t\t\tquery(plan) {\n\t\t\t\t\t\t\treturn txCtx.query(plan);\n\t\t\t\t\t\t},\n\t\t\t\t\t\texecute(plan) {\n\t\t\t\t\t\t\treturn txCtx.execute(plan);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcontext\n\t\t\t\t}));\n\t\t\t\treturn fn(Object.assign(castAs(Object.create(txCtx)), {\n\t\t\t\t\tsql: txSql,\n\t\t\t\t\torm: txOrm,\n\t\t\t\t\tenums\n\t\t\t\t}));\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":";;;;;;;;;;;;;;;AAeA,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,WAAW,KAAK;CACxB,MAAM,QAAQ,IAAI;CAClB,cAAc,OAAO,gEAAgE;CACrF,OAAO,UAAU,KAAK;AACvB;AACA,SAAS,gBAAgB,SAAS;CACjC,MAAM,aAAa,IAAI,yBAAyB;CAChD,IAAI,kBAAkB,WAAW,QAAQ,iBAAiB,KAAK,GAAG,OAAO,UAAU,WAAW,oBAAoB,QAAQ,YAAY,CAAC;CACvI,MAAM,WAAW,QAAQ;CACzB,cAAc,UAAU,wCAAwC;CAChE,OAAO,UAAU,WAAW,oBAAoB,WAAW,kBAAkB,QAAQ,CAAC,CAAC;AACxF;AACA,SAAS,OAAO,SAAS;CACxB,MAAM,WAAW,gBAAgB,OAAO;CACxC,IAAI,UAAU,6BAA6B,OAAO;CAClD,MAAM,QAAQ,wBAAwB;EACrC,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,YAAY,QAAQ,cAAc,CAAC;CACpC,CAAC;CACD,MAAM,UAAU,uBAAuB;EACtC;EACA;EACA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,OAAO,MAAM,QAAQ,IAAI;MAC1B;KACD;KACA;IACD,CAAC,CAAC;IACF,OAAO,GAAG,OAAO,OAAO,OAAO,OAAO,OAAO,KAAK,CAAC,GAAG;KACrD,KAAK;KACL,KAAK;KACL;IACD,CAAC,CAAC;GACH,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,13 +1,13 @@
|
|
|
1
1
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
2
|
-
import { BindSiteParams, Declaration, ExecutionContext, ParamsFromDeclaration,
|
|
2
|
+
import { BindSiteParams, Declaration, ExecutionContext, ParamsFromDeclaration, Runtime, SqlExecutionStackWithDriver, SqlMiddleware, SqlRuntimeExtensionDescriptor, TransactionContext, VerifyMarkerOption } from "@prisma/orm-family-sql/runtime";
|
|
3
3
|
import { NamespacedEnums } from "@prisma/orm-framework/contract/enum-accessor";
|
|
4
|
-
import { orm } from "@prisma/orm-family-sql/orm-client";
|
|
4
|
+
import { PreparedFrom, orm } from "@prisma/orm-family-sql/orm-client";
|
|
5
5
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
6
6
|
import { ExtractCodecTypes, SqlStorage } from "@prisma/orm-family-sql/contract/types";
|
|
7
7
|
import { Db, RawLane } from "@prisma/orm-family-sql/builder/types";
|
|
8
8
|
import { CodecTypesBase } from "@prisma/orm-family-sql/relational-core/expression";
|
|
9
|
-
import { SqlQueryPlan } from "@prisma/orm-family-sql/relational-core/plan";
|
|
10
|
-
//#region ../../../3-extensions/sqlite/dist/sqlite-
|
|
9
|
+
import { Preparable, SqlQueryPlan } from "@prisma/orm-family-sql/relational-core/plan";
|
|
10
|
+
//#region ../../../3-extensions/sqlite/dist/sqlite-VTg9YLdO.d.mts
|
|
11
11
|
//#region src/static/sqlite-static.d.ts
|
|
12
12
|
type UnboundSql$1<TContract extends Contract<SqlStorage>> = Db<TContract>[typeof UNBOUND_NAMESPACE_ID];
|
|
13
13
|
type UnboundEnums<TContract extends Contract<SqlStorage>> = NamespacedEnums<TContract>[typeof UNBOUND_NAMESPACE_ID];
|
|
@@ -45,7 +45,7 @@ interface SqliteClient<TContract extends Contract<SqlStorage>> {
|
|
|
45
45
|
readonly path: string;
|
|
46
46
|
}): Promise<Runtime>;
|
|
47
47
|
runtime(): Runtime;
|
|
48
|
-
prepare<D extends Declaration<CT>,
|
|
48
|
+
prepare<D extends Declaration<CT>, Q extends SqlQueryPlan | Preparable<unknown, unknown>, CT extends CodecTypesBase = ExtractCodecTypes<TContract>>(declaration: D, callback: (params: BindSiteParams<D>) => Q): Promise<PreparedFrom<ParamsFromDeclaration<D, CT>, Q>>;
|
|
49
49
|
transaction<R>(fn: (tx: SqliteTransactionContext<TContract>) => PromiseLike<R>): Promise<R>;
|
|
50
50
|
close(): Promise<void>;
|
|
51
51
|
[Symbol.asyncDispose](): Promise<void>;
|
|
@@ -73,4 +73,4 @@ declare function sqlite<TContract extends Contract<SqlStorage>>(options: SqliteO
|
|
|
73
73
|
declare function sqlite<TContract extends Contract<SqlStorage>>(options: SqliteOptionsWithContractJson<TContract>): SqliteClient<TContract>;
|
|
74
74
|
//#endregion
|
|
75
75
|
export { SqliteOptionsWithContractJson as a, sqlite as c, SqliteOptionsWithContract as i, sqliteStatic as l, SqliteOptions as n, SqliteStaticContext as o, SqliteOptionsBase as r, SqliteTargetId as s, SqliteClient as t };
|
|
76
|
-
//# sourceMappingURL=sqlite-
|
|
76
|
+
//# sourceMappingURL=sqlite-VTg9YLdO-DlPr4NSi.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-VTg9YLdO-DlPr4NSi.d.mts","names":[],"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WACO;WACA;;KAEN,cAAc,kBAAkB,SAAS,eAAe,0BAA0B,aAAa,8BAA8B;iBACjH,OAAO,kBAAkB,SAAS,aAAa,SAAS,0BAA0B,aAAa,aAAa;iBAC5G,OAAO,kBAAkB,SAAS,aAAa,SAAS,8BAA8B,aAAa,aAAa"}
|
package/dist/static.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { l as sqliteStatic, o as SqliteStaticContext } from "./sqlite-
|
|
1
|
+
import { l as sqliteStatic, o as SqliteStaticContext } from "./sqlite-VTg9YLdO-DlPr4NSi.mjs";
|
|
2
2
|
export { type SqliteStaticContext, 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.11-dev.
|
|
3
|
+
"version": "8.0.0-rc.11-dev.11",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"skills"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@prisma/orm-family-sql": "8.0.0-rc.11-dev.
|
|
14
|
-
"@prisma/orm-framework": "8.0.0-rc.11-dev.
|
|
15
|
-
"@prisma/orm-target-sqlite": "8.0.0-rc.11-dev.
|
|
16
|
-
"@prisma/orm-toolchain": "8.0.0-rc.11-dev.
|
|
13
|
+
"@prisma/orm-family-sql": "8.0.0-rc.11-dev.11",
|
|
14
|
+
"@prisma/orm-framework": "8.0.0-rc.11-dev.11",
|
|
15
|
+
"@prisma/orm-target-sqlite": "8.0.0-rc.11-dev.11",
|
|
16
|
+
"@prisma/orm-toolchain": "8.0.0-rc.11-dev.11",
|
|
17
17
|
"pathe": "^2.0.3"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@internal/sqlite": "8.0.0-rc.11-dev.
|
|
21
|
-
"@repo/tsconfig": "8.0.0-rc.11-dev.
|
|
22
|
-
"@repo/tsdown": "8.0.0-rc.11-dev.
|
|
20
|
+
"@internal/sqlite": "8.0.0-rc.11-dev.11",
|
|
21
|
+
"@repo/tsconfig": "8.0.0-rc.11-dev.11",
|
|
22
|
+
"@repo/tsdown": "8.0.0-rc.11-dev.11",
|
|
23
23
|
"tsdown": "0.22.14",
|
|
24
24
|
"typescript": "5.9.3"
|
|
25
25
|
},
|
package/skills/prisma-8/SKILL.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
---
|
|
2
2
|
from: 8.0.0-rc.11
|
|
3
3
|
to: 8.0.0-rc.12
|
|
4
|
-
changes:
|
|
4
|
+
changes:
|
|
5
|
+
- id: params-only-sql-facade-prepare
|
|
6
|
+
summary: Replace injected SQL-builder preparation callbacks with params-only callbacks and lexical facade SQL access.
|
|
5
7
|
---
|
|
8
|
+
|
|
9
|
+
## `params-only-sql-facade-prepare`
|
|
10
|
+
|
|
11
|
+
Find calls to `prepare(declaration, callback)` on clients created by the Postgres or SQLite facade (`@prisma/orm-postgres/runtime`, `@prisma/orm-sqlite/runtime`, or their `@internal/postgres/runtime` and `@internal/sqlite/runtime` counterparts). Resolve the receiver and callback rather than rewriting every method named `prepare`: native SQLite `database.prepare(sql)` and SQL runtime's existing params-only preparation are different APIs and must remain unchanged.
|
|
12
|
+
|
|
13
|
+
Change callbacks from `(sql, params) => ...` to `(params) => ...`. Replace references bound to the removed `sql` callback argument with the same facade receiver's lexical `.sql` property. Preserve the params argument's name, declaration, SQL chain, row selection, filters and invocation target/options. For extracted callbacks, capture the same client in the enclosing scope; do not capture an invocation target or evaluate the callback twice. Update explicit callback type annotations to accept only the placeholder-params argument.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// Before
|
|
17
|
+
const query = await db.prepare({ id: 'pg/int4@1' }, (sql, params) =>
|
|
18
|
+
sql.public.users.select('id').where((f, fns) => fns.eq(f.id, params.id)).build(),
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// After
|
|
22
|
+
const query = await db.prepare({ id: 'pg/int4@1' }, (params) =>
|
|
23
|
+
db.sql.public.users.select('id').where((f, fns) => fns.eq(f.id, params.id)).build(),
|
|
24
|
+
);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Apply the same translation to SQLite's flat SQL facade (`sql.users` becomes `db.sql.users`), retaining its existing codec ids. Keep `.query(target, params, options?)` and SQL statistics `.execute(target, params, options?)` calls unchanged. Do not rewrite historical release notes, applied upgrade recipes, generated contracts or tests as part of this source translation.
|
package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.11-to-8.0.0-rc.12/instructions.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
---
|
|
2
2
|
from: 8.0.0-rc.11
|
|
3
3
|
to: 8.0.0-rc.12
|
|
4
|
-
changes:
|
|
4
|
+
changes:
|
|
5
|
+
- id: expression-codec-on-return-type
|
|
6
|
+
summary: Move custom expression wrapper codec metadata to returnType.codec and remove the separate ExpressionImpl codec argument.
|
|
7
|
+
- id: shared-preparable-envelope
|
|
8
|
+
summary: Type ORM preparation descriptions with the shared compositional Preparable protocol and pass their contained plan to SQL runtime.
|
|
9
|
+
- id: params-only-sql-facade-prepare
|
|
10
|
+
summary: Replace injected SQL-builder preparation callbacks with params-only callbacks and lexical facade SQL access.
|
|
11
|
+
- id: preserve-prepared-reference-nullability
|
|
12
|
+
summary: Preserve declaration nullability when constructing or cloning PreparedParamRef AST nodes.
|
|
13
|
+
- id: preserve-orm-pagination-expressions
|
|
14
|
+
summary: Preserve expression-valued limit and offset when consuming ORM CollectionState.
|
|
5
15
|
---
|
|
16
|
+
|
|
17
|
+
## `expression-codec-on-return-type`
|
|
18
|
+
|
|
19
|
+
For custom SQL `Expression` wrappers, move an existing top-level `codec` reference into `returnType.codec`, preserving the complete reference including `typeParams`. Read metadata through `codecOf(expression)` or `expression.returnType.codec`, not `expression.codec`. Keep the existing `returnType.codecId` and nullability; wrappers without an explicit reference continue to use the declared codec id fallback. Do not remove or relocate unrelated codec fields on AST nodes, storage declarations, runtime bindings or scope descriptors.
|
|
20
|
+
|
|
21
|
+
For direct `ExpressionImpl` construction, change `new ExpressionImpl(ast, returnType, codec, projectionAst)` to `new ExpressionImpl(ast, { ...returnType, codec }, projectionAst)`. When the removed codec argument was `undefined`, keep `returnType` unchanged and move any fourth projection argument to the third position. Preserve projection-only lowering separately from predicate and ordering ASTs.
|
|
22
|
+
|
|
23
|
+
## `shared-preparable-envelope`
|
|
24
|
+
|
|
25
|
+
Replace imports of SQL ORM client's `RowQuery` with `Preparable` from `@internal/sql-relational-core/plan`. Supply both type arguments as `Preparable<DbRow, Result>` and return `{ plan, consume }`, where `plan` is a `SqlQueryPlan<DbRow>` and `consume` returns the complete ORM result. Read AST, parameters and metadata through `description.plan`; pass `description.plan` rather than the description to SQL runtime preparation. Keep the consumer's mapping setup outside invocation-time code.
|
|
26
|
+
|
|
27
|
+
For integrations accepting both SQL and ORM callbacks, constrain the callback result with `Q extends SqlQueryPlan | Preparable<unknown, unknown>` and use SQL ORM client's `prepareQuery` and `PreparedFrom<Params, Q>`. Preserve the concrete `Q` so SQL row/statistics types and ORM all/first result types remain distinct. Do not add identity consumers to plain SQL plans.
|
|
28
|
+
|
|
29
|
+
## `preserve-orm-pagination-expressions`
|
|
30
|
+
|
|
31
|
+
Update extension code that reads or mirrors ORM `CollectionState.limit` and `offset`: these fields now contain relational-core `LimitOffsetValue | undefined` (`number | AnyExpression | undefined`), not just numbers. Forward them unchanged to the existing `SelectAst.withLimit` and `withOffset` methods. If processing numeric literals separately, narrow with `typeof value === 'number'`; preserve expression nodes rather than coercing, serializing or boxing them as literal parameters. Test presence against `undefined`, not truthiness, so zero limits and offsets survive. Keep grouped post-aggregation paging's separate numeric state unchanged.
|
|
32
|
+
|
|
33
|
+
## `preserve-prepared-reference-nullability`
|
|
34
|
+
|
|
35
|
+
Find code that constructs or clones `PreparedParamRef` from SQL relational-core's AST exports. When constructing a reference from a nullable declaration, pass its declared boolean nullability as the third argument to `PreparedParamRef.of(name, codec, nullable)` or `new PreparedParamRef(name, codec, nullable)`. When cloning an existing reference, preserve `ref.nullable`: `PreparedParamRef.of(ref.name, ref.codec, ref.nullable)`. Keep the name and complete codec reference unchanged, and keep constructing frozen class instances rather than spreading nodes into plain objects. Do not derive this flag from a column's nullability or an invocation's bound value.
|
|
36
|
+
|
|
37
|
+
## `params-only-sql-facade-prepare`
|
|
38
|
+
|
|
39
|
+
Find calls to `prepare(declaration, callback)` on clients created by the Postgres or SQLite facade (`@prisma/orm-postgres/runtime`, `@prisma/orm-sqlite/runtime`, or their `@internal/postgres/runtime` and `@internal/sqlite/runtime` counterparts). Resolve the receiver and callback rather than rewriting every method named `prepare`: native SQLite `database.prepare(sql)` and SQL runtime's existing params-only preparation are different APIs and must remain unchanged.
|
|
40
|
+
|
|
41
|
+
Change callbacks from `(sql, params) => ...` to `(params) => ...`. Replace references bound to the removed `sql` callback argument with the same facade receiver's lexical `.sql` property. Preserve the params argument's name, declaration, SQL chain, row selection, filters and invocation target/options. For extracted callbacks, capture the same client in the enclosing scope; do not capture an invocation target or evaluate the callback twice. Update explicit callback type annotations to accept only the placeholder-params argument.
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
// Before
|
|
45
|
+
const query = await db.prepare({ id: 'pg/int4@1' }, (sql, params) =>
|
|
46
|
+
sql.public.users.select('id').where((f, fns) => fns.eq(f.id, params.id)).build(),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// After
|
|
50
|
+
const query = await db.prepare({ id: 'pg/int4@1' }, (params) =>
|
|
51
|
+
db.sql.public.users.select('id').where((f, fns) => fns.eq(f.id, params.id)).build(),
|
|
52
|
+
);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Apply the same translation to SQLite's flat SQL facade (`sql.users` becomes `db.sql.users`), retaining its existing codec ids. Keep `.query(target, params, options?)` and SQL statistics `.execute(target, params, options?)` calls unchanged. Do not rewrite historical release notes, applied upgrade recipes, generated contracts or tests as part of this source translation.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite-D2JUSooi-BCJK5urO.d.mts","names":[],"sources":["../../../../3-extensions/sqlite/dist/sqlite-D2JUSooi.d.mts"],"mappings":";;;;;;;;;;;KAUK,aAAa,kBAAkB,SAAS,eAAe,GAAG,kBAAkB;KAC5E,aAAa,kBAAkB,SAAS,eAAe,gBAAgB,kBAAkB;UACpF,oBAAoB,kBAAkB,SAAS;WAC9C,SAAS,iBAAiB;WAC1B,UAAU;WACV,OAAO,aAAa;WACpB,KAAK,aAAa;WAClB,KAAK,QAAQ;;iBAEP,aAAa,kBAAkB,SAAS,aAAa;WAC3D;WACA,sBAAsB,8BAA8B;IAC3D,oBAAoB;;;KAGnB;KACA,UAAU,kBAAkB,SAAS,eAAe,kBAAkB,IAAI;KAC1E,WAAW,kBAAkB,SAAS,eAAe,GAAG,kBAAkB;KAC1E,WAAW,kBAAkB,SAAS,eAAe,UAAU,kBAAkB;UAC5E,yBAAyB,kBAAkB,SAAS,qBAAqB;WACxE,KAAK,WAAW;WAChB,KAAK,WAAW;WAChB,OAAO,oBAAoB;;UAE5B,aAAa,kBAAkB,SAAS;WACvC,KAAK,WAAW;WAChB,KAAK,WAAW;WAChB,OAAO,oBAAoB;WAC3B,KAAK,QAAQ;WACb,SAAS,iBAAiB;WAC1B,UAAU;WACV,OAAO,4BAA4B;EAC5C,QAAQ;aACG;MACP,QAAQ;EACZ,WAAW;EACX,QAAQ,UAAU,YAAY,KAAK,KAAK,WAAW,iBAAiB,kBAAkB,YAAY,aAAa,GAAG,WAAW,KAAK,WAAW,YAAY,QAAQ,eAAe,OAAO,aAAa,OAAO,QAAQ,YAAY,sBAAsB,GAAG,KAAK;EAC7P,YAAY,GAAG,KAAK,IAAI,yBAAyB,eAAe,YAAY,KAAK,QAAQ;EACzF,SAAS;GACR,OAAO,iBAAiB;;UAEjB;WACC,s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