viborm 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/{adapter-namespace-DMhEF6my.mjs → adapter-namespace-DqkJQdrD.mjs} +2 -2
- package/dist/{adapter-namespace-DMhEF6my.mjs.map → adapter-namespace-DqkJQdrD.mjs.map} +1 -1
- package/dist/adapters.d.mts +1 -1
- package/dist/adapters.mjs +1 -1
- package/dist/{array-literal-D9FexFqy.mjs → array-literal-BsbbSLw3.mjs} +1 -1
- package/dist/{array-literal-D9FexFqy.mjs.map → array-literal-BsbbSLw3.mjs.map} +1 -1
- package/dist/base-AdXAoy6l.mjs +2 -0
- package/dist/base-AdXAoy6l.mjs.map +1 -0
- package/dist/batch-refs-4L8ECdPU.mjs +2 -0
- package/dist/batch-refs-4L8ECdPU.mjs.map +1 -0
- package/dist/bind-parameter-capacity-CjPgqnmx.mjs +2 -0
- package/dist/{bind-parameter-capacity-DzMcIB95.mjs.map → bind-parameter-capacity-CjPgqnmx.mjs.map} +1 -1
- package/dist/builder-Ycvq3ETg.mjs +2 -0
- package/dist/builder-Ycvq3ETg.mjs.map +1 -0
- package/dist/bun-sql.d.mts +19 -2
- package/dist/bun-sql.mjs +1 -1
- package/dist/bun-sql.mjs.map +1 -1
- package/dist/bun-sqlite.d.mts +9 -8
- package/dist/bun-sqlite.mjs +1 -1
- package/dist/bun-sqlite.mjs.map +1 -1
- package/dist/cache/cloudflare-kv.d.mts +1 -1
- package/dist/cache/cloudflare-kv.mjs +1 -1
- package/dist/cache/memory.d.mts +1 -1
- package/dist/cache/memory.mjs +1 -1
- package/dist/cache/memory.mjs.map +1 -1
- package/dist/cache-BO57X0TT.mjs +2 -0
- package/dist/cache-BO57X0TT.mjs.map +1 -0
- package/dist/cache.d.mts +1 -1
- package/dist/cache.mjs +1 -1
- package/dist/cache.mjs.map +1 -1
- package/dist/canonical-json-rfC2Dg0X.mjs +2 -0
- package/dist/canonical-json-rfC2Dg0X.mjs.map +1 -0
- package/dist/chain-Dh0FV72b.mjs +2 -0
- package/dist/chain-Dh0FV72b.mjs.map +1 -0
- package/dist/cli.mjs +5 -6
- package/dist/cli.mjs.map +1 -1
- package/dist/client-BLiBmykn.mjs +2 -0
- package/dist/client-BLiBmykn.mjs.map +1 -0
- package/dist/client-CCgfcp5A.mjs +52 -0
- package/dist/client-CCgfcp5A.mjs.map +1 -0
- package/dist/client-CRBo95D0.d.mts +610 -0
- package/dist/client.d.mts +1 -1
- package/dist/client.mjs +1 -1
- package/dist/{clock-W8H2Khng.mjs → clock-CK41KO7t.mjs} +1 -1
- package/dist/{clock-W8H2Khng.mjs.map → clock-CK41KO7t.mjs.map} +1 -1
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +1 -1
- package/dist/controls-DXgIn4zh.mjs +2 -0
- package/dist/controls-DXgIn4zh.mjs.map +1 -0
- package/dist/d1.d.mts +1 -1
- package/dist/d1.mjs +1 -1
- package/dist/d1.mjs.map +1 -1
- package/dist/datetime-physical-codec-oIhiYZEP.mjs +2 -0
- package/dist/datetime-physical-codec-oIhiYZEP.mjs.map +1 -0
- package/dist/driver-B19QlFqn.mjs +2 -0
- package/dist/{driver-CRaDT4B7.mjs.map → driver-B19QlFqn.mjs.map} +1 -1
- package/dist/driver-BlnKXPFF.mjs +2 -0
- package/dist/driver-BlnKXPFF.mjs.map +1 -0
- package/dist/driver.d.mts +2 -2
- package/dist/driver.mjs +1 -1
- package/dist/error-mapping-CnPCv1dm.mjs +2 -0
- package/dist/error-mapping-CnPCv1dm.mjs.map +1 -0
- package/dist/every-4KE0p2Gw.mjs +2 -0
- package/dist/every-4KE0p2Gw.mjs.map +1 -0
- package/dist/execution-context-BKR3bgES.mjs +2 -0
- package/dist/execution-context-BKR3bgES.mjs.map +1 -0
- package/dist/fs-estate-CAhDg7nY.mjs +2 -0
- package/dist/fs-estate-CAhDg7nY.mjs.map +1 -0
- package/dist/{geo-area-codec-B4DRInvA.mjs → geo-area-codec-1SY9im7O.mjs} +2 -2
- package/dist/{geo-area-codec-B4DRInvA.mjs.map → geo-area-codec-1SY9im7O.mjs.map} +1 -1
- package/dist/geo-point-codec-lhxH42SK.mjs +2 -0
- package/dist/geo-point-codec-lhxH42SK.mjs.map +1 -0
- package/dist/{hydration-D6JICBQG.mjs → hydration-CAxOL4aI.mjs} +2 -2
- package/dist/{hydration-D6JICBQG.mjs.map → hydration-CAxOL4aI.mjs.map} +1 -1
- package/dist/identifier-conversion-GgbwHc2G.mjs +2 -0
- package/dist/identifier-conversion-GgbwHc2G.mjs.map +1 -0
- package/dist/{identifier-EsWKVHXi.mjs → identifier-hQCs8M1n.mjs} +2 -2
- package/dist/{identifier-EsWKVHXi.mjs.map → identifier-hQCs8M1n.mjs.map} +1 -1
- package/dist/identity-CLFhCTZx.mjs +2 -0
- package/dist/identity-CLFhCTZx.mjs.map +1 -0
- package/dist/{index-T0YKKw66.d.mts → index-C_XLSTy2.d.mts} +723 -400
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/instrumentation.d.mts +1 -1
- package/dist/instrumentation.mjs +1 -1
- package/dist/instrumentation.mjs.map +1 -1
- package/dist/{invariant-DCsftyml.mjs → invariant-BnLYqsHO.mjs} +1 -1
- package/dist/{invariant-DCsftyml.mjs.map → invariant-BnLYqsHO.mjs.map} +1 -1
- package/dist/{json-number-C10HFiy6.mjs → json-number-CGXpPu4D.mjs} +1 -1
- package/dist/{json-number-C10HFiy6.mjs.map → json-number-CGXpPu4D.mjs.map} +1 -1
- package/dist/key-BeoOwGr3.mjs +2 -0
- package/dist/key-BeoOwGr3.mjs.map +1 -0
- package/dist/libsql-Bu_IdFU1.mjs +11 -0
- package/dist/libsql-Bu_IdFU1.mjs.map +1 -0
- package/dist/libsql.d.mts +8 -3
- package/dist/libsql.mjs +1 -1
- package/dist/libsql.mjs.map +1 -1
- package/dist/memory-D4yxtCPK.mjs +2 -0
- package/dist/memory-D4yxtCPK.mjs.map +1 -0
- package/dist/migrations/mysql.d.mts +6 -0
- package/dist/migrations/mysql.mjs +2 -0
- package/dist/migrations/mysql.mjs.map +1 -0
- package/dist/migrations/postgres.d.mts +6 -0
- package/dist/migrations/postgres.mjs +2 -0
- package/dist/migrations/postgres.mjs.map +1 -0
- package/dist/migrations/sqlite.d.mts +6 -0
- package/dist/migrations/sqlite.mjs +2 -0
- package/dist/migrations/sqlite.mjs.map +1 -0
- package/dist/migrations/storage/durable-object.d.mts +17 -0
- package/dist/migrations/storage/durable-object.mjs +2 -0
- package/dist/migrations/storage/durable-object.mjs.map +1 -0
- package/dist/migrations/storage/fs.d.mts +6 -1
- package/dist/migrations/storage/fs.mjs +1 -1
- package/dist/migrations/storage/r2.d.mts +14 -0
- package/dist/migrations/storage/r2.mjs +2 -0
- package/dist/migrations/storage/r2.mjs.map +1 -0
- package/dist/migrations/tenant.d.mts +92 -0
- package/dist/migrations/tenant.mjs +2 -0
- package/dist/migrations/tenant.mjs.map +1 -0
- package/dist/{migrations-BWZSBMZh.mjs → migrations-DTObIjAm.mjs} +2 -2
- package/dist/migrations-DTObIjAm.mjs.map +1 -0
- package/dist/migrations.d.mts +6 -559
- package/dist/migrations.mjs +1 -1
- package/dist/migrations.mjs.map +1 -1
- package/dist/mysql-CibPaHSp.mjs +99 -0
- package/dist/mysql-CibPaHSp.mjs.map +1 -0
- package/dist/mysql-adapter-DkJPfoGf.mjs +2 -0
- package/dist/mysql-adapter-DkJPfoGf.mjs.map +1 -0
- package/dist/mysql2.d.mts +1 -3
- package/dist/mysql2.mjs +1 -1
- package/dist/mysql2.mjs.map +1 -1
- package/dist/neon-http.d.mts +1 -1
- package/dist/neon-http.mjs +1 -1
- package/dist/neon-http.mjs.map +1 -1
- package/dist/object-store-DQR6bTBY.mjs +2 -0
- package/dist/object-store-DQR6bTBY.mjs.map +1 -0
- package/dist/object-store-DyYOCtmX.d.mts +156 -0
- package/dist/observation-DUSm7oXK.mjs +2 -0
- package/dist/observation-DUSm7oXK.mjs.map +1 -0
- package/dist/pg.d.mts +37 -12
- package/dist/pg.mjs +1 -1
- package/dist/pg.mjs.map +1 -1
- package/dist/pglite.d.mts +2 -1
- package/dist/pglite.mjs +1 -1
- package/dist/pglite.mjs.map +1 -1
- package/dist/physical-6V_LNU3L.mjs +2 -0
- package/dist/{physical-BkelResN.mjs.map → physical-6V_LNU3L.mjs.map} +1 -1
- package/dist/pinned-session-CLxj5M5e.mjs +2 -0
- package/dist/pinned-session-CLxj5M5e.mjs.map +1 -0
- package/dist/planetscale.d.mts +1 -1
- package/dist/planetscale.mjs +1 -1
- package/dist/planetscale.mjs.map +1 -1
- package/dist/{planner-B11VjIin.d.mts → planner-C6Lfsasx.d.mts} +57 -3
- package/dist/postgres-adapter-B3SQvcV1.mjs +2 -0
- package/dist/postgres-adapter-B3SQvcV1.mjs.map +1 -0
- package/dist/postgres-adapter-CQD2oGuD.mjs +2 -0
- package/dist/postgres-adapter-CQD2oGuD.mjs.map +1 -0
- package/dist/postgres-oqNW9xqo.mjs +415 -0
- package/dist/postgres-oqNW9xqo.mjs.map +1 -0
- package/dist/{postgres-result-Dc_iW3Hb.mjs → postgres-result-7F0DllQe.mjs} +2 -2
- package/dist/{postgres-result-Dc_iW3Hb.mjs.map → postgres-result-7F0DllQe.mjs.map} +1 -1
- package/dist/postgres.d.mts +11 -1
- package/dist/postgres.mjs +1 -1
- package/dist/postgres.mjs.map +1 -1
- package/dist/provider-limits-BHATED_m.mjs +2 -0
- package/dist/provider-limits-BHATED_m.mjs.map +1 -0
- package/dist/registration-preflight-DEjv050M.mjs +4 -0
- package/dist/registration-preflight-DEjv050M.mjs.map +1 -0
- package/dist/result-shape-CTNdNSW3.mjs +2 -0
- package/dist/result-shape-CTNdNSW3.mjs.map +1 -0
- package/dist/scalar-U0wD5bKy.mjs +2 -0
- package/dist/{scalar-BTktMqvO.mjs.map → scalar-U0wD5bKy.mjs.map} +1 -1
- package/dist/schema/json.d.mts +1 -1
- package/dist/schema/json.mjs +1 -1
- package/dist/schema/json.mjs.map +1 -1
- package/dist/schema-Cjem1-0f.mjs +2 -0
- package/dist/{schema-BFNcMdO6.mjs.map → schema-Cjem1-0f.mjs.map} +1 -1
- package/dist/schema-introspection-DEYGC2qg.mjs +6 -0
- package/dist/schema-introspection-DEYGC2qg.mjs.map +1 -0
- package/dist/schema.d.mts +1 -1
- package/dist/schema.mjs +1 -1
- package/dist/{select-assembly-BgqlrePH.mjs → select-assembly-f1UGoblh.mjs} +2 -2
- package/dist/select-assembly-f1UGoblh.mjs.map +1 -0
- package/dist/settle-B9Vg1FnP.mjs +2 -0
- package/dist/settle-B9Vg1FnP.mjs.map +1 -0
- package/dist/soft-delete.d.mts +1 -1
- package/dist/{sql--69HUgel.mjs → sql-Bp7jicEX.mjs} +1 -1
- package/dist/{sql--69HUgel.mjs.map → sql-Bp7jicEX.mjs.map} +1 -1
- package/dist/{sql-statement-tokens-CykxFmOJ.mjs → sql-statement-tokens-BBcoGmJb.mjs} +1 -1
- package/dist/{sql-statement-tokens-CykxFmOJ.mjs.map → sql-statement-tokens-BBcoGmJb.mjs.map} +1 -1
- package/dist/sql.d.mts +1 -1
- package/dist/sql.mjs +1 -1
- package/dist/sqlite-adapter-CW_3l6ea.mjs +2 -0
- package/dist/sqlite-adapter-CW_3l6ea.mjs.map +1 -0
- package/dist/sqlite-utils-DlgokMJN.mjs +2 -0
- package/dist/sqlite-utils-DlgokMJN.mjs.map +1 -0
- package/dist/sqlite3.d.mts +2 -8
- package/dist/sqlite3.mjs +1 -1
- package/dist/sqlite3.mjs.map +1 -1
- package/dist/standard-sql-Bk4RZPqJ.mjs +6 -0
- package/dist/standard-sql-Bk4RZPqJ.mjs.map +1 -0
- package/dist/{suppressed-failure-BPxfHTMc.mjs → suppressed-failure-BwULh-8h.mjs} +1 -1
- package/dist/{suppressed-failure-BPxfHTMc.mjs.map → suppressed-failure-BwULh-8h.mjs.map} +1 -1
- package/dist/{terminal-BbRi0CNZ.mjs → terminal-C8cq1WWX.mjs} +2 -2
- package/dist/{terminal-BbRi0CNZ.mjs.map → terminal-C8cq1WWX.mjs.map} +1 -1
- package/dist/{transaction-oskVwmsf.mjs → transaction-Bnl6ULTw.mjs} +2 -2
- package/dist/transaction-Bnl6ULTw.mjs.map +1 -0
- package/dist/{transaction-operation-BC7aua5V.mjs → transaction-operation-CKK3l_9x.mjs} +2 -2
- package/dist/transaction-operation-CKK3l_9x.mjs.map +1 -0
- package/dist/{utils-DfztpPvR.mjs → utils-CZNaOZR7.mjs} +4 -3
- package/dist/utils-CZNaOZR7.mjs.map +1 -0
- package/dist/v-D5Z06FKN.mjs +2 -0
- package/dist/v-D5Z06FKN.mjs.map +1 -0
- package/dist/validation-Dk9Q_-C7.mjs +2 -0
- package/dist/validation-Dk9Q_-C7.mjs.map +1 -0
- package/dist/validation-PF9-_nKd.mjs +2 -0
- package/dist/{validation-tgjL_9n8.mjs.map → validation-PF9-_nKd.mjs.map} +1 -1
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/dist/validator-X9-bwtRo.mjs +2 -0
- package/dist/{validator-DMlEScV3.mjs.map → validator-X9-bwtRo.mjs.map} +1 -1
- package/dist/value-guards-CK9guf2Z.mjs +2 -0
- package/dist/value-guards-CK9guf2Z.mjs.map +1 -0
- package/dist/version-JDaZht4U.mjs +2 -0
- package/dist/{version-Cr80LFvx.mjs.map → version-JDaZht4U.mjs.map} +1 -1
- package/package.json +75 -34
- package/dist/base-vfur-DaU.mjs +0 -2
- package/dist/base-vfur-DaU.mjs.map +0 -1
- package/dist/batch-refs-BY51FIXm.mjs +0 -6
- package/dist/batch-refs-BY51FIXm.mjs.map +0 -1
- package/dist/bind-parameter-capacity-DzMcIB95.mjs +0 -2
- package/dist/builder-bPfagDQV.mjs +0 -2
- package/dist/builder-bPfagDQV.mjs.map +0 -1
- package/dist/chain-uIFlkkXS.mjs +0 -2
- package/dist/chain-uIFlkkXS.mjs.map +0 -1
- package/dist/client-NleI4Nm-.mjs +0 -434
- package/dist/client-NleI4Nm-.mjs.map +0 -1
- package/dist/client-tjSMPjeZ.mjs +0 -2
- package/dist/client-tjSMPjeZ.mjs.map +0 -1
- package/dist/controls-BhxRnPYS.mjs +0 -2
- package/dist/controls-BhxRnPYS.mjs.map +0 -1
- package/dist/decimal-12NERGYZ.mjs +0 -3
- package/dist/decimal-12NERGYZ.mjs.map +0 -1
- package/dist/driver-CRaDT4B7.mjs +0 -2
- package/dist/driver-options-DxlB1tms.mjs +0 -2
- package/dist/driver-options-DxlB1tms.mjs.map +0 -1
- package/dist/driver-yCYqzIQg.mjs +0 -2
- package/dist/driver-yCYqzIQg.mjs.map +0 -1
- package/dist/error-mapping-BWzb-l02.mjs +0 -2
- package/dist/error-mapping-BWzb-l02.mjs.map +0 -1
- package/dist/execution-context-BPk0YLhd.mjs +0 -2
- package/dist/execution-context-BPk0YLhd.mjs.map +0 -1
- package/dist/fs-estate-3Bu_K9mk.d.mts +0 -7
- package/dist/fs-estate-BcjgY4iY.mjs +0 -2
- package/dist/fs-estate-BcjgY4iY.mjs.map +0 -1
- package/dist/geo-point-codec-DUTTtlav.mjs +0 -2
- package/dist/geo-point-codec-DUTTtlav.mjs.map +0 -1
- package/dist/identifiers-By-JRCb5.mjs +0 -2
- package/dist/identifiers-By-JRCb5.mjs.map +0 -1
- package/dist/key-DKaqPb8w.mjs +0 -2
- package/dist/key-DKaqPb8w.mjs.map +0 -1
- package/dist/migrations-BWZSBMZh.mjs.map +0 -1
- package/dist/mysql-adapter-D9FoHlWE.mjs +0 -2
- package/dist/mysql-adapter-D9FoHlWE.mjs.map +0 -1
- package/dist/observation-CLp8ylmL.mjs +0 -2
- package/dist/observation-CLp8ylmL.mjs.map +0 -1
- package/dist/physical-BkelResN.mjs +0 -2
- package/dist/pinned-session-Ca7C9yxY.mjs +0 -2
- package/dist/pinned-session-Ca7C9yxY.mjs.map +0 -1
- package/dist/postgres-adapter-T2Iko-vt.mjs +0 -2
- package/dist/postgres-adapter-T2Iko-vt.mjs.map +0 -1
- package/dist/registration-preflight-BrA3EWvq.mjs +0 -4
- package/dist/registration-preflight-BrA3EWvq.mjs.map +0 -1
- package/dist/result-shape-DKTu8yre.mjs +0 -2
- package/dist/result-shape-DKTu8yre.mjs.map +0 -1
- package/dist/scalar-BTktMqvO.mjs +0 -2
- package/dist/schema-BFNcMdO6.mjs +0 -2
- package/dist/schema-introspection-DsXPfCst.mjs +0 -6
- package/dist/schema-introspection-DsXPfCst.mjs.map +0 -1
- package/dist/select-assembly-BgqlrePH.mjs.map +0 -1
- package/dist/sqlite-adapter-HqO3GpAK.mjs +0 -2
- package/dist/sqlite-adapter-HqO3GpAK.mjs.map +0 -1
- package/dist/sqlite-utils-D26BFuJJ.mjs +0 -2
- package/dist/sqlite-utils-D26BFuJJ.mjs.map +0 -1
- package/dist/transaction-operation-BC7aua5V.mjs.map +0 -1
- package/dist/transaction-oskVwmsf.mjs.map +0 -1
- package/dist/transactions-gjmrWN5W.mjs +0 -2
- package/dist/transactions-gjmrWN5W.mjs.map +0 -1
- package/dist/utils-DfztpPvR.mjs.map +0 -1
- package/dist/v-B2WwtcRz.mjs +0 -2
- package/dist/v-B2WwtcRz.mjs.map +0 -1
- package/dist/validation-Du6j0Q38.mjs +0 -2
- package/dist/validation-Du6j0Q38.mjs.map +0 -1
- package/dist/validation-tgjL_9n8.mjs +0 -2
- package/dist/validator-DMlEScV3.mjs +0 -2
- package/dist/version-Cr80LFvx.mjs +0 -2
- /package/dist/{contract-BHUOUAZ-.d.mts → contract-CIIqgFyb.d.mts} +0 -0
- /package/dist/{sql--yhoVvRM.d.mts → sql-BvfwUKIh.d.mts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as sqlTag, n as Sql } from "./sql
|
|
1
|
+
import { c as sqlTag, n as Sql } from "./sql-BvfwUKIh.mjs";
|
|
2
2
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
3
|
|
|
4
4
|
//#region src/schema/scalars/native-types.d.ts
|
|
@@ -765,6 +765,7 @@ declare enum VibORMErrorCode {
|
|
|
765
765
|
MIGRATION_AMBIGUOUS_COMMIT = "V11020",
|
|
766
766
|
MIGRATION_UNSUPPORTED_PROVIDER = "V11021",
|
|
767
767
|
MIGRATION_CORRUPTION = "V11022",
|
|
768
|
+
MIGRATION_INVALID_INDEX = "V11023",
|
|
768
769
|
OPERATION_ALREADY_EXECUTED = "V12001",
|
|
769
770
|
OPERATION_EXECUTION_CONFLICT = "V12002",
|
|
770
771
|
OPERATION_CLIENT_MISMATCH = "V12003",
|
|
@@ -812,6 +813,12 @@ interface VibORMErrorMeta {
|
|
|
812
813
|
/** Additional context */
|
|
813
814
|
[key: string]: unknown;
|
|
814
815
|
}
|
|
816
|
+
/** The options every VibORM error constructor forwards to {@link VibORMError}. */
|
|
817
|
+
interface VibORMErrorOptions {
|
|
818
|
+
cause?: Error | undefined;
|
|
819
|
+
diagnostics?: DiagnosticDisclosure | undefined;
|
|
820
|
+
meta?: VibORMErrorMeta | undefined;
|
|
821
|
+
}
|
|
815
822
|
/**
|
|
816
823
|
* Base error class for all VibORM errors
|
|
817
824
|
*/
|
|
@@ -826,10 +833,7 @@ declare class VibORMError extends Error {
|
|
|
826
833
|
readonly meta: VibORMErrorMeta;
|
|
827
834
|
/** Timestamp when error occurred */
|
|
828
835
|
readonly timestamp: Date;
|
|
829
|
-
constructor(message: string, code: VibORMErrorCode, options?: {
|
|
830
|
-
cause?: Error | undefined;
|
|
831
|
-
meta?: VibORMErrorMeta | undefined;
|
|
832
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
836
|
+
constructor(message: string, code: VibORMErrorCode, options?: VibORMErrorOptions & {
|
|
833
837
|
/** Internal validation boundary evidence, snapshotted with the error. */
|
|
834
838
|
validation?: {
|
|
835
839
|
source: unknown;
|
|
@@ -923,15 +927,7 @@ declare class UniqueConstraintError extends VibORMError {
|
|
|
923
927
|
static readonly diagnosticName = "UniqueConstraintError";
|
|
924
928
|
/** Literal discriminant: this class always carries `UNIQUE_CONSTRAINT`. */
|
|
925
929
|
readonly code: typeof VibORMErrorCode.UNIQUE_CONSTRAINT;
|
|
926
|
-
constructor(message: string, options?:
|
|
927
|
-
cause?: Error | undefined;
|
|
928
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
929
|
-
meta?: VibORMErrorMeta & {
|
|
930
|
-
constraint?: string;
|
|
931
|
-
table?: string;
|
|
932
|
-
columns?: string[];
|
|
933
|
-
};
|
|
934
|
-
});
|
|
930
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
935
931
|
}
|
|
936
932
|
/**
|
|
937
933
|
* Foreign key constraint violation
|
|
@@ -940,13 +936,7 @@ declare class ForeignKeyError extends VibORMError {
|
|
|
940
936
|
static readonly diagnosticName = "ForeignKeyError";
|
|
941
937
|
/** Literal discriminant: this class always carries `FOREIGN_KEY_CONSTRAINT`. */
|
|
942
938
|
readonly code: typeof VibORMErrorCode.FOREIGN_KEY_CONSTRAINT;
|
|
943
|
-
constructor(message: string, options?:
|
|
944
|
-
cause?: Error | undefined;
|
|
945
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
946
|
-
meta?: VibORMErrorMeta & {
|
|
947
|
-
constraint?: string;
|
|
948
|
-
};
|
|
949
|
-
});
|
|
939
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
950
940
|
}
|
|
951
941
|
/**
|
|
952
942
|
* Not-null constraint violation
|
|
@@ -955,14 +945,7 @@ declare class NotNullConstraintError extends VibORMError {
|
|
|
955
945
|
static readonly diagnosticName = "NotNullConstraintError";
|
|
956
946
|
/** Literal discriminant: this class always carries `NOT_NULL_CONSTRAINT`. */
|
|
957
947
|
readonly code: typeof VibORMErrorCode.NOT_NULL_CONSTRAINT;
|
|
958
|
-
constructor(message: string, options?:
|
|
959
|
-
cause?: Error | undefined;
|
|
960
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
961
|
-
meta?: VibORMErrorMeta & {
|
|
962
|
-
table?: string;
|
|
963
|
-
columns?: string[];
|
|
964
|
-
};
|
|
965
|
-
});
|
|
948
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
966
949
|
}
|
|
967
950
|
/**
|
|
968
951
|
* Check constraint violation
|
|
@@ -971,13 +954,7 @@ declare class CheckConstraintError extends VibORMError {
|
|
|
971
954
|
static readonly diagnosticName = "CheckConstraintError";
|
|
972
955
|
/** Literal discriminant: this class always carries `CHECK_CONSTRAINT`. */
|
|
973
956
|
readonly code: typeof VibORMErrorCode.CHECK_CONSTRAINT;
|
|
974
|
-
constructor(message: string, options?:
|
|
975
|
-
cause?: Error | undefined;
|
|
976
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
977
|
-
meta?: VibORMErrorMeta & {
|
|
978
|
-
constraint?: string;
|
|
979
|
-
};
|
|
980
|
-
});
|
|
957
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
981
958
|
}
|
|
982
959
|
/**
|
|
983
960
|
* Value too long for the column's declared type (Prisma P2000)
|
|
@@ -997,14 +974,7 @@ declare class ValueTooLongError extends VibORMError {
|
|
|
997
974
|
static readonly diagnosticName = "ValueTooLongError";
|
|
998
975
|
/** Literal discriminant: this class always carries `VALUE_TOO_LONG`. */
|
|
999
976
|
readonly code: typeof VibORMErrorCode.VALUE_TOO_LONG;
|
|
1000
|
-
constructor(message: string, options?:
|
|
1001
|
-
cause?: Error | undefined;
|
|
1002
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1003
|
-
meta?: VibORMErrorMeta & {
|
|
1004
|
-
table?: string;
|
|
1005
|
-
columns?: string[];
|
|
1006
|
-
};
|
|
1007
|
-
});
|
|
977
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
1008
978
|
}
|
|
1009
979
|
/**
|
|
1010
980
|
* Type guard for unique constraint errors
|
|
@@ -1050,6 +1020,13 @@ interface MigrationErrorMeta extends VibORMErrorMeta {
|
|
|
1050
1020
|
stateId?: string;
|
|
1051
1021
|
/** Push plan digest involved in the refusal */
|
|
1052
1022
|
planHash?: string;
|
|
1023
|
+
/** Origin state of the edge (absent for the empty root) */
|
|
1024
|
+
fromState?: string;
|
|
1025
|
+
/** Destination state of the edge */
|
|
1026
|
+
toState?: string;
|
|
1027
|
+
/** Operation and dispatch the failure names */
|
|
1028
|
+
operationId?: string;
|
|
1029
|
+
dispatchId?: string;
|
|
1053
1030
|
/** Honest effect classification after a non-transactional failure */
|
|
1054
1031
|
effectState?: "none" | "committed" | "partial" | "may-have-committed";
|
|
1055
1032
|
/** True when some provider work may already have committed */
|
|
@@ -1064,7 +1041,7 @@ interface MigrationErrorMeta extends VibORMErrorMeta {
|
|
|
1064
1041
|
* `DRIVER_NOT_SUPPORTED` (`drivers/index.ts`) and `INTERNAL_ERROR` (unreachable operation
|
|
1065
1042
|
* kinds). A code outside this union is a compile error at the construction site.
|
|
1066
1043
|
*/
|
|
1067
|
-
type MigrationErrorCode = typeof VibORMErrorCode.MIGRATION_FAILED | typeof VibORMErrorCode.MIGRATION_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_CHECKSUM_MISMATCH | typeof VibORMErrorCode.MIGRATION_DIALECT_MISMATCH | typeof VibORMErrorCode.MIGRATION_LOCK_FAILED | typeof VibORMErrorCode.MIGRATION_ALREADY_APPLIED | typeof VibORMErrorCode.MIGRATION_OUT_OF_ORDER | typeof VibORMErrorCode.MIGRATION_FILE_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_INVALID_STATE | typeof VibORMErrorCode.MIGRATION_DESTRUCTIVE_REJECTED | typeof VibORMErrorCode.MIGRATION_STORAGE_REQUIRED | typeof VibORMErrorCode.MIGRATION_INVALID_ESTATE | typeof VibORMErrorCode.MIGRATION_PATH_REQUIRED | typeof VibORMErrorCode.MIGRATION_DRIFT | typeof VibORMErrorCode.MIGRATION_MARKER_CONFLICT | typeof VibORMErrorCode.MIGRATION_UNFINISHED_ATTEMPT | typeof VibORMErrorCode.MIGRATION_CONSENT_REQUIRED | typeof VibORMErrorCode.MIGRATION_CONSENT_MISMATCH | typeof VibORMErrorCode.MIGRATION_PARTIAL_EFFECT | typeof VibORMErrorCode.MIGRATION_AMBIGUOUS_COMMIT | typeof VibORMErrorCode.MIGRATION_UNSUPPORTED_PROVIDER | typeof VibORMErrorCode.MIGRATION_CORRUPTION | typeof VibORMErrorCode.INVALID_INPUT | typeof VibORMErrorCode.FEATURE_NOT_SUPPORTED | typeof VibORMErrorCode.DRIVER_NOT_SUPPORTED | typeof VibORMErrorCode.INTERNAL_ERROR;
|
|
1044
|
+
type MigrationErrorCode = typeof VibORMErrorCode.MIGRATION_FAILED | typeof VibORMErrorCode.MIGRATION_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_CHECKSUM_MISMATCH | typeof VibORMErrorCode.MIGRATION_DIALECT_MISMATCH | typeof VibORMErrorCode.MIGRATION_LOCK_FAILED | typeof VibORMErrorCode.MIGRATION_ALREADY_APPLIED | typeof VibORMErrorCode.MIGRATION_OUT_OF_ORDER | typeof VibORMErrorCode.MIGRATION_FILE_NOT_FOUND | typeof VibORMErrorCode.MIGRATION_INVALID_STATE | typeof VibORMErrorCode.MIGRATION_DESTRUCTIVE_REJECTED | typeof VibORMErrorCode.MIGRATION_STORAGE_REQUIRED | typeof VibORMErrorCode.MIGRATION_INVALID_ESTATE | typeof VibORMErrorCode.MIGRATION_PATH_REQUIRED | typeof VibORMErrorCode.MIGRATION_DRIFT | typeof VibORMErrorCode.MIGRATION_MARKER_CONFLICT | typeof VibORMErrorCode.MIGRATION_UNFINISHED_ATTEMPT | typeof VibORMErrorCode.MIGRATION_CONSENT_REQUIRED | typeof VibORMErrorCode.MIGRATION_CONSENT_MISMATCH | typeof VibORMErrorCode.MIGRATION_PARTIAL_EFFECT | typeof VibORMErrorCode.MIGRATION_AMBIGUOUS_COMMIT | typeof VibORMErrorCode.MIGRATION_UNSUPPORTED_PROVIDER | typeof VibORMErrorCode.MIGRATION_CORRUPTION | typeof VibORMErrorCode.MIGRATION_INVALID_INDEX | typeof VibORMErrorCode.INVALID_INPUT | typeof VibORMErrorCode.FEATURE_NOT_SUPPORTED | typeof VibORMErrorCode.DRIVER_NOT_SUPPORTED | typeof VibORMErrorCode.INTERNAL_ERROR;
|
|
1068
1045
|
/**
|
|
1069
1046
|
* Migration-related errors
|
|
1070
1047
|
*/
|
|
@@ -1095,10 +1072,7 @@ declare class ConnectionError extends VibORMError {
|
|
|
1095
1072
|
static readonly diagnosticName = "ConnectionError";
|
|
1096
1073
|
/** Discriminant: one of {@link ConnectionErrorCode}, never a code outside the family. */
|
|
1097
1074
|
readonly code: ConnectionErrorCode;
|
|
1098
|
-
constructor(message: string, options?: {
|
|
1099
|
-
cause?: Error | undefined;
|
|
1100
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1101
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1075
|
+
constructor(message: string, options?: VibORMErrorOptions & {
|
|
1102
1076
|
code?: ConnectionErrorCode | undefined;
|
|
1103
1077
|
});
|
|
1104
1078
|
}
|
|
@@ -1119,11 +1093,7 @@ declare class ClientInitializationError extends VibORMError {
|
|
|
1119
1093
|
static readonly diagnosticName = "ClientInitializationError";
|
|
1120
1094
|
/** Literal discriminant: this class always carries `CLIENT_INITIALIZATION`. */
|
|
1121
1095
|
readonly code: typeof VibORMErrorCode.CLIENT_INITIALIZATION;
|
|
1122
|
-
constructor(message: string, options?:
|
|
1123
|
-
cause?: Error | undefined;
|
|
1124
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1125
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1126
|
-
});
|
|
1096
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
1127
1097
|
}
|
|
1128
1098
|
/**
|
|
1129
1099
|
* Type guard for client initialization errors
|
|
@@ -1146,10 +1116,7 @@ declare class QueryError extends VibORMError {
|
|
|
1146
1116
|
static readonly diagnosticName = "QueryError";
|
|
1147
1117
|
/** Discriminant: one of {@link QueryErrorCode}, never a code outside the family. */
|
|
1148
1118
|
readonly code: QueryErrorCode;
|
|
1149
|
-
constructor(message: string, options?: {
|
|
1150
|
-
cause?: Error | undefined;
|
|
1151
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1152
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1119
|
+
constructor(message: string, options?: VibORMErrorOptions & {
|
|
1153
1120
|
code?: QueryErrorCode | undefined;
|
|
1154
1121
|
});
|
|
1155
1122
|
}
|
|
@@ -1182,10 +1149,7 @@ declare class NestedWriteError extends VibORMError {
|
|
|
1182
1149
|
static readonly diagnosticName = "NestedWriteError";
|
|
1183
1150
|
/** Discriminant: one of {@link NestedWriteErrorCode}, never a code outside the family. */
|
|
1184
1151
|
readonly code: NestedWriteErrorCode;
|
|
1185
|
-
constructor(message: string, relation: string, options?: {
|
|
1186
|
-
cause?: Error | undefined;
|
|
1187
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1188
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1152
|
+
constructor(message: string, relation: string, options?: VibORMErrorOptions & {
|
|
1189
1153
|
code?: NestedWriteErrorCode | undefined;
|
|
1190
1154
|
});
|
|
1191
1155
|
}
|
|
@@ -1202,11 +1166,7 @@ declare class NestedWriteAssertionError extends VibORMError {
|
|
|
1202
1166
|
static readonly diagnosticName = "NestedWriteAssertionError";
|
|
1203
1167
|
/** Literal discriminant: this class always carries `NESTED_WRITE_ASSERTION_FAILED`. */
|
|
1204
1168
|
readonly code: typeof VibORMErrorCode.NESTED_WRITE_ASSERTION_FAILED;
|
|
1205
|
-
constructor(message: string, options?:
|
|
1206
|
-
cause?: Error | undefined;
|
|
1207
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1208
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1209
|
-
});
|
|
1169
|
+
constructor(message: string, options?: VibORMErrorOptions);
|
|
1210
1170
|
}
|
|
1211
1171
|
/**
|
|
1212
1172
|
* Feature not supported errors
|
|
@@ -1330,10 +1290,7 @@ declare class TransactionError extends VibORMError {
|
|
|
1330
1290
|
static readonly diagnosticName = "TransactionError";
|
|
1331
1291
|
/** Discriminant: one of {@link TransactionErrorCode}, never a code outside the family. */
|
|
1332
1292
|
readonly code: TransactionErrorCode;
|
|
1333
|
-
constructor(message: string, options?: {
|
|
1334
|
-
cause?: Error | undefined;
|
|
1335
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1336
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1293
|
+
constructor(message: string, options?: VibORMErrorOptions & {
|
|
1337
1294
|
code?: TransactionErrorCode | undefined;
|
|
1338
1295
|
});
|
|
1339
1296
|
}
|
|
@@ -1375,11 +1332,6 @@ type ValidationErrorSource = {
|
|
|
1375
1332
|
readonly target?: string | undefined;
|
|
1376
1333
|
readonly schemaType?: string | undefined;
|
|
1377
1334
|
};
|
|
1378
|
-
interface ValidationErrorOptions {
|
|
1379
|
-
cause?: Error | undefined;
|
|
1380
|
-
diagnostics?: DiagnosticDisclosure | undefined;
|
|
1381
|
-
meta?: VibORMErrorMeta | undefined;
|
|
1382
|
-
}
|
|
1383
1335
|
/**
|
|
1384
1336
|
* Input validation errors
|
|
1385
1337
|
*/
|
|
@@ -1397,7 +1349,7 @@ declare class ValidationError extends VibORMError {
|
|
|
1397
1349
|
* name the caller used (see {@link publicOperationName}).
|
|
1398
1350
|
*/
|
|
1399
1351
|
readonly operation?: Operation | undefined;
|
|
1400
|
-
constructor(sourceOrOperation: Operation | ValidationErrorSource, issues: ValidationIssue$1[], options?:
|
|
1352
|
+
constructor(sourceOrOperation: Operation | ValidationErrorSource, issues: ValidationIssue$1[], options?: VibORMErrorOptions);
|
|
1401
1353
|
}
|
|
1402
1354
|
/**
|
|
1403
1355
|
* Type guard for validation errors
|
|
@@ -1650,6 +1602,7 @@ interface JsonSchema$1 {
|
|
|
1650
1602
|
prefixItems?: JsonSchema$1[];
|
|
1651
1603
|
minItems?: number;
|
|
1652
1604
|
maxItems?: number;
|
|
1605
|
+
uniqueItems?: boolean;
|
|
1653
1606
|
anyOf?: JsonSchema$1[];
|
|
1654
1607
|
oneOf?: JsonSchema$1[];
|
|
1655
1608
|
allOf?: JsonSchema$1[];
|
|
@@ -1844,23 +1797,22 @@ declare function boolean<const Opts extends ScalarOptions<boolean, any>>(options
|
|
|
1844
1797
|
//#endregion
|
|
1845
1798
|
//#region src/validation/primitives/enum.d.ts
|
|
1846
1799
|
type EnumValues<S$1 extends VibSchema> = S$1 extends EnumSchema<infer TValues, any, any> ? TValues : never;
|
|
1847
|
-
type BaseEnumSchema<TValues extends string[], Opts extends ScalarOptions<TValues[number], any> | undefined = undefined> = EnumSchema<TValues, ComputeInput<TValues[number], Opts>, ComputeOutput<TValues[number], Opts>>;
|
|
1848
|
-
interface EnumSchema<TValues extends string[], TInput = TValues[number], TOutput = TValues[number]> extends VibSchema<TInput, TOutput> {
|
|
1800
|
+
type BaseEnumSchema<TValues extends readonly string[], Opts extends ScalarOptions<TValues[number], any> | undefined = undefined> = EnumSchema<TValues, ComputeInput<TValues[number], Opts>, ComputeOutput<TValues[number], Opts>>;
|
|
1801
|
+
interface EnumSchema<TValues extends readonly string[], TInput = TValues[number], TOutput = TValues[number]> extends VibSchema<TInput, TOutput> {
|
|
1849
1802
|
readonly type: "enum";
|
|
1850
1803
|
readonly values: TValues;
|
|
1851
1804
|
}
|
|
1852
1805
|
/**
|
|
1853
|
-
* Create an enum schema that validates a value is one of the allowed
|
|
1806
|
+
* Create an enum schema that validates a value is one of the allowed strings.
|
|
1854
1807
|
*
|
|
1855
|
-
*
|
|
1856
|
-
*
|
|
1808
|
+
* The values may be a readonly tuple (`["a", "b"] as const`). The mutable arm
|
|
1809
|
+
* of the constraint keeps an inline literal inferred as a mutable tuple, so
|
|
1810
|
+
* the types of existing schemas do not change.
|
|
1857
1811
|
*
|
|
1858
1812
|
* @example
|
|
1859
1813
|
* const status = v.enum_(["active", "inactive", "pending"]);
|
|
1860
|
-
* const level = v.enum_([1, 2, 3]);
|
|
1861
|
-
* const mixed = v.enum_(["a", 1, "b", 2]);
|
|
1862
1814
|
*/
|
|
1863
|
-
declare function enum_<const TValues extends string[], const Opts extends ScalarOptions<TValues[number], any> | undefined = undefined>(values: TValues, options?: Opts): EnumSchema<TValues, ComputeInput<TValues[number], Opts>, ComputeOutput<TValues[number], Opts>>;
|
|
1815
|
+
declare function enum_<const TValues extends string[] | readonly string[], const Opts extends ScalarOptions<TValues[number], any> | undefined = undefined>(values: TValues, options?: Opts): EnumSchema<TValues, ComputeInput<TValues[number], Opts>, ComputeOutput<TValues[number], Opts>>;
|
|
1864
1816
|
//#endregion
|
|
1865
1817
|
//#region src/validation/primitives/geo-area-codec.d.ts
|
|
1866
1818
|
declare function geoAreaSchema(): VibSchema<GeoArea, GeoArea>;
|
|
@@ -2026,12 +1978,13 @@ interface ObjectOptions<T$1 = unknown, TKeys extends string = string> {
|
|
|
2026
1978
|
* So one hook: it runs after every member validated, over the validated
|
|
2027
1979
|
* output (a key spelled `undefined` is already absent there, which is the
|
|
2028
1980
|
* `{ f: undefined }` ≡ `{}` rule the whole surface follows), and returns the
|
|
2029
|
-
* refusal sentence
|
|
1981
|
+
* refusal sentence, an issue carrying the path of the key that is wrong, or
|
|
1982
|
+
* `undefined`. It is deliberately NOT part of the
|
|
2030
1983
|
* inferred input type: these are runtime completeness facts about a
|
|
2031
1984
|
* recursive filter surface, and distributing them into the type would turn
|
|
2032
1985
|
* every filter object into a union of one variant per operator.
|
|
2033
1986
|
*/
|
|
2034
|
-
refuse?: (value: Record<string, unknown>) => string | undefined;
|
|
1987
|
+
refuse?: (value: Record<string, unknown>) => string | ValidationIssue | undefined;
|
|
2035
1988
|
}
|
|
2036
1989
|
/**
|
|
2037
1990
|
* Omit specific keys from a type entirely.
|
|
@@ -2225,7 +2178,14 @@ declare function vector<const Opts extends ScalarOptions<number[], any> | undefi
|
|
|
2225
2178
|
};
|
|
2226
2179
|
//#endregion
|
|
2227
2180
|
//#region src/validation/index.d.ts
|
|
2228
|
-
|
|
2181
|
+
/**
|
|
2182
|
+
* Validate `value` against `schema`. `allIssues: true` reports every issue of
|
|
2183
|
+
* the value — each object member, each list item, every unknown or missing
|
|
2184
|
+
* key — instead of stopping at the first.
|
|
2185
|
+
*/
|
|
2186
|
+
declare function parse<const S$1 extends StandardSchemaV1>(schema: S$1, value: unknown, options?: {
|
|
2187
|
+
readonly allIssues?: boolean | undefined;
|
|
2188
|
+
}): ParseResult<S$1>;
|
|
2229
2189
|
//#endregion
|
|
2230
2190
|
//#region src/validation/primitives/transform.d.ts
|
|
2231
2191
|
/**
|
|
@@ -2522,7 +2482,8 @@ type FromObjectOptions<T$1 = unknown> = ObjectOptions<T$1>;
|
|
|
2522
2482
|
*/
|
|
2523
2483
|
type ComputeEntries<TObject extends Record<string, any>, TPath extends string> = { [K in keyof TObject]: SchemaAtPath<TObject, TPath, K> };
|
|
2524
2484
|
/**
|
|
2525
|
-
*
|
|
2485
|
+
* Project entries without constructing an object validator that a composer
|
|
2486
|
+
* would immediately discard. The public builder uses this same path boundary.
|
|
2526
2487
|
*/
|
|
2527
2488
|
|
|
2528
2489
|
/**
|
|
@@ -3016,6 +2977,14 @@ declare function createModelFieldRefs<TName extends string, M$1 extends Model$1<
|
|
|
3016
2977
|
*
|
|
3017
2978
|
* `sql` is the ordinary tagged template; interpolations inside a fragment ride
|
|
3018
2979
|
* along as bound parameters (see {@link file://../../sql/sql.ts}).
|
|
2980
|
+
*
|
|
2981
|
+
* PURITY IS THE CONTRACT for the callback handed this context. Validation may
|
|
2982
|
+
* run a payload's callbacks more than once — `upsert` re-parses its taken arm
|
|
2983
|
+
* (the C2 residue), so a callback under `upsert.update` can be invoked twice
|
|
2984
|
+
* for one call. A callback that counts its calls, mutates outer state, or
|
|
2985
|
+
* returns a different fragment each time gets exactly what it asks for; a pure
|
|
2986
|
+
* one is indistinguishable from a literal token, which is the whole point of
|
|
2987
|
+
* the sugar.
|
|
3019
2988
|
*/
|
|
3020
2989
|
interface OperandCtx<TModel> {
|
|
3021
2990
|
readonly fields: ModelFieldRefs<string, TModel>;
|
|
@@ -3288,6 +3257,14 @@ interface UnionSchema<TOptions extends readonly VibSchema<any, any>[], TInput =
|
|
|
3288
3257
|
* Create a union schema that validates against multiple options.
|
|
3289
3258
|
* Returns the result of the first matching schema.
|
|
3290
3259
|
*
|
|
3260
|
+
* A refusal names the member the value was written for. In a tagged union
|
|
3261
|
+
* (every member an object with its own literal at one key) that is the member
|
|
3262
|
+
* its tag names, and only that member runs. Otherwise it is the member whose
|
|
3263
|
+
* first issue reads DEEPEST into the value (`{ gt: "3" }` is refused at `gt`
|
|
3264
|
+
* by the operator object, not at the root by the shorthand). Members that
|
|
3265
|
+
* refused equally deep leave no such member, and the refusal lists what each
|
|
3266
|
+
* one said, once (one issue, path kept, when they all said the same).
|
|
3267
|
+
*
|
|
3291
3268
|
* @example
|
|
3292
3269
|
* const stringOrNumber = v.union([v.string(), v.number()]);
|
|
3293
3270
|
*/
|
|
@@ -3491,7 +3468,7 @@ declare namespace V$1 {
|
|
|
3491
3468
|
* Type-level enum schema.
|
|
3492
3469
|
* @example V.Enum<["active", "inactive", "pending"]>
|
|
3493
3470
|
*/
|
|
3494
|
-
type Enum<TValues extends string[], Opts extends ScalarOptions<TValues[number], any> | undefined = undefined> = EnumSchema<TValues, ComputeInput<TValues[number], Opts>, ComputeOutput<TValues[number], Opts>>;
|
|
3471
|
+
type Enum<TValues extends readonly string[], Opts extends ScalarOptions<TValues[number], any> | undefined = undefined> = EnumSchema<TValues, ComputeInput<TValues[number], Opts>, ComputeOutput<TValues[number], Opts>>;
|
|
3495
3472
|
/**
|
|
3496
3473
|
* Type-level literal schema.
|
|
3497
3474
|
* @example V.Literal<"active">
|
|
@@ -3679,8 +3656,13 @@ type IsSingleKey<Union> = [Union] extends [never] ? false : [Union] extends [Uni
|
|
|
3679
3656
|
/** Only omission or one literal label is evidence for static pairing. */
|
|
3680
3657
|
type IsProvableRelationName<Name$1> = [Name$1] extends [undefined] ? true : [Name$1] extends [string] ? string extends Name$1 ? false : IsSingleKey<Name$1> : false;
|
|
3681
3658
|
type IsExactly<Union, Value> = [Union] extends [Value] ? [Value] extends [Union] ? true : false : false;
|
|
3682
|
-
/**
|
|
3683
|
-
|
|
3659
|
+
/**
|
|
3660
|
+
* Type IDENTITY, the strictest test TypeScript exposes to a conditional.
|
|
3661
|
+
* `NoInfer` keeps the signature comparison from inferring through both sides:
|
|
3662
|
+
* a client's relinked model state is a mapped type, so that inference would
|
|
3663
|
+
* walk its whole relation graph even when both sides are the same type.
|
|
3664
|
+
*/
|
|
3665
|
+
type Equal<Left, Right> = (<T$1>() => T$1 extends NoInfer<Left> ? 1 : 2) extends (<T$1>() => T$1 extends NoInfer<Right> ? 1 : 2) ? true : false;
|
|
3684
3666
|
type IsSameModel<Left, Right> = Equal<ModelStateOf$8<Left>, ModelStateOf$8<Right>>;
|
|
3685
3667
|
/**
|
|
3686
3668
|
* Does `R`'s target domain NAME `Source`? A model target names one getter; a
|
|
@@ -3712,8 +3694,12 @@ type VariantPointsAt<Entries$1, Source> = true extends { [Key in keyof Entries$1
|
|
|
3712
3694
|
* Steps 2-4. The keys of `Relations` that point at `Source`, carry the same
|
|
3713
3695
|
* relation-name claim as the asker (an unnamed slot pairs only with an unnamed
|
|
3714
3696
|
* candidate), and are not the excluded slot.
|
|
3697
|
+
*
|
|
3698
|
+
* The name test runs before the target test: comparing two literals rejects
|
|
3699
|
+
* nearly every slot of a hub model, while `PointsAt` must materialize each
|
|
3700
|
+
* slot's target model to compare identities.
|
|
3715
3701
|
*/
|
|
3716
|
-
type CandidateKeys<Relations, Source, AskingName, ExcludedKey> = { [Key in keyof Relations]: IsProvableRelationName<AskingName> extends true ? Key extends ExcludedKey ? never :
|
|
3702
|
+
type CandidateKeys<Relations, Source, AskingName, ExcludedKey> = { [Key in keyof Relations]: IsProvableRelationName<AskingName> extends true ? Key extends ExcludedKey ? never : IsProvableRelationName<RelationName$1<Relations[Key]>> extends true ? IsExactly<RelationName$1<Relations[Key]>, AskingName> extends true ? PointsAt<Relations[Key], Source> extends true ? Key : never : never : never : never }[keyof Relations];
|
|
3717
3703
|
type ForwardCandidates<SourceModel, FieldKey, R$1> = CandidateKeys<RelationsOf<TargetModelOf<R$1>>, SourceModel, RelationName$1<R$1>, IsSameModel<TargetModelOf<R$1>, SourceModel> extends true ? FieldKey : never>;
|
|
3718
3704
|
/**
|
|
3719
3705
|
* Step 5's reverse half, asked from the source model.
|
|
@@ -4034,6 +4020,88 @@ type ToManyCreateSchema<Source extends AnyModel, Key$1, S$1 extends RelationStat
|
|
|
4034
4020
|
optional: true;
|
|
4035
4021
|
}>;
|
|
4036
4022
|
//#endregion
|
|
4023
|
+
//#region src/validation/relations/recurrence.d.ts
|
|
4024
|
+
interface NormalizedRecurrence {
|
|
4025
|
+
readonly depth: number | false;
|
|
4026
|
+
readonly cycles: "reject" | "prevent" | "allow";
|
|
4027
|
+
/** A projection's own output budget, when its caller set one. */
|
|
4028
|
+
readonly maxOccurrences?: number;
|
|
4029
|
+
}
|
|
4030
|
+
/**
|
|
4031
|
+
* A foreign-key traversal has no cycle policy to choose: it rejects every
|
|
4032
|
+
* cycle it reaches. `preventCycles` is therefore refused by the bag's own type,
|
|
4033
|
+
* so no downstream guard has to know which topology a nested bag belongs to.
|
|
4034
|
+
*/
|
|
4035
|
+
type ForeignKeyFilterRecurse = true | {
|
|
4036
|
+
readonly depth?: number | false;
|
|
4037
|
+
readonly preventCycles?: undefined;
|
|
4038
|
+
};
|
|
4039
|
+
type GraphFilterRecurse = true | {
|
|
4040
|
+
readonly depth?: number;
|
|
4041
|
+
readonly preventCycles?: boolean;
|
|
4042
|
+
} | {
|
|
4043
|
+
readonly depth: false;
|
|
4044
|
+
readonly preventCycles?: true;
|
|
4045
|
+
};
|
|
4046
|
+
/**
|
|
4047
|
+
* A projection's bag adds the output budget. A `where` filter reads the
|
|
4048
|
+
* closure as a set and decodes no occurrence, so it has nothing to bound and
|
|
4049
|
+
* refuses the key by its own type.
|
|
4050
|
+
*/
|
|
4051
|
+
type OutputBudget = {
|
|
4052
|
+
readonly maxOccurrences?: number;
|
|
4053
|
+
};
|
|
4054
|
+
type ForeignKeyRecurse = true | (Exclude<ForeignKeyFilterRecurse, true> & OutputBudget);
|
|
4055
|
+
type GraphRecurse = true | (Exclude<GraphFilterRecurse, true> & OutputBudget);
|
|
4056
|
+
type ForeignKeyRecurrenceSchema = V$1.Schema<ForeignKeyRecurse, NormalizedRecurrence>;
|
|
4057
|
+
type GraphRecurrenceSchema = V$1.Schema<GraphRecurse, NormalizedRecurrence>;
|
|
4058
|
+
type ForeignKeyFilterRecurrenceSchema = V$1.Schema<ForeignKeyFilterRecurse, NormalizedRecurrence>;
|
|
4059
|
+
type GraphFilterRecurrenceSchema = V$1.Schema<GraphFilterRecurse, NormalizedRecurrence>;
|
|
4060
|
+
/**
|
|
4061
|
+
* The two placements of one recurrence language. A `select`/`include` node
|
|
4062
|
+
* bounds what it decodes; a `where` filter reads the closure as a set, decodes
|
|
4063
|
+
* no occurrence, and so takes no budget.
|
|
4064
|
+
*/
|
|
4065
|
+
interface RecurrenceLanguages {
|
|
4066
|
+
readonly projection: {
|
|
4067
|
+
readonly foreignKey: ForeignKeyRecurrenceSchema;
|
|
4068
|
+
readonly junction: GraphRecurrenceSchema;
|
|
4069
|
+
};
|
|
4070
|
+
readonly filter: {
|
|
4071
|
+
readonly foreignKey: ForeignKeyFilterRecurrenceSchema;
|
|
4072
|
+
readonly junction: GraphFilterRecurrenceSchema;
|
|
4073
|
+
};
|
|
4074
|
+
}
|
|
4075
|
+
/**
|
|
4076
|
+
* The runtime eligibility reader: the recurrence language a resolved slot
|
|
4077
|
+
* admits in its placement, or `undefined` when the slot cannot recurse.
|
|
4078
|
+
*
|
|
4079
|
+
* It reads three facts, each from its owner. The model's complete primary row
|
|
4080
|
+
* key comes from the key catalog. The edge kind comes from the resolved slot:
|
|
4081
|
+
* only an ordinary foreign-key or junction edge recurses, never a variant
|
|
4082
|
+
* carrier or an inverse bound to variant storage. Self-identity is the edge's
|
|
4083
|
+
* two endpoints sharing one model object, which is runtime identity rather
|
|
4084
|
+
* than structural agreement.
|
|
4085
|
+
*
|
|
4086
|
+
* The remaining conditions of the contract are already facts of a resolved
|
|
4087
|
+
* ordinary edge, so they are not asked again: only `s.toOne` declares a
|
|
4088
|
+
* foreign key, so a collection never owns one; the resolver publishes an
|
|
4089
|
+
* edge's `unique` exactly when both endpoints are singular, so a singular
|
|
4090
|
+
* inverse is always the proven one-to-one side; and a junction edge is
|
|
4091
|
+
* resolved only between two collections.
|
|
4092
|
+
*/
|
|
4093
|
+
|
|
4094
|
+
declare const unavailableRecurrence: () => OptionalSchema<VibSchema<never, never>, undefined, undefined, undefined>;
|
|
4095
|
+
type UnavailableRecurrenceSchema = ReturnType<typeof unavailableRecurrence>;
|
|
4096
|
+
declare const unavailableRecursiveClause: (clause: string) => OptionalSchema<VibSchema<never, never>, undefined, undefined, undefined>;
|
|
4097
|
+
type UnavailableRecursiveClauseSchema = ReturnType<typeof unavailableRecursiveClause>;
|
|
4098
|
+
/**
|
|
4099
|
+
* The static eligibility reader: the recurrence language a slot admits, or
|
|
4100
|
+
* `never` when it cannot recurse, so a recursive form whose `recurse` is
|
|
4101
|
+
* required is uninhabitable there.
|
|
4102
|
+
*/
|
|
4103
|
+
type RecurrenceFor<Source extends AnyModel, Key$1, S$1 extends RelationState, Placement extends keyof RecurrenceLanguages = "projection"> = StaticRecursiveMembership<Source, Key$1, S$1> extends StaticForeignKeyMembership ? RecurrenceLanguages[Placement]["foreignKey"] : StaticRecursiveMembership<Source, Key$1, S$1> extends StaticJunctionMembership ? RecurrenceLanguages[Placement]["junction"] : never;
|
|
4104
|
+
//#endregion
|
|
4037
4105
|
//#region src/validation/relations/filter.d.ts
|
|
4038
4106
|
/**
|
|
4039
4107
|
* To-one filter. Two spellings are accepted (Prisma parity):
|
|
@@ -4055,6 +4123,13 @@ type ToManyCreateSchema<Source extends AnyModel, Key$1, S$1 extends RelationStat
|
|
|
4055
4123
|
* input type marks `is`/`isNot` as `never` (Prisma spells this `XOR<…>`), so a
|
|
4056
4124
|
* collision is a type error rather than a silent reinterpretation.
|
|
4057
4125
|
*
|
|
4126
|
+
* `recurse` collides the same way, one step earlier: an object that spells
|
|
4127
|
+
* `recurse` (not `undefined`) IS the recursive filter, on every relation slot,
|
|
4128
|
+
* and never reaches the shorthand. A target field literally named `recurse` is
|
|
4129
|
+
* reached through `{ parent: { is: { recurse: … } } }`; one named `self` is
|
|
4130
|
+
* unaffected, because only `recurse` selects the form. Both spelled
|
|
4131
|
+
* `undefined` read as absent, like every undefined key of an object.
|
|
4132
|
+
*
|
|
4058
4133
|
* For optional relations, `is` can also be null, and the bare `null`
|
|
4059
4134
|
* shorthand normalizes to `{ is: null }` (unchanged by the object shorthand).
|
|
4060
4135
|
*
|
|
@@ -4075,8 +4150,42 @@ type MayBeEmpty<Source extends AnyModel, Key$1, S$1 extends RelationState> = Slo
|
|
|
4075
4150
|
type ToOneFilterObjectSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = V$1.Object<{
|
|
4076
4151
|
is: () => V$1.MaybeNullable<GetTargetSchemas<S$1>["core"]["where"], MayBeEmpty<Source, Key$1, S$1>>;
|
|
4077
4152
|
isNot: () => V$1.MaybeNullable<GetTargetSchemas<S$1>["core"]["where"], MayBeEmpty<Source, Key$1, S$1>>;
|
|
4078
|
-
}>;
|
|
4153
|
+
} & NoClosure>;
|
|
4079
4154
|
type TargetWhereSchema<S$1 extends RelationState> = GetTargetSchemas<S$1>["core"]["where"];
|
|
4155
|
+
/** `some`/`every`/`none`, each the target's full `where`. */
|
|
4156
|
+
type Quantifiers<S$1 extends RelationState> = {
|
|
4157
|
+
some: () => TargetWhereSchema<S$1>;
|
|
4158
|
+
every: () => TargetWhereSchema<S$1>;
|
|
4159
|
+
none: () => TargetWhereSchema<S$1>;
|
|
4160
|
+
};
|
|
4161
|
+
/**
|
|
4162
|
+
* The recursive filter: a quantifier over the slot's transitive closure from
|
|
4163
|
+
* the filtered row, `self` adding that row itself. `recurse` is the language
|
|
4164
|
+
* `select`/`include` admit on the slot without its output budget, so
|
|
4165
|
+
* eligibility, bounds and normalization have one owner. Where the slot cannot
|
|
4166
|
+
* recurse the required `recurse` is `never` and the form is uninhabitable;
|
|
4167
|
+
* eligibility stays inside the required key, as on the select side, so no
|
|
4168
|
+
* ordinary filter compares the cyclic model graph eagerly.
|
|
4169
|
+
*/
|
|
4170
|
+
type RecursiveFilterSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = V$1.Object<{
|
|
4171
|
+
recurse: RecurrenceFor<Source, Key$1, S$1, "filter">;
|
|
4172
|
+
self: V$1.Boolean;
|
|
4173
|
+
is: UnavailableRecursiveClauseSchema;
|
|
4174
|
+
isNot: UnavailableRecursiveClauseSchema;
|
|
4175
|
+
} & Quantifiers<S$1>, {
|
|
4176
|
+
atLeast: ["recurse"];
|
|
4177
|
+
}>;
|
|
4178
|
+
/**
|
|
4179
|
+
* The ordinary forms' statement of the dispatcher's invariant: they never see
|
|
4180
|
+
* `recurse`, nor a `self` spelled `undefined`, so neither is theirs to accept.
|
|
4181
|
+
* Types only, like the shorthand's `is?: never`; the runtime objects carry no
|
|
4182
|
+
* entry, because `withRecursiveNode` routes a spelled `recurse` away and drops
|
|
4183
|
+
* both keys spelled `undefined`.
|
|
4184
|
+
*/
|
|
4185
|
+
type NoClosure = {
|
|
4186
|
+
recurse: UnavailableRecurrenceSchema;
|
|
4187
|
+
self: UnavailableRecurrenceSchema;
|
|
4188
|
+
};
|
|
4080
4189
|
/**
|
|
4081
4190
|
* The shorthand member: a target-model `where` whose parsed value is wrapped
|
|
4082
4191
|
* into the explicit `{ is }` shape. Its input type excludes `is`/`isNot` so the
|
|
@@ -4086,35 +4195,16 @@ type TargetWhereSchema<S$1 extends RelationState> = GetTargetSchemas<S$1>["core"
|
|
|
4086
4195
|
type ToOneShorthandFilterSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = V$1.Transform<V$1.Input<TargetWhereSchema<S$1>> & {
|
|
4087
4196
|
is?: never;
|
|
4088
4197
|
isNot?: never;
|
|
4198
|
+
recurse?: never;
|
|
4089
4199
|
}, V$1.Output<ToOneFilterObjectSchema<Source, Key$1, S$1>>> & {
|
|
4090
4200
|
wrapped: TargetWhereSchema<S$1>;
|
|
4091
4201
|
};
|
|
4092
|
-
type ToOneFilterSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = MayBeEmpty<Source, Key$1, S$1> extends true ? V$1.Union<readonly [NullToIsNull, ToOneFilterObjectSchema<Source, Key$1, S$1>, ToOneShorthandFilterSchema<Source, Key$1, S$1>]> : V$1.Union<readonly [ToOneFilterObjectSchema<Source, Key$1, S$1>, ToOneShorthandFilterSchema<Source, Key$1, S$1>]>;
|
|
4202
|
+
type ToOneFilterSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = MayBeEmpty<Source, Key$1, S$1> extends true ? V$1.Union<readonly [NullToIsNull, ToOneFilterObjectSchema<Source, Key$1, S$1>, ToOneShorthandFilterSchema<Source, Key$1, S$1>, RecursiveFilterSchema<Source, Key$1, S$1>]> : V$1.Union<readonly [ToOneFilterObjectSchema<Source, Key$1, S$1>, ToOneShorthandFilterSchema<Source, Key$1, S$1>, RecursiveFilterSchema<Source, Key$1, S$1>]>;
|
|
4093
4203
|
/**
|
|
4094
|
-
* To-many filter: { some?, every?, none? }
|
|
4204
|
+
* To-many filter: { some?, every?, none? }, or the recursive filter.
|
|
4095
4205
|
* Uses thunks for lazy evaluation - getTargetWhereSchema already returns thunk
|
|
4096
4206
|
*/
|
|
4097
|
-
type ToManyFilterSchema<S$1 extends RelationState> = V$1.Object<
|
|
4098
|
-
some: () => GetTargetSchemas<S$1>["core"]["where"];
|
|
4099
|
-
every: () => GetTargetSchemas<S$1>["core"]["where"];
|
|
4100
|
-
none: () => GetTargetSchemas<S$1>["core"]["where"];
|
|
4101
|
-
}>;
|
|
4102
|
-
//#endregion
|
|
4103
|
-
//#region src/drivers/shared/sqlite-utils.d.ts
|
|
4104
|
-
/**
|
|
4105
|
-
* Shared result parser for the SQLite drivers. It speaks about ROW VALUES only:
|
|
4106
|
-
* - Boolean integer parsing (0/1 -> false/true)
|
|
4107
|
-
* - `json` columns, which SQLite stores as TEXT
|
|
4108
|
-
*
|
|
4109
|
-
* It says nothing about a RESULT (Arnaud's D-35). A SQLite transport answers a
|
|
4110
|
-
* `count`/`exist` in the shape the engine's own projection asked for — the
|
|
4111
|
-
* engine aliases that column `_count` and reads `_count` back — so the meaning
|
|
4112
|
-
* of a count and an exists answer has one authority, the engine's decoder, and
|
|
4113
|
-
* this middleware has nothing to add at the result boundary. Recovering a count
|
|
4114
|
-
* from a provider that did NOT preserve the alias is a dialect fact, stated
|
|
4115
|
-
* once at the adapter seam by the provider that needs it (MySQL).
|
|
4116
|
-
*/
|
|
4117
|
-
declare const sqliteResultParser: DriverResultParser;
|
|
4207
|
+
type ToManyFilterSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = V$1.Union<readonly [V$1.Object<Quantifiers<S$1> & NoClosure>, RecursiveFilterSchema<Source, Key$1, S$1>]>;
|
|
4118
4208
|
//#endregion
|
|
4119
4209
|
//#region src/drivers/types.d.ts
|
|
4120
4210
|
/**
|
|
@@ -4171,25 +4261,6 @@ interface BatchQuery {
|
|
|
4171
4261
|
/** Internal acknowledgement fired after a native batch commits, before decoding. */
|
|
4172
4262
|
type CommittedBatchNotification = () => Promise<void>;
|
|
4173
4263
|
//#endregion
|
|
4174
|
-
//#region src/extensions/official-facts.d.ts
|
|
4175
|
-
/** One native-batch member as the statement log attributes it. */
|
|
4176
|
-
interface StatementMember {
|
|
4177
|
-
readonly context: QueryExecutionContext;
|
|
4178
|
-
readonly params: unknown[];
|
|
4179
|
-
readonly sql: string;
|
|
4180
|
-
}
|
|
4181
|
-
/** What a statement's provider dispatch publishes, after transform and acquisition. */
|
|
4182
|
-
interface StatementExecution {
|
|
4183
|
-
readonly context: QueryExecutionContext;
|
|
4184
|
-
readonly sql: string;
|
|
4185
|
-
/** The one pre-dispatch parameter snapshot, or empty when nothing discloses it. */
|
|
4186
|
-
readonly params: unknown[];
|
|
4187
|
-
readonly forceErrorContext: boolean;
|
|
4188
|
-
/** Native batch: each member's own context, SQL and parameters. */
|
|
4189
|
-
readonly members?: readonly StatementMember[];
|
|
4190
|
-
}
|
|
4191
|
-
type LifecycleBoundary = "connect" | "disconnect" | "savepoint" | "transaction";
|
|
4192
|
-
//#endregion
|
|
4193
4264
|
//#region src/clock.d.ts
|
|
4194
4265
|
/**
|
|
4195
4266
|
* The time seam.
|
|
@@ -4227,6 +4298,115 @@ interface Clock {
|
|
|
4227
4298
|
setTimeout(callback: () => void, ms: number): ClockTimer;
|
|
4228
4299
|
}
|
|
4229
4300
|
//#endregion
|
|
4301
|
+
//#region src/drivers/shared/transaction-options.d.ts
|
|
4302
|
+
/** Prisma's isolation-level spellings, exactly. */
|
|
4303
|
+
declare const TRANSACTION_ISOLATION_LEVELS: readonly ["ReadUncommitted", "ReadCommitted", "RepeatableRead", "Serializable"];
|
|
4304
|
+
type TransactionIsolationLevel = (typeof TRANSACTION_ISOLATION_LEVELS)[number];
|
|
4305
|
+
/** Options accepted by the interactive (callback) `$transaction` form. */
|
|
4306
|
+
interface TransactionOptions {
|
|
4307
|
+
/** Isolation level for the transaction. */
|
|
4308
|
+
isolationLevel?: TransactionIsolationLevel;
|
|
4309
|
+
/** Milliseconds the callback body may run before rollback. */
|
|
4310
|
+
timeout?: number;
|
|
4311
|
+
/** Milliseconds to wait for a transaction slot before giving up. */
|
|
4312
|
+
maxWait?: number;
|
|
4313
|
+
}
|
|
4314
|
+
/**
|
|
4315
|
+
* Options accepted by the sequential (array) `$transaction` form. Prisma's
|
|
4316
|
+
* sequential API takes `isolationLevel` only: an array has no interactive
|
|
4317
|
+
* window for `timeout` to bound, so neither client offers it there.
|
|
4318
|
+
*/
|
|
4319
|
+
interface BatchTransactionOptions {
|
|
4320
|
+
isolationLevel?: TransactionIsolationLevel;
|
|
4321
|
+
}
|
|
4322
|
+
/** Where a driver must emit `SET TRANSACTION ISOLATION LEVEL`, if anywhere. */
|
|
4323
|
+
type IsolationLevelPlacement = /** PostgreSQL family: first statement *inside* the open transaction. */
|
|
4324
|
+
"provider" | "post-begin"
|
|
4325
|
+
/** MySQL family: on the transaction's own connection *before* BEGIN. */ | "pre-begin"
|
|
4326
|
+
/** SQLite family: serializable by construction; nothing to emit. */ | "serializable-only"
|
|
4327
|
+
/** No transaction is opened, so there is nothing to configure. */ | "unsupported";
|
|
4328
|
+
/** How a driver can bound the wait for a transaction slot. */
|
|
4329
|
+
type MaxWaitSupport = /** The driver serializes transactions through a queue we can bound. */
|
|
4330
|
+
"queue"
|
|
4331
|
+
/** The driver acquires a pooled connection it can abandon and release. */ | "acquisition"
|
|
4332
|
+
/** No wait we own, or no wait at all. */ | "unsupported";
|
|
4333
|
+
/**
|
|
4334
|
+
* A driver's honest answer for each option. Every advertised driver declares
|
|
4335
|
+
* one; `tests/drivers/transaction-portability.test.ts` pins every cell.
|
|
4336
|
+
*/
|
|
4337
|
+
interface TransactionOptionSupport {
|
|
4338
|
+
readonly isolationLevel: IsolationLevelPlacement;
|
|
4339
|
+
/**
|
|
4340
|
+
* Why this driver cannot honor the levels it refuses. Required whenever
|
|
4341
|
+
* `isolationLevel` is not `"post-begin"` or `"pre-begin"`, so a refusal
|
|
4342
|
+
* always names its reason instead of just saying "no".
|
|
4343
|
+
*/
|
|
4344
|
+
readonly isolationLevelReason?: string;
|
|
4345
|
+
/** Whether the callback body can be raced against a timer and rolled back. */
|
|
4346
|
+
readonly timeout: boolean;
|
|
4347
|
+
/** Why `timeout` cannot be honored. Required when `timeout` is false. */
|
|
4348
|
+
readonly timeoutReason?: string;
|
|
4349
|
+
readonly maxWait: MaxWaitSupport;
|
|
4350
|
+
/** Why `maxWait` cannot be honored. Required when `maxWait` is unsupported. */
|
|
4351
|
+
readonly maxWaitReason?: string;
|
|
4352
|
+
}
|
|
4353
|
+
/** The `$transaction` form the options were passed to. */
|
|
4354
|
+
type TransactionForm = "callback" | "batch";
|
|
4355
|
+
/** What the driver layer must act on. `timeout` never reaches a driver. */
|
|
4356
|
+
interface DriverTransactionOptions {
|
|
4357
|
+
/** Set only when the driver's placement is `"pre-begin"`. */
|
|
4358
|
+
readonly isolationLevel?: TransactionIsolationLevel;
|
|
4359
|
+
/** Set only when the driver's max-wait mode is `"acquisition"`. */
|
|
4360
|
+
readonly maxWaitMs?: number;
|
|
4361
|
+
}
|
|
4362
|
+
/** The honored shape of a validated, driver-accepted options object. */
|
|
4363
|
+
interface TransactionPlan {
|
|
4364
|
+
readonly isolationLevel?: TransactionIsolationLevel;
|
|
4365
|
+
/** `SET TRANSACTION ISOLATION LEVEL ...`, when the driver emits SQL. */
|
|
4366
|
+
readonly isolationStatement?: string;
|
|
4367
|
+
readonly isolationPlacement: IsolationLevelPlacement;
|
|
4368
|
+
readonly timeoutMs?: number;
|
|
4369
|
+
readonly maxWaitMs?: number;
|
|
4370
|
+
readonly maxWaitMode: MaxWaitSupport;
|
|
4371
|
+
/** The subset the driver's own `transaction()` must act on. */
|
|
4372
|
+
readonly driverOptions?: DriverTransactionOptions;
|
|
4373
|
+
}
|
|
4374
|
+
//#endregion
|
|
4375
|
+
//#region src/drivers/shared/sqlite-utils.d.ts
|
|
4376
|
+
/**
|
|
4377
|
+
* Shared result parser for the SQLite drivers. It speaks about ROW VALUES only:
|
|
4378
|
+
* - Boolean integer parsing (0/1 -> false/true)
|
|
4379
|
+
* - `json` columns, which SQLite stores as TEXT
|
|
4380
|
+
*
|
|
4381
|
+
* It says nothing about a RESULT (Arnaud's D-35). A SQLite transport answers a
|
|
4382
|
+
* `count`/`exist` in the shape the engine's own projection asked for — the
|
|
4383
|
+
* engine aliases that column `_count` and reads `_count` back — so the meaning
|
|
4384
|
+
* of a count and an exists answer has one authority, the engine's decoder, and
|
|
4385
|
+
* this middleware has nothing to add at the result boundary. Recovering a count
|
|
4386
|
+
* from a provider that did NOT preserve the alias is a dialect fact, stated
|
|
4387
|
+
* once at the adapter seam by the provider that needs it (MySQL).
|
|
4388
|
+
*/
|
|
4389
|
+
declare const sqliteResultParser: DriverResultParser;
|
|
4390
|
+
//#endregion
|
|
4391
|
+
//#region src/extensions/official-facts.d.ts
|
|
4392
|
+
/** One native-batch member as the statement log attributes it. */
|
|
4393
|
+
interface StatementMember {
|
|
4394
|
+
readonly context: QueryExecutionContext;
|
|
4395
|
+
readonly params: unknown[];
|
|
4396
|
+
readonly sql: string;
|
|
4397
|
+
}
|
|
4398
|
+
/** What a statement's provider dispatch publishes, after transform and acquisition. */
|
|
4399
|
+
interface StatementExecution {
|
|
4400
|
+
readonly context: QueryExecutionContext;
|
|
4401
|
+
readonly sql: string;
|
|
4402
|
+
/** The one pre-dispatch parameter snapshot, or empty when nothing discloses it. */
|
|
4403
|
+
readonly params: unknown[];
|
|
4404
|
+
readonly forceErrorContext: boolean;
|
|
4405
|
+
/** Native batch: each member's own context, SQL and parameters. */
|
|
4406
|
+
readonly members?: readonly StatementMember[];
|
|
4407
|
+
}
|
|
4408
|
+
type LifecycleBoundary = "connect" | "disconnect" | "savepoint" | "transaction";
|
|
4409
|
+
//#endregion
|
|
4230
4410
|
//#region src/cache/schema.d.ts
|
|
4231
4411
|
type CacheInvalidationSchemaEntries = {
|
|
4232
4412
|
invalidate: V$1.String<{
|
|
@@ -4453,30 +4633,6 @@ type Schema$3 = Record<string, Model$1<any>>;
|
|
|
4453
4633
|
*/
|
|
4454
4634
|
type DateTimePhysicalForm = "text" | "epochMillis" | "julianDay";
|
|
4455
4635
|
//#endregion
|
|
4456
|
-
//#region src/validation/relations/recurrence.d.ts
|
|
4457
|
-
interface NormalizedRecurrence {
|
|
4458
|
-
readonly depth: number | false;
|
|
4459
|
-
readonly cycles: "reject" | "prevent" | "allow";
|
|
4460
|
-
}
|
|
4461
|
-
/**
|
|
4462
|
-
* A foreign-key traversal has no cycle policy to choose: it rejects every
|
|
4463
|
-
* cycle it reaches. `preventCycles` is therefore refused by the bag's own type,
|
|
4464
|
-
* so no downstream guard has to know which topology a nested bag belongs to.
|
|
4465
|
-
*/
|
|
4466
|
-
type ForeignKeyRecurse = true | {
|
|
4467
|
-
readonly depth?: number | false;
|
|
4468
|
-
readonly preventCycles?: undefined;
|
|
4469
|
-
};
|
|
4470
|
-
type GraphRecurse = true | {
|
|
4471
|
-
readonly depth?: number;
|
|
4472
|
-
readonly preventCycles?: boolean;
|
|
4473
|
-
} | {
|
|
4474
|
-
readonly depth: false;
|
|
4475
|
-
readonly preventCycles?: true;
|
|
4476
|
-
};
|
|
4477
|
-
type ForeignKeyRecurrenceSchema = V$1.Schema<ForeignKeyRecurse, NormalizedRecurrence>;
|
|
4478
|
-
type GraphRecurrenceSchema = V$1.Schema<GraphRecurse, NormalizedRecurrence>;
|
|
4479
|
-
//#endregion
|
|
4480
4636
|
//#region src/schema/validation/types.d.ts
|
|
4481
4637
|
type Severity = "error" | "warning";
|
|
4482
4638
|
interface SchemaValidationIssue {
|
|
@@ -4592,7 +4748,7 @@ interface ExtensionResultConsumerState {
|
|
|
4592
4748
|
readonly [extensionResultConsumerState]: true;
|
|
4593
4749
|
}
|
|
4594
4750
|
/** The only static facts accumulated while extensions are chained. */
|
|
4595
|
-
interface ClientExtensionState<ClientMethods extends object = NoMethods, ModelMethods extends object = NoMethods, CacheState extends ExtensionCacheState | undefined = undefined, ResultConsumerState extends ExtensionResultConsumerState | undefined = undefined, Controls$1 extends object = NoControls, RowModels extends string = never, Data = never> {
|
|
4751
|
+
interface ClientExtensionState<ClientMethods extends object = NoMethods, ModelMethods extends object = NoMethods, CacheState extends ExtensionCacheState | undefined = undefined, ResultConsumerState extends ExtensionResultConsumerState | undefined = undefined, Controls$1 extends object = NoControls, RowModels extends string = never, Data$1 = never> {
|
|
4596
4752
|
readonly client: ClientMethods;
|
|
4597
4753
|
readonly models: ModelMethods;
|
|
4598
4754
|
readonly cache: CacheState;
|
|
@@ -4602,7 +4758,7 @@ interface ClientExtensionState<ClientMethods extends object = NoMethods, ModelMe
|
|
|
4602
4758
|
/** The models the chain's `rows` can hide from a relation read. */
|
|
4603
4759
|
readonly rows: RowModels;
|
|
4604
4760
|
/** The fields the chain's `data` writes, which a caller no longer writes. */
|
|
4605
|
-
readonly data: Data;
|
|
4761
|
+
readonly data: Data$1;
|
|
4606
4762
|
}
|
|
4607
4763
|
type EmptyClientExtensionState = ClientExtensionState;
|
|
4608
4764
|
/** Internal constraint for either the absent or enabled nominal cache bit. */
|
|
@@ -4688,14 +4844,14 @@ type ResultConsumerContextOf<Definition$1> = Definition$1 extends {
|
|
|
4688
4844
|
readonly query: infer Query;
|
|
4689
4845
|
} ? Query extends CallableFunction ? "result-independent" : "result-consuming" : "result-independent";
|
|
4690
4846
|
/** Incoming facts keep their nominal bit derivation inside this named state. */
|
|
4691
|
-
interface ExtensionContributionState<ClientMethods extends object, ModelMethods extends object, Controls$1 extends object, RowModels extends string, Data, ConsumerContext extends string> extends ExtensionStateConstraint {
|
|
4847
|
+
interface ExtensionContributionState<ClientMethods extends object, ModelMethods extends object, Controls$1 extends object, RowModels extends string, Data$1, ConsumerContext extends string> extends ExtensionStateConstraint {
|
|
4692
4848
|
readonly client: ClientMethods;
|
|
4693
4849
|
readonly models: ModelMethods;
|
|
4694
4850
|
readonly cache: undefined;
|
|
4695
4851
|
readonly resultConsumer: ConsumerContext extends "result-consuming" ? ExtensionResultConsumerState : undefined;
|
|
4696
4852
|
readonly controls: Controls$1;
|
|
4697
4853
|
readonly rows: RowModels;
|
|
4698
|
-
readonly data: Data;
|
|
4854
|
+
readonly data: Data$1;
|
|
4699
4855
|
}
|
|
4700
4856
|
/** Retain contribution facts, never the factory's contextual argument surface. */
|
|
4701
4857
|
type ExtensionStateContributionOf<Definition$1> = [Definition$1] extends [unknown] ? ExtensionContributionState<ClientMethodsOf<Definition$1>, ModelMethodsOf<Definition$1>, DefinitionControls<Definition$1>, RowsModels<Definition$1>, DefinitionData<Definition$1>, ResultConsumerContextOf<Definition$1>> : never;
|
|
@@ -5023,7 +5179,7 @@ type DefinitionData<Definition$1> = Definition$1 extends {
|
|
|
5023
5179
|
};
|
|
5024
5180
|
} ? string extends keyof Models ? never : { [Model in keyof Models]: CreateStamps<Model, Models[Model]> }[keyof Models] : never;
|
|
5025
5181
|
/** The fields a chain writes on every create of one model. */
|
|
5026
|
-
type StampedFieldNames<Data, ModelName$1> = Data extends StampedFields<infer Models, infer Fields extends PropertyKey> ? ModelName$1 extends Models ? Fields : never : never;
|
|
5182
|
+
type StampedFieldNames<Data$1, ModelName$1> = Data$1 extends StampedFields<infer Models, infer Fields extends PropertyKey> ? ModelName$1 extends Models ? Fields : never : never;
|
|
5027
5183
|
/**
|
|
5028
5184
|
* The controls one call admitted, by name. A `rows` control is resolved to its
|
|
5029
5185
|
* mode, so an absent one reads as its default; an absent plain control is not
|
|
@@ -5033,6 +5189,7 @@ type AdmittedControls = Readonly<Record<string, unknown>>;
|
|
|
5033
5189
|
//#endregion
|
|
5034
5190
|
//#region src/extensions/query.d.ts
|
|
5035
5191
|
type QueryInterceptionMode = "direct" | "transaction" | "array";
|
|
5192
|
+
type RawQueryKind = "queryRaw" | "executeRaw" | "queryRawUnsafe" | "executeRawUnsafe";
|
|
5036
5193
|
type WriteOutcome = Readonly<{
|
|
5037
5194
|
certainty: "committed" | "may-have-committed";
|
|
5038
5195
|
}>;
|
|
@@ -5050,23 +5207,11 @@ type GenericModelQueryContext<Result> = GenericQueryContextBase<Result> & {
|
|
|
5050
5207
|
/** The call's controls this handler's extension declares, and only those. */
|
|
5051
5208
|
readonly controls?: AdmittedControls;
|
|
5052
5209
|
};
|
|
5053
|
-
type GenericRawQueryContext<Result> = GenericQueryContextBase<Result> &
|
|
5054
|
-
readonly kind:
|
|
5055
|
-
readonly model: undefined;
|
|
5056
|
-
readonly operation: "$queryRaw";
|
|
5057
|
-
} | {
|
|
5058
|
-
readonly kind: "executeRaw";
|
|
5059
|
-
readonly model: undefined;
|
|
5060
|
-
readonly operation: "$executeRaw";
|
|
5061
|
-
} | {
|
|
5062
|
-
readonly kind: "queryRawUnsafe";
|
|
5210
|
+
type GenericRawQueryContext<Result> = GenericQueryContextBase<Result> & { [Kind in RawQueryKind]: {
|
|
5211
|
+
readonly kind: Kind;
|
|
5063
5212
|
readonly model: undefined;
|
|
5064
|
-
readonly operation:
|
|
5065
|
-
}
|
|
5066
|
-
readonly kind: "executeRawUnsafe";
|
|
5067
|
-
readonly model: undefined;
|
|
5068
|
-
readonly operation: "$executeRawUnsafe";
|
|
5069
|
-
});
|
|
5213
|
+
readonly operation: `$${Kind}`;
|
|
5214
|
+
} }[RawQueryKind];
|
|
5070
5215
|
type GenericQueryContext<Result> = GenericModelQueryContext<Result> | GenericRawQueryContext<Result>;
|
|
5071
5216
|
type GenericQueryHandlerCall = <Result>(context: GenericQueryContext<Result>) => Promise<Result>;
|
|
5072
5217
|
declare const officialQueryHandlerIdentity: unique symbol;
|
|
@@ -5122,80 +5267,6 @@ type OfficialCacheExtension = {
|
|
|
5122
5267
|
readonly controls: OfficialCacheControls;
|
|
5123
5268
|
};
|
|
5124
5269
|
//#endregion
|
|
5125
|
-
//#region src/drivers/shared/transaction-options.d.ts
|
|
5126
|
-
/** Prisma's isolation-level spellings, exactly. */
|
|
5127
|
-
declare const TRANSACTION_ISOLATION_LEVELS: readonly ["ReadUncommitted", "ReadCommitted", "RepeatableRead", "Serializable"];
|
|
5128
|
-
type TransactionIsolationLevel = (typeof TRANSACTION_ISOLATION_LEVELS)[number];
|
|
5129
|
-
/** Options accepted by the interactive (callback) `$transaction` form. */
|
|
5130
|
-
interface TransactionOptions {
|
|
5131
|
-
/** Isolation level for the transaction. */
|
|
5132
|
-
isolationLevel?: TransactionIsolationLevel;
|
|
5133
|
-
/** Milliseconds the callback body may run before rollback. */
|
|
5134
|
-
timeout?: number;
|
|
5135
|
-
/** Milliseconds to wait for a transaction slot before giving up. */
|
|
5136
|
-
maxWait?: number;
|
|
5137
|
-
}
|
|
5138
|
-
/**
|
|
5139
|
-
* Options accepted by the sequential (array) `$transaction` form. Prisma's
|
|
5140
|
-
* sequential API takes `isolationLevel` only: an array has no interactive
|
|
5141
|
-
* window for `timeout` to bound, so neither client offers it there.
|
|
5142
|
-
*/
|
|
5143
|
-
interface BatchTransactionOptions {
|
|
5144
|
-
isolationLevel?: TransactionIsolationLevel;
|
|
5145
|
-
}
|
|
5146
|
-
/** Where a driver must emit `SET TRANSACTION ISOLATION LEVEL`, if anywhere. */
|
|
5147
|
-
type IsolationLevelPlacement = /** PostgreSQL family: first statement *inside* the open transaction. */
|
|
5148
|
-
"provider" | "post-begin"
|
|
5149
|
-
/** MySQL family: on the transaction's own connection *before* BEGIN. */ | "pre-begin"
|
|
5150
|
-
/** SQLite family: serializable by construction; nothing to emit. */ | "serializable-only"
|
|
5151
|
-
/** No transaction is opened, so there is nothing to configure. */ | "unsupported";
|
|
5152
|
-
/** How a driver can bound the wait for a transaction slot. */
|
|
5153
|
-
type MaxWaitSupport = /** The driver serializes transactions through a queue we can bound. */
|
|
5154
|
-
"queue"
|
|
5155
|
-
/** The driver acquires a pooled connection it can abandon and release. */ | "acquisition"
|
|
5156
|
-
/** No wait we own, or no wait at all. */ | "unsupported";
|
|
5157
|
-
/**
|
|
5158
|
-
* A driver's honest answer for each option. Every advertised driver declares
|
|
5159
|
-
* one; `tests/drivers/transaction-portability.test.ts` pins every cell.
|
|
5160
|
-
*/
|
|
5161
|
-
interface TransactionOptionSupport {
|
|
5162
|
-
readonly isolationLevel: IsolationLevelPlacement;
|
|
5163
|
-
/**
|
|
5164
|
-
* Why this driver cannot honor the levels it refuses. Required whenever
|
|
5165
|
-
* `isolationLevel` is not `"post-begin"` or `"pre-begin"`, so a refusal
|
|
5166
|
-
* always names its reason instead of just saying "no".
|
|
5167
|
-
*/
|
|
5168
|
-
readonly isolationLevelReason?: string;
|
|
5169
|
-
/** Whether the callback body can be raced against a timer and rolled back. */
|
|
5170
|
-
readonly timeout: boolean;
|
|
5171
|
-
/** Why `timeout` cannot be honored. Required when `timeout` is false. */
|
|
5172
|
-
readonly timeoutReason?: string;
|
|
5173
|
-
readonly maxWait: MaxWaitSupport;
|
|
5174
|
-
/** Why `maxWait` cannot be honored. Required when `maxWait` is unsupported. */
|
|
5175
|
-
readonly maxWaitReason?: string;
|
|
5176
|
-
}
|
|
5177
|
-
/** The `$transaction` form the options were passed to. */
|
|
5178
|
-
type TransactionForm = "callback" | "batch";
|
|
5179
|
-
/** What the driver layer must act on. `timeout` never reaches a driver. */
|
|
5180
|
-
interface DriverTransactionOptions {
|
|
5181
|
-
/** Set only when the driver's placement is `"pre-begin"`. */
|
|
5182
|
-
readonly isolationLevel?: TransactionIsolationLevel;
|
|
5183
|
-
/** Set only when the driver's max-wait mode is `"acquisition"`. */
|
|
5184
|
-
readonly maxWaitMs?: number;
|
|
5185
|
-
}
|
|
5186
|
-
/** The honored shape of a validated, driver-accepted options object. */
|
|
5187
|
-
interface TransactionPlan {
|
|
5188
|
-
readonly isolationLevel?: TransactionIsolationLevel;
|
|
5189
|
-
/** `SET TRANSACTION ISOLATION LEVEL ...`, when the driver emits SQL. */
|
|
5190
|
-
readonly isolationStatement?: string;
|
|
5191
|
-
readonly isolationPlacement: IsolationLevelPlacement;
|
|
5192
|
-
readonly timeoutMs?: number;
|
|
5193
|
-
readonly maxWaitMs?: number;
|
|
5194
|
-
readonly maxWaitMode: MaxWaitSupport;
|
|
5195
|
-
/** The subset the driver's own `transaction()` must act on. */
|
|
5196
|
-
readonly driverOptions?: DriverTransactionOptions;
|
|
5197
|
-
}
|
|
5198
|
-
//#endregion
|
|
5199
5270
|
//#region src/client/omit.d.ts
|
|
5200
5271
|
/** Fields a client hides by default, per model key of the schema. */
|
|
5201
5272
|
type ClientOmitConfig<S$1 extends Record<string, AnyModel>> = { [K in keyof S$1]?: ClientModelOmit<S$1[K]> };
|
|
@@ -5324,11 +5395,13 @@ type NoExtraDriverConfigKeys<Given, Options$1, S$1 extends Schema$1> = Record<Ex
|
|
|
5324
5395
|
*/
|
|
5325
5396
|
type TransactionClient<C$1 extends VibORMConfig, X$1 extends ExtensionStateConstraint = EmptyClientExtensionState> = ExtensionModelClient<C$1, X$1> & RawSurface & {
|
|
5326
5397
|
readonly $schema: ClientSchema<C$1>;
|
|
5327
|
-
$transaction:
|
|
5328
|
-
<T$1>(fn: (tx: TransactionClient<C$1, X$1>) => PromiseLike<T$1>, options?: TransactionOptions): Promise<T$1>;
|
|
5329
|
-
<T$1 extends BatchTransactionOperation<unknown>[]>(operations: [...T$1], options?: BatchTransactionOptions): Promise<{ [K in keyof T$1]: Awaited<T$1[K]> }>;
|
|
5330
|
-
};
|
|
5398
|
+
$transaction: TransactionMethod<C$1, X$1>;
|
|
5331
5399
|
} & X$1["client"];
|
|
5400
|
+
/** `$transaction`'s two forms: an interactive callback, or a batch array. */
|
|
5401
|
+
type TransactionMethod<C$1 extends VibORMConfig, X$1 extends ExtensionStateConstraint> = {
|
|
5402
|
+
<T$1>(fn: (tx: TransactionClient<C$1, X$1>) => PromiseLike<T$1>, options?: TransactionOptions): Promise<T$1>;
|
|
5403
|
+
<T$1 extends BatchTransactionOperation<unknown>[]>(operations: [...T$1], options?: BatchTransactionOptions): Promise<{ [K in keyof T$1]: Awaited<T$1[K]> }>;
|
|
5404
|
+
};
|
|
5332
5405
|
/**
|
|
5333
5406
|
* Extended client type with utility methods
|
|
5334
5407
|
*/
|
|
@@ -5381,10 +5454,7 @@ interface VibORMClientMembers<C$1 extends VibORMConfig, X$1 extends ExtensionSta
|
|
|
5381
5454
|
* The array form takes `isolationLevel` only: a preplanned array has no
|
|
5382
5455
|
* interactive window for `timeout` or `maxWait` to bound.
|
|
5383
5456
|
*/
|
|
5384
|
-
$transaction:
|
|
5385
|
-
<T$1>(fn: (tx: TransactionClient<C$1, X$1>) => PromiseLike<T$1>, options?: TransactionOptions): Promise<T$1>;
|
|
5386
|
-
<T$1 extends BatchTransactionOperation<unknown>[]>(operations: [...T$1], options?: BatchTransactionOptions): Promise<{ [K in keyof T$1]: Awaited<T$1[K]> }>;
|
|
5387
|
-
};
|
|
5457
|
+
$transaction: TransactionMethod<C$1, X$1>;
|
|
5388
5458
|
/** Connect to the database */
|
|
5389
5459
|
$connect: () => Promise<void>;
|
|
5390
5460
|
/** Disconnect from the database */
|
|
@@ -5582,7 +5652,7 @@ declare const s: {
|
|
|
5582
5652
|
}>;
|
|
5583
5653
|
json: <Db extends NativeDialect = never, const Given extends ExactNativeTypeMap<Given> = never>(nativeType?: NativeTypeArgument<Db, Given>) => JsonScalar<InitialScalarState<"json", JsonSchema<JsonInput, JsonValue>>>;
|
|
5584
5654
|
blob: <Db extends NativeDialect = never, const Given extends ExactNativeTypeMap<Given> = never>(nativeType?: NativeTypeArgument<Db, Given>) => BlobScalar<InitialScalarState<"blob", BlobSchema<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>>;
|
|
5585
|
-
enum: <const T$1 extends string[], Db extends NativeDialect = never, const Given extends ExactNativeTypeMap<Given> = never>(values: T$1, nativeType?: NativeTypeArgument<Db, Given>) => EnumScalar<InitialScalarState<"enum", EnumSchema<T$1, T$1[number], T$1[number]>>>;
|
|
5655
|
+
enum: <const T$1 extends string[] | readonly string[], Db extends NativeDialect = never, const Given extends ExactNativeTypeMap<Given> = never>(values: T$1, nativeType?: NativeTypeArgument<Db, Given>) => EnumScalar<InitialScalarState<"enum", EnumSchema<T$1, T$1[number], T$1[number]>>>;
|
|
5586
5656
|
point: typeof point;
|
|
5587
5657
|
vector: <Db extends NativeDialect = never, const Given extends ExactNativeTypeMap<Given> = never>(nativeType?: NativeTypeArgument<Db, Given>) => VectorScalar<InitialScalarState<"vector", VectorSchema<number[], number[]> & {
|
|
5588
5658
|
dimensions?: number;
|
|
@@ -6558,9 +6628,9 @@ type GenerationChoice<State$1 extends ScalarState<"string">, Given> = Given exte
|
|
|
6558
6628
|
generate: infer Choice extends boolean | undefined;
|
|
6559
6629
|
} ? Choice : undefined;
|
|
6560
6630
|
type HasCustomDefault<State$1 extends ScalarState<"string">> = State$1["default"] extends GeneratorDefaultBrand ? false : State$1["hasDefault"];
|
|
6561
|
-
type FormatState<State$1 extends ScalarState<"string">, Given, Kind extends IdentifierKind = IdentifierKind> = {
|
|
6631
|
+
type FormatState<State$1 extends ScalarState<"string">, Given, Kind$1 extends IdentifierKind = IdentifierKind> = {
|
|
6562
6632
|
autoGenerate: AutoGenerate & {
|
|
6563
|
-
kind: Kind;
|
|
6633
|
+
kind: Kind$1;
|
|
6564
6634
|
implicit?: undefined;
|
|
6565
6635
|
generate: GenerationChoice<State$1, Given>;
|
|
6566
6636
|
};
|
|
@@ -6884,15 +6954,15 @@ type VectorSortOrderSchema = typeof vectorSortOrderSchema;
|
|
|
6884
6954
|
type ModelStateOf$7<M$1 extends AnyModel> = M$1["~"]["state"];
|
|
6885
6955
|
type ModelScalars$2<M$1 extends AnyModel> = ModelStateOf$7<M$1>["scalars"];
|
|
6886
6956
|
type ModelScalarKey<M$1 extends AnyModel> = StringKeyOf<ModelScalars$2<M$1>>;
|
|
6887
|
-
type ScalarStateOf$
|
|
6957
|
+
type ScalarStateOf$3<F$1> = F$1 extends {
|
|
6888
6958
|
"~": {
|
|
6889
6959
|
state: infer S;
|
|
6890
6960
|
};
|
|
6891
6961
|
} ? S extends ScalarState ? S : never : never;
|
|
6892
6962
|
type ModelDecimalListScalarKeys<M$1 extends AnyModel> = Extract<DecimalListScalarKeys<ModelScalars$2<M$1>>, ModelScalarKey<M$1>>;
|
|
6893
6963
|
type OrderableScalarKeys<M$1 extends AnyModel> = Exclude<ModelScalarKey<M$1>, ModelDecimalListScalarKeys<M$1> | PointScalarKeys$2<M$1>>;
|
|
6894
|
-
type VectorScalarKeys$1<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$
|
|
6895
|
-
type PointScalarKeys$2<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$
|
|
6964
|
+
type VectorScalarKeys$1<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$3<ModelScalars$2<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars$2<M$1>];
|
|
6965
|
+
type PointScalarKeys$2<M$1 extends AnyModel> = { [K in keyof ModelScalars$2<M$1>]: ScalarStateOf$3<ModelScalars$2<M$1>[K]>["type"] extends "point" ? K extends string ? K : never : never }[keyof ModelScalars$2<M$1>];
|
|
6896
6966
|
type NonVectorScalarKeys<M$1 extends AnyModel> = Exclude<OrderableScalarKeys<M$1>, VectorScalarKeys$1<M$1>>;
|
|
6897
6967
|
/** A decimal list has equality semantics, but no portable numeric ordering. */
|
|
6898
6968
|
|
|
@@ -6911,12 +6981,12 @@ type OrderBySchema<M$1 extends AnyModel, F$1 extends ScalarSchemas<M$1>> = V$1.O
|
|
|
6911
6981
|
type ModelStateOf$6<M$1 extends AnyModel> = M$1["~"]["state"];
|
|
6912
6982
|
type ModelScalars$1<M$1 extends AnyModel> = ModelStateOf$6<M$1>["scalars"];
|
|
6913
6983
|
type ModelDecimalListScalarKey<M$1 extends AnyModel> = DecimalListScalarKeys<ModelScalars$1<M$1>>;
|
|
6914
|
-
type ScalarStateOf$
|
|
6984
|
+
type ScalarStateOf$2<F$1> = F$1 extends {
|
|
6915
6985
|
"~": {
|
|
6916
6986
|
state: infer S;
|
|
6917
6987
|
};
|
|
6918
6988
|
} ? S extends ScalarState ? S : never : never;
|
|
6919
|
-
type VectorScalarKey<M$1 extends AnyModel> = { [K in keyof ModelScalars$1<M$1>]: ScalarStateOf$
|
|
6989
|
+
type VectorScalarKey<M$1 extends AnyModel> = { [K in keyof ModelScalars$1<M$1>]: ScalarStateOf$2<ModelScalars$1<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars$1<M$1>];
|
|
6920
6990
|
type NonVectorScalarKey<M$1 extends AnyModel> = Exclude<OrderableScalarKeys<M$1>, VectorScalarKey<M$1>>;
|
|
6921
6991
|
type ModelScalarOrderByEntries<M$1 extends AnyModel> = V$1.FromKeys<NonVectorScalarKey<M$1>[], SortOrderSchema>["entries"] & V$1.FromKeys<VectorScalarKey<M$1>[], VectorSortOrderSchema>["entries"] & V$1.FromKeys<ModelDecimalListScalarKey<M$1>[], DecimalListOrderByRefusalSchema>["entries"];
|
|
6922
6992
|
/**
|
|
@@ -6973,12 +7043,8 @@ type PaginationSkipSchema = V$1.Schema<number, number>;
|
|
|
6973
7043
|
type BulkWriteLimitSchema = V$1.Schema<number, number>;
|
|
6974
7044
|
//#endregion
|
|
6975
7045
|
//#region src/validation/relations/select-include.d.ts
|
|
6976
|
-
declare const unavailableRecurrence: () => OptionalSchema<VibSchema<never, never>, undefined, undefined, undefined>;
|
|
6977
|
-
declare const unavailableRecursiveClause: (clause: string) => OptionalSchema<VibSchema<never, never>, undefined, undefined, undefined>;
|
|
6978
7046
|
/** The asking key cannot have a second producer inside its own repeated node. */
|
|
6979
7047
|
declare const askingKeyRefusal: (key: string) => OptionalSchema<VibSchema<never, never>, undefined, undefined, undefined>;
|
|
6980
|
-
type UnavailableRecurrenceSchema = ReturnType<typeof unavailableRecurrence>;
|
|
6981
|
-
type RecurrenceFor<Source extends AnyModel, Key$1, S$1 extends RelationState> = StaticRecursiveMembership<Source, Key$1, S$1> extends StaticForeignKeyMembership ? ForeignKeyRecurrenceSchema : StaticRecursiveMembership<Source, Key$1, S$1> extends StaticJunctionMembership ? GraphRecurrenceSchema : never;
|
|
6982
7048
|
/** A target projection whose asking key is refused, keeping its options. */
|
|
6983
7049
|
type ProjectionWithoutAsking<Schema$4 extends V$1.Object<any, any>, Key$1> = V$1.Object<Omit<Schema$4["entries"], Extract<Key$1, keyof Schema$4["entries"]>> & Record<Extract<Key$1, string>, ReturnType<typeof askingKeyRefusal>>>;
|
|
6984
7050
|
type RecursiveProjectionSchemas<S$1 extends RelationState, Key$1> = {
|
|
@@ -6987,8 +7053,8 @@ type RecursiveProjectionSchemas<S$1 extends RelationState, Key$1> = {
|
|
|
6987
7053
|
};
|
|
6988
7054
|
type ToOneRecursiveNodeSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = IncludeToField<V$1.Object<{
|
|
6989
7055
|
recurse: RecurrenceFor<Source, Key$1, S$1>;
|
|
6990
|
-
where:
|
|
6991
|
-
orderBy:
|
|
7056
|
+
where: UnavailableRecursiveClauseSchema;
|
|
7057
|
+
orderBy: UnavailableRecursiveClauseSchema;
|
|
6992
7058
|
select: () => RecursiveProjectionSchemas<S$1, Key$1>["select"];
|
|
6993
7059
|
include: () => RecursiveProjectionSchemas<S$1, Key$1>["include"];
|
|
6994
7060
|
omit: () => GetTargetSchemas<S$1>["core"]["omit"];
|
|
@@ -7077,10 +7143,10 @@ type ToManyNestedNodeSchema<Core$1 extends ToManyNestedTargetCore, Distinct> = I
|
|
|
7077
7143
|
type ToManyRecursiveNodeSchema<Source extends AnyModel, Key$1, S$1 extends RelationState> = IncludeToField<V$1.Object<{
|
|
7078
7144
|
where: () => GetTargetSchemas<S$1>["core"]["where"];
|
|
7079
7145
|
orderBy: () => V$1.Union<readonly [GetTargetSchemas<S$1>["core"]["orderBy"], V$1.Array<GetTargetSchemas<S$1>["core"]["orderBy"]>]>;
|
|
7080
|
-
take:
|
|
7081
|
-
skip:
|
|
7082
|
-
cursor:
|
|
7083
|
-
distinct:
|
|
7146
|
+
take: UnavailableRecursiveClauseSchema;
|
|
7147
|
+
skip: UnavailableRecursiveClauseSchema;
|
|
7148
|
+
cursor: UnavailableRecursiveClauseSchema;
|
|
7149
|
+
distinct: UnavailableRecursiveClauseSchema;
|
|
7084
7150
|
select: () => RecursiveProjectionSchemas<S$1, Key$1>["select"];
|
|
7085
7151
|
include: () => RecursiveProjectionSchemas<S$1, Key$1>["include"];
|
|
7086
7152
|
omit: () => GetTargetSchemas<S$1>["core"]["omit"];
|
|
@@ -7233,7 +7299,7 @@ type ToOneSchemas<Source extends AnyModel, Key$1, S$1 extends RelationState> = {
|
|
|
7233
7299
|
countFilter: CountFilterSchema<S$1>;
|
|
7234
7300
|
};
|
|
7235
7301
|
type ToManySchemas<Source extends AnyModel, Key$1, S$1 extends RelationState> = {
|
|
7236
|
-
filter: ToManyFilterSchema<S$1>;
|
|
7302
|
+
filter: ToManyFilterSchema<Source, Key$1, S$1>;
|
|
7237
7303
|
create: ToManyCreateSchema<Source, Key$1, S$1>;
|
|
7238
7304
|
update: ToManyUpdateSchema<Source, Key$1, S$1>;
|
|
7239
7305
|
select: ToManySelectSchema<Source, Key$1, S$1>;
|
|
@@ -8203,7 +8269,7 @@ type DecimalCreateSchema<F$1 extends ScalarState<"decimal">> = F$1["hasDefault"]
|
|
|
8203
8269
|
* fragment, or a callback returning one of the latter two.
|
|
8204
8270
|
*/
|
|
8205
8271
|
type EnumOperand<S$1 extends V$1.Schema, C$1 extends V$1.Operand<any>> = V$1.ComparisonOperand<"enum", S$1, C$1>;
|
|
8206
|
-
type EnumFilterBase<S$1 extends V$1.Schema, Values extends string[], C$1 extends V$1.Operand<any>> = {
|
|
8272
|
+
type EnumFilterBase<S$1 extends V$1.Schema, Values extends readonly string[], C$1 extends V$1.Operand<any>> = {
|
|
8207
8273
|
equals: EnumOperand<S$1, C$1>;
|
|
8208
8274
|
in: V$1.Enum<Values, {
|
|
8209
8275
|
array: true;
|
|
@@ -8216,20 +8282,20 @@ type EnumFilterBase<S$1 extends V$1.Schema, Values extends string[], C$1 extends
|
|
|
8216
8282
|
gt: V$1.Schema<never, never>;
|
|
8217
8283
|
gte: V$1.Schema<never, never>;
|
|
8218
8284
|
};
|
|
8219
|
-
type EnumFilterSchema<S$1 extends V$1.Schema, Values extends string[], C$1 extends V$1.Operand<any>> = NegatableFilterSchema<EnumOperand<S$1, C$1>, EnumFilterBase<S$1, Values, C$1>>;
|
|
8285
|
+
type EnumFilterSchema<S$1 extends V$1.Schema, Values extends readonly string[], C$1 extends V$1.Operand<any>> = NegatableFilterSchema<EnumOperand<S$1, C$1>, EnumFilterBase<S$1, Values, C$1>>;
|
|
8220
8286
|
/**
|
|
8221
8287
|
* The list arms are the shared family, built PER FIELD: an enum's member and
|
|
8222
8288
|
* list schemas are a function of that field's declared values, so unlike every
|
|
8223
8289
|
* other kind there is no module-level pair to close over — and, for the same
|
|
8224
8290
|
* reason, no interning (a key would have to carry the whole value list).
|
|
8225
8291
|
*/
|
|
8226
|
-
type EnumListFilterSchema<S$1 extends V$1.Schema, Values extends string[]> = ListFilterSchema<S$1, V$1.Enum<Values>, V$1.Enum<Values, {
|
|
8292
|
+
type EnumListFilterSchema<S$1 extends V$1.Schema, Values extends readonly string[]> = ListFilterSchema<S$1, V$1.Enum<Values>, V$1.Enum<Values, {
|
|
8227
8293
|
array: true;
|
|
8228
8294
|
}>>;
|
|
8229
|
-
type EnumListUpdateSchema<S$1 extends V$1.Schema, Values extends string[]> = ListUpdateSchema<S$1, V$1.Enum<Values>, V$1.Enum<Values, {
|
|
8295
|
+
type EnumListUpdateSchema<S$1 extends V$1.Schema, Values extends readonly string[]> = ListUpdateSchema<S$1, V$1.Enum<Values>, V$1.Enum<Values, {
|
|
8230
8296
|
array: true;
|
|
8231
8297
|
}>>;
|
|
8232
|
-
interface EnumSchemas<Values extends string[], F$1 extends ScalarState<"enum">, C$1 extends V$1.Operand<any> = V$1.Operand<any>> {
|
|
8298
|
+
interface EnumSchemas<Values extends readonly string[], F$1 extends ScalarState<"enum">, C$1 extends V$1.Operand<any> = V$1.Operand<any>> {
|
|
8233
8299
|
base: F$1["base"];
|
|
8234
8300
|
create: V$1.Enum<Values, F$1>;
|
|
8235
8301
|
update: F$1["array"] extends true ? EnumListUpdateSchema<F$1["base"], Values> : SetUpdateSchema<F$1["base"]>;
|
|
@@ -8312,9 +8378,16 @@ type JsonUpdateSchema<F$1 extends ScalarState<"json">, S$1 extends V$1.Schema> =
|
|
|
8312
8378
|
}>, V$1.Coerce<JsonWriteOperand<F$1, S$1>, {
|
|
8313
8379
|
set: JsonWriteOperand<F$1, S$1>[" vibInferred"]["1"];
|
|
8314
8380
|
}>]>;
|
|
8381
|
+
/**
|
|
8382
|
+
* The create schema reads the same envelope (see {@link isSetEnvelope}), so it
|
|
8383
|
+
* takes what an update takes and yields the value it stores.
|
|
8384
|
+
*/
|
|
8385
|
+
type JsonCreateSchema<F$1 extends ScalarState<"json">, S$1 extends V$1.Schema> = VibSchema<V$1.Input<JsonWriteOperand<F$1, S$1>> | {
|
|
8386
|
+
set: Exclude<V$1.Input<JsonWriteOperand<F$1, S$1>>, undefined>;
|
|
8387
|
+
}, V$1.Output<JsonWriteOperand<F$1, S$1>>>;
|
|
8315
8388
|
interface JsonSchemas<F$1 extends ScalarState<"json">> {
|
|
8316
8389
|
base: F$1["base"];
|
|
8317
|
-
create:
|
|
8390
|
+
create: JsonCreateSchema<F$1, V$1.Json<F$1>>;
|
|
8318
8391
|
update: JsonUpdateSchema<F$1, F$1["base"]>;
|
|
8319
8392
|
filter: JsonFilterSchema<V$1.Json>;
|
|
8320
8393
|
}
|
|
@@ -8668,13 +8741,13 @@ type ProjectableScalarKeys<M$1 extends AnyModel> = Exclude<StringKeyOf<ModelStat
|
|
|
8668
8741
|
*/
|
|
8669
8742
|
type ModelStateOf$2<M$1 extends AnyModel> = M$1["~"]["state"];
|
|
8670
8743
|
type ModelScalars<M$1 extends AnyModel> = ModelStateOf$2<M$1>["scalars"];
|
|
8671
|
-
type ScalarStateOf<F$1> = F$1 extends {
|
|
8744
|
+
type ScalarStateOf$1<F$1> = F$1 extends {
|
|
8672
8745
|
"~": {
|
|
8673
8746
|
state: infer S;
|
|
8674
8747
|
};
|
|
8675
8748
|
} ? S extends ScalarState ? S : never : never;
|
|
8676
|
-
type AnyVectorScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf<ModelScalars<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
|
|
8677
|
-
type AnyPointScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf<ModelScalars<M$1>[K]>["type"] extends "point" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
|
|
8749
|
+
type AnyVectorScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf$1<ModelScalars<M$1>[K]>["type"] extends "vector" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
|
|
8750
|
+
type AnyPointScalarKeys<M$1 extends AnyModel> = { [K in keyof ModelScalars<M$1>]: ScalarStateOf$1<ModelScalars<M$1>[K]>["type"] extends "point" ? K extends string ? K : never : never }[keyof ModelScalars<M$1>];
|
|
8678
8751
|
/**
|
|
8679
8752
|
* Both halves of the select schema are keyed on {@link ProjectableScalarKeys},
|
|
8680
8753
|
* so a model-level `.omit()`-ed scalar has no `select` entry at all: naming it
|
|
@@ -8835,9 +8908,20 @@ declare const pointScalarSelectSchema: UnionSchema<readonly [BooleanSchema<boole
|
|
|
8835
8908
|
}>>;
|
|
8836
8909
|
}>>;
|
|
8837
8910
|
type PointScalarSelectSchema = typeof pointScalarSelectSchema;
|
|
8911
|
+
/**
|
|
8912
|
+
* A written `select` names what the row carries, so one that names nothing
|
|
8913
|
+
* (`{}`, only `false`, or a `_count` that counts no relation, as `_count: true`
|
|
8914
|
+
* does on a model with no to-many relation) is a caller mistake, refused at its
|
|
8915
|
+
* own path. Leaving `select` out is how a caller asks for the default row.
|
|
8916
|
+
*/
|
|
8917
|
+
declare const requireSelectedField: (select: Record<string, unknown>) => string | undefined;
|
|
8918
|
+
/** The refusal every written `select` carries ({@link requireSelectedField}). */
|
|
8919
|
+
type SelectRefusal = {
|
|
8920
|
+
readonly refuse: typeof requireSelectedField;
|
|
8921
|
+
};
|
|
8838
8922
|
type SelectSchema<M$1 extends AnyModel, F$1 extends ScalarSchemas<M$1>> = V$1.Object<V$1.FromKeys<PlainScalarKeys<M$1>[], typeof scalarSelectSchema>["entries"] & V$1.FromKeys<VectorScalarKeys<M$1>[], VectorScalarSelectSchema>["entries"] & V$1.FromKeys<PointScalarKeys$1<M$1>[], PointScalarSelectSchema>["entries"] & V$1.FromObject<F$1["relations"], "select">["entries"] & V$1.FromObject<F$1["polymorphic"], "select">["entries"] & {
|
|
8839
8923
|
_count: CountSchema<F$1>;
|
|
8840
|
-
}>;
|
|
8924
|
+
}, SelectRefusal>;
|
|
8841
8925
|
/**
|
|
8842
8926
|
* The SCALAR-ONLY projection: {@link SelectSchema} without relation keys and
|
|
8843
8927
|
* without `_count`.
|
|
@@ -8859,7 +8943,7 @@ type SelectSchema<M$1 extends AnyModel, F$1 extends ScalarSchemas<M$1>> = V$1.Ob
|
|
|
8859
8943
|
* `<Model>SelectCreateManyAndReturn` / `<Model>IncludeCreateManyAndReturn` types
|
|
8860
8944
|
* (prisma 6.8.2, `prisma-client/generator-build`, `Model.argsTypes`).
|
|
8861
8945
|
*/
|
|
8862
|
-
type ScalarSelectSchema<M$1 extends AnyModel> = V$1.Object<V$1.FromKeys<PlainScalarKeys<M$1>[], typeof scalarSelectSchema>["entries"] & V$1.FromKeys<VectorScalarKeys<M$1>[], VectorScalarSelectSchema>["entries"] & V$1.FromKeys<PointScalarKeys$1<M$1>[], PointScalarSelectSchema>["entries"]>;
|
|
8946
|
+
type ScalarSelectSchema<M$1 extends AnyModel> = V$1.Object<V$1.FromKeys<PlainScalarKeys<M$1>[], typeof scalarSelectSchema>["entries"] & V$1.FromKeys<VectorScalarKeys<M$1>[], VectorScalarSelectSchema>["entries"] & V$1.FromKeys<PointScalarKeys$1<M$1>[], PointScalarSelectSchema>["entries"], SelectRefusal>;
|
|
8863
8947
|
/**
|
|
8864
8948
|
* Build include schema - nested include for each relation
|
|
8865
8949
|
*/
|
|
@@ -9943,7 +10027,8 @@ type SingularFieldTree<M$1> = M$1 extends {
|
|
|
9943
10027
|
} ? { [V in keyof Entries]: Entries[V] extends {
|
|
9944
10028
|
readonly getter: () => infer Next;
|
|
9945
10029
|
} ? SingularFieldTree<Next> : never } : never : true } : never;
|
|
9946
|
-
type
|
|
10030
|
+
type TreeEntries<S$1> = { [J in keyof S$1]-?: [SingularFieldTree<S$1[J]>, J] }[keyof S$1];
|
|
10031
|
+
type SchemaKeyOf<S$1, T$1> = Extract<TreeEntries<S$1>, [SingularFieldTree<T$1>, unknown]> extends infer Hit ? Hit extends [infer Tree, infer J extends keyof S$1] ? [SingularFieldTree<T$1>] extends [Tree] ? IsIdentical<S$1[J], T$1> extends true ? J : never : never : never : never;
|
|
9947
10032
|
type TargetLinks<S$1, Target$1> = Target$1 extends {
|
|
9948
10033
|
readonly kind: "model";
|
|
9949
10034
|
readonly getter: infer G;
|
|
@@ -9954,29 +10039,43 @@ type TargetLinks<S$1, Target$1> = Target$1 extends {
|
|
|
9954
10039
|
readonly getter: infer G;
|
|
9955
10040
|
} ? G extends (() => infer M) ? SchemaKeyOf<S$1, M> : never : never } : never;
|
|
9956
10041
|
/** Resolve while the producer still owns the exact getter types. */
|
|
9957
|
-
type RelationLinks<S$1 extends Schema$1> = { [K in keyof S$1]: { [R in keyof S$1[K]["~"]["state"]["relations"]]: TargetLinks<S$1, S$1[K]["~"]["state"]["relations"][R]["~"]["state"]["target"]> } }
|
|
10042
|
+
type RelationLinks<S$1 extends Schema$1> = { [K in keyof S$1]: { [R in keyof S$1[K]["~"]["state"]["relations"]]: TargetLinks<S$1, S$1[K]["~"]["state"]["relations"][R]["~"]["state"]["target"]> } };
|
|
9958
10043
|
type LinkAt<L$1, K$1, R$1> = K$1 extends keyof L$1 ? R$1 extends keyof L$1[K$1] ? L$1[K$1][R$1] : never : never;
|
|
9959
10044
|
type VariantLink<T$1, V$2> = V$2 extends keyof T$1 ? T$1[V$2] : never;
|
|
9960
10045
|
/** Clone every state fact inline; no alias retains the original recursive shape. */
|
|
9961
|
-
type FlatSchema<S$1 extends Schema$1, L$1> = { [K in keyof S$1]: S$1[K] extends Model$1<infer State> ? Model$1<{ [P in keyof State]: P extends "shape" | "relations" ? { [F in keyof State[P]]: State[P][F] extends AnyRelation ? State[P][F]["~"]["state"] extends infer RS extends RelationState ? RS extends ModelToOneState ? ModelToOneRelation<{ [Q in keyof RS]: Q extends "target" ? [LinkAt<L$1, K, F>] extends [never] ? RS[Q]
|
|
10046
|
+
type FlatSchema<S$1 extends Schema$1, L$1> = { [K in keyof S$1]: S$1[K] extends Model$1<infer State> ? Model$1<{ [P in keyof State]: P extends "shape" | "relations" ? { [F in keyof State[P]]: State[P][F] extends AnyRelation ? State[P][F]["~"]["state"] extends infer RS extends RelationState ? RS extends ModelToOneState ? ModelToOneRelation<{ [Q in keyof RS]: Q extends "target" ? { [T in keyof RS[Q]]: T extends "getter" ? [LinkAt<L$1, K, F>] extends [never] ? RS[Q][T] : unknown : RS[Q][T] } : RS[Q] }> : RS extends ModelToManyState ? ModelToManyRelation<{ [Q in keyof RS]: Q extends "target" ? { [T in keyof RS[Q]]: T extends "getter" ? [LinkAt<L$1, K, F>] extends [never] ? RS[Q][T] : unknown : RS[Q][T] } : RS[Q] }> : RS extends VariantToOneState ? VariantToOneRelation<{ [Q in keyof RS]: Q extends "target" ? RS[Q] extends {
|
|
9962
10047
|
readonly entries: infer Entries;
|
|
9963
10048
|
} ? { [T in keyof RS[Q]]: T extends "entries" ? { [V in keyof Entries]: { [E in keyof Entries[V]]: E extends "getter" ? [VariantLink<LinkAt<L$1, K, F>, V>] extends [never] ? Entries[V][E] : unknown : Entries[V][E] } } : RS[Q][T] } : RS[Q] : RS[Q] }> : RS extends VariantToManyState ? VariantToManyRelation<{ [Q in keyof RS]: Q extends "target" ? RS[Q] extends {
|
|
9964
10049
|
readonly entries: infer Entries;
|
|
9965
10050
|
} ? { [T in keyof RS[Q]]: T extends "entries" ? { [V in keyof Entries]: { [E in keyof Entries[V]]: E extends "getter" ? [VariantLink<LinkAt<L$1, K, F>, V>] extends [never] ? Entries[V][E] : unknown : Entries[V][E] } } : RS[Q][T] } : RS[Q] : RS[Q] }> : State[P][F] : State[P][F] : State[P][F] } : P extends "scalars" | "uniques" ? { [F in keyof State[P]]: State[P][F] } : P extends "compoundId" | "compoundUniques" ? State[P] extends infer Constraints extends State[P] ? Constraints extends object ? { [F in keyof Constraints]: Constraints[F] extends ObjectSchema<infer Entries, infer Options, infer Input, infer Output> ? ObjectSchema<{ [E in keyof Entries]: Entries[E] }, Options, Input extends object ? { [E in keyof Input]: Input[E] } : Input, Output extends object ? { [E in keyof Output]: Output[E] } : Output> : Constraints[F] } : Constraints : never : State[P] }> : never };
|
|
9966
|
-
|
|
10051
|
+
/** One linked target; a union of twin keys answers a union of targets. */
|
|
10052
|
+
type LinkedTarget<S$1 extends Schema$1, L$1, J$1> = J$1 extends keyof S$1 ? Linked<S$1, L$1, J$1> : never;
|
|
10053
|
+
type RepointTarget<Target$1, S$1 extends Schema$1, L$1, K$1, F$1> = Target$1 extends {
|
|
9967
10054
|
readonly kind: "model";
|
|
9968
|
-
} ? [
|
|
10055
|
+
} ? { [P in keyof Target$1]: P extends "getter" ? Target$1[P] extends (() => unknown) ? Target$1[P] : () => LinkedTarget<S$1, L$1, LinkAt<L$1, K$1, F$1>> : Target$1[P] } : Target$1 extends {
|
|
9969
10056
|
readonly kind: "variants";
|
|
9970
10057
|
readonly entries: infer Entries;
|
|
9971
|
-
} ?
|
|
9972
|
-
type
|
|
9973
|
-
type
|
|
9974
|
-
|
|
9975
|
-
|
|
10058
|
+
} ? RepointVariants<Target$1, Entries, LinkAt<L$1, K$1, F$1>, S$1, L$1> : Target$1;
|
|
10059
|
+
type RepointVariants<Target$1, Entries$1, Link, S$1 extends Schema$1, L$1> = { [P in keyof Target$1]: P extends "entries" ? { [V in keyof Entries$1]: { [E in keyof Entries$1[V]]: E extends "getter" ? VariantLink<Link, V> extends infer J ? [J] extends [never] ? Entries$1[V][E] : J extends keyof S$1 ? () => Linked<S$1, L$1, J> : Entries$1[V][E] : Entries$1[V][E] : Entries$1[V][E] } } : Target$1[P] };
|
|
10060
|
+
type RepointState<State$1, S$1 extends Schema$1, L$1, K$1, F$1> = { [P in keyof State$1]: P extends "target" ? RepointTarget<State$1[P], S$1, L$1, K$1, F$1> : State$1[P] };
|
|
10061
|
+
type LinkedRelation<R$1, S$1 extends Schema$1, L$1, K$1, F$1> = R$1 extends {
|
|
10062
|
+
readonly "~": {
|
|
10063
|
+
readonly state: infer State;
|
|
10064
|
+
};
|
|
10065
|
+
} ? State extends SlotKind<"one", "model"> ? ModelToOneRelation<RepointState<State, S$1, L$1, K$1, F$1>> : State extends SlotKind<"many", "model"> ? ModelToManyRelation<RepointState<State, S$1, L$1, K$1, F$1>> : State extends SlotKind<"one", "variants"> ? VariantToOneRelation<RepointState<State, S$1, L$1, K$1, F$1>> : State extends SlotKind<"many", "variants"> ? VariantToManyRelation<RepointState<State, S$1, L$1, K$1, F$1>> : R$1 : R$1;
|
|
10066
|
+
type SlotKind<Cardinality$1, Kind$1> = {
|
|
10067
|
+
readonly kind: "relation";
|
|
10068
|
+
readonly cardinality: Cardinality$1;
|
|
10069
|
+
readonly target: {
|
|
10070
|
+
readonly kind: Kind$1;
|
|
10071
|
+
};
|
|
10072
|
+
};
|
|
10073
|
+
/** Relinking operates only on the already-flat schema and its literal links. */
|
|
10074
|
+
type LinkedState<S$1 extends Schema$1, L$1, K$1 extends keyof S$1> = S$1[K$1] extends Model$1<infer State> ? { [P in keyof State]: P extends "shape" | "relations" ? { [F in keyof State[P]]: LinkedRelation<State[P][F], S$1, L$1, K$1, F> } : State[P] } : never;
|
|
9976
10075
|
type Linked<S$1 extends Schema$1, L$1, K$1 extends keyof S$1> = Model$1<LinkedState<S$1, L$1, K$1>>;
|
|
9977
10076
|
type SchemaRelationKeys<S$1 extends Schema$1> = { [K in keyof S$1]: keyof S$1[K]["~"]["state"]["relations"] }[keyof S$1];
|
|
9978
10077
|
/** Only a finite schema with relations has getter facts to carry. */
|
|
9979
|
-
type SchemaLinks<S$1 extends Schema$1> = string extends keyof S$1 ? never : [SchemaRelationKeys<S$1>] extends [never] ? never : RelationLinks<S$1
|
|
10078
|
+
type SchemaLinks<S$1 extends Schema$1> = string extends keyof S$1 ? never : [SchemaRelationKeys<S$1>] extends [never] ? never : RelationLinks<S$1> extends infer U ? { [K in keyof U]: U[K] } : never;
|
|
9980
10079
|
type SchemaSnapshot<S$1 extends Schema$1, L$1> = { [K in keyof S$1]: [L$1] extends [never] ? S$1[K] : FlatSchema<S$1, L$1>[K] };
|
|
9981
10080
|
type SchemaModel<S$1 extends Schema$1, L$1, K$1 extends keyof S$1> = [L$1] extends [undefined] ? S$1[K$1] : Linked<S$1, L$1, K$1>;
|
|
9982
10081
|
/** Raw aliases and carried configs share the same schema-only model view. */
|
|
@@ -10610,6 +10709,9 @@ declare const defaultOperationResultArgs: unique symbol;
|
|
|
10610
10709
|
type DefaultOperationResultArgs = typeof defaultOperationResultArgs;
|
|
10611
10710
|
type ResolvedOperationResultArgs<Args, Merged> = Merged extends DefaultOperationResultArgs ? Args : Merged;
|
|
10612
10711
|
type ResolvedOperationResultOmit<Args, DefaultOmit, Merged> = Merged extends DefaultOperationResultArgs ? MergeClientOmit<DefaultOmit, NodeOmit<Args>> : NodeOmit<Merged>;
|
|
10712
|
+
/** The verbs whose result is the selected row, wrapped by cardinality. */
|
|
10713
|
+
type RowOperation = "findFirst" | "findUnique" | "findFirstOrThrow" | "findUniqueOrThrow" | "findMany" | "create" | "update" | "delete" | "upsert";
|
|
10714
|
+
type RowCardinality<O$1, Row> = O$1 extends "findFirst" | "findUnique" ? Row | null : O$1 extends "findMany" ? Row[] : Row;
|
|
10613
10715
|
/**
|
|
10614
10716
|
* Operation result type - infers result shape based on select/include args
|
|
10615
10717
|
* This provides full type safety for ORM operation results
|
|
@@ -10622,7 +10724,7 @@ type ResolvedOperationResultOmit<Args, DefaultOmit, Merged> = Merged extends Def
|
|
|
10622
10724
|
* The private merged-args marker distinguishes ordinary public arguments from
|
|
10623
10725
|
* the effective argument shape carried by one concrete client.
|
|
10624
10726
|
*/
|
|
10625
|
-
type OperationResultWithClientDefaults<O$1 extends Operations, M$1 extends Model$1<any>, Args, DefaultOmit, ClientDefaults, Merged = DefaultOperationResultArgs, ResultArgs = ResolvedOperationResultArgs<Args, Merged>, UnselectedOmit = ResolvedOperationResultOmit<Args, DefaultOmit, Merged>> = M$1 extends Model$1<infer S> ? O$1 extends
|
|
10727
|
+
type OperationResultWithClientDefaults<O$1 extends Operations, M$1 extends Model$1<any>, Args, DefaultOmit, ClientDefaults, Merged = DefaultOperationResultArgs, ResultArgs = ResolvedOperationResultArgs<Args, Merged>, UnselectedOmit = ResolvedOperationResultOmit<Args, DefaultOmit, Merged>> = M$1 extends Model$1<infer S> ? O$1 extends RowOperation ? RowCardinality<O$1, Prettify<InferSelectInclude<S, ResultArgs, NodeSelect<ResultArgs>, UnselectedOmit, ClientDefaults>>> : O$1 extends "createMany" | "updateMany" | "deleteMany" ? BulkWriteResult<S, Args, DefaultOmit> : O$1 extends "count" ? CountResultType<Args> : O$1 extends "exist" ? boolean : O$1 extends "aggregate" ? AggregateResultType<ExtractFields<M$1>, Args> : O$1 extends "groupBy" ? GroupByResultType<ExtractFields<M$1>, Args>[] : never : never;
|
|
10626
10728
|
/**
|
|
10627
10729
|
* Public operation result helper for one operation and its declared args.
|
|
10628
10730
|
* Schema-only: on a client whose extensions declare `rows`, a to-one relation
|
|
@@ -10653,7 +10755,7 @@ type StampedOperation = "create" | "createMany" | "update" | "updateMany" | "ups
|
|
|
10653
10755
|
* out, and a caller who writes one keeps its value (owner rulings, plan v4
|
|
10654
10756
|
* §7.5 and §7.1).
|
|
10655
10757
|
*/
|
|
10656
|
-
type StampedOperations<C$1 extends VibORMConfig, ClientDefaults, Controls$1, Data, K$1 extends keyof ClientSchema<C$1>> = { [O in StampedOperation]: Operation$1<O, ClientSchema<C$1>[K$1], ClientDefaultOmit<C$1, K$1>, ClientDefaults, PlacedOperationControls<Controls$1, K$1, O>, StampedPayload<O, OperationPayload<O, ClientSchema<C$1>[K$1]>, ClientSchema<C$1>[K$1], StampedFieldNames<Data, K$1>, Stamps<Data, ClientSchema<C$1>>>> };
|
|
10758
|
+
type StampedOperations<C$1 extends VibORMConfig, ClientDefaults, Controls$1, Data$1, K$1 extends keyof ClientSchema<C$1>> = { [O in StampedOperation]: Operation$1<O, ClientSchema<C$1>[K$1], ClientDefaultOmit<C$1, K$1>, ClientDefaults, PlacedOperationControls<Controls$1, K$1, O>, StampedPayload<O, OperationPayload<O, ClientSchema<C$1>[K$1]>, ClientSchema<C$1>[K$1], StampedFieldNames<Data$1, K$1>, Stamps<Data$1, ClientSchema<C$1>>>> };
|
|
10657
10759
|
/**
|
|
10658
10760
|
* The call's own clauses, rebuilt: a create's rows, and an update's for the
|
|
10659
10761
|
* creates they nest.
|
|
@@ -10662,8 +10764,8 @@ type StampedPayload<O$1, Payload, M$1, Fields$1 extends PropertyKey, Context> =
|
|
|
10662
10764
|
type CreateClause<O$1> = O$1 extends "upsert" ? "create" : O$1 extends "create" | "createMany" ? "data" : never;
|
|
10663
10765
|
type UpdateClause<O$1> = O$1 extends "upsert" ? "update" : O$1 extends "update" | "updateMany" ? "data" : never;
|
|
10664
10766
|
/** What a nested write needs to find the fields its target's stamps write. */
|
|
10665
|
-
interface Stamps<Data, S$1> {
|
|
10666
|
-
readonly data: Data;
|
|
10767
|
+
interface Stamps<Data$1, S$1> {
|
|
10768
|
+
readonly data: Data$1;
|
|
10667
10769
|
readonly schema: S$1;
|
|
10668
10770
|
}
|
|
10669
10771
|
/**
|
|
@@ -10724,7 +10826,7 @@ type SpelledClauseKeys<Given> = Given extends object ? Given extends readonly un
|
|
|
10724
10826
|
* The keys spelled inside an ARRAY clause that no element of the payload
|
|
10725
10827
|
* accepts — the array spelling's equivalent of the `Exclude` below.
|
|
10726
10828
|
*/
|
|
10727
|
-
type UnknownArrayClauseKeys<Given extends readonly unknown[], Allowed> = Exclude<SpelledClauseKeys<Given[number]>, ClauseKeys<NonNullable<Allowed>>>;
|
|
10829
|
+
type UnknownArrayClauseKeys<Given extends readonly unknown[], Allowed, Always extends PropertyKey> = Exclude<Exclude<SpelledClauseKeys<Given[number]>, Always>, ClauseKeys<NonNullable<Allowed>>>;
|
|
10728
10830
|
/**
|
|
10729
10831
|
* What the ARRAY spelling of a clause is refused WITH. The key cannot be
|
|
10730
10832
|
* reported on itself there (see `NoExtraClauseKeys`), so the clause as a whole
|
|
@@ -10762,7 +10864,7 @@ type UnknownClauseKey<K$1> = {
|
|
|
10762
10864
|
*
|
|
10763
10865
|
* `Given` arrives with `undefined`/`null` already stripped (see `ClauseGuard`).
|
|
10764
10866
|
*/
|
|
10765
|
-
type NoExtraClauseKeys<Given, Allowed> = Given extends readonly unknown[] ? [UnknownArrayClauseKeys<Given, Allowed>] extends [never] ? unknown : UnknownClauseKey<UnknownArrayClauseKeys<Given, Allowed>> : string extends keyof Given ? unknown : Given extends object ? Record<Exclude<keyof Given, ClauseKeys<NonNullable<Allowed>>>, never> : unknown;
|
|
10867
|
+
type NoExtraClauseKeys<Given, Allowed, Always extends PropertyKey = never> = Given extends readonly unknown[] ? [UnknownArrayClauseKeys<Given, Allowed, Always>] extends [never] ? unknown : UnknownClauseKey<UnknownArrayClauseKeys<Given, Allowed, Always>> : string extends keyof Given ? unknown : Given extends object ? Record<Exclude<Exclude<keyof Given, Always>, ClauseKeys<NonNullable<Allowed>>>, never> : unknown;
|
|
10766
10868
|
/**
|
|
10767
10869
|
* The typo'd keys of an operation's args, at the operation's OWN level and at
|
|
10768
10870
|
* each clause inside it.
|
|
@@ -10804,37 +10906,111 @@ type NoExtraClauseKeys<Given, Allowed> = Given extends readonly unknown[] ? [Unk
|
|
|
10804
10906
|
* Estate type-check 34s → 45s when the guard landed; adding the other two
|
|
10805
10907
|
* spellings cost nothing measurable (same tree, back-to-back runs: 83.3s vs
|
|
10806
10908
|
* 78.1s user, the difference inside the noise of a loaded machine).
|
|
10807
|
-
* - `data` / `create` / `update` —
|
|
10808
|
-
* payload is the recursive nested-write union, and reaching for its
|
|
10809
|
-
* expands it: six estate sites turn `TS2589: Type instantiation is
|
|
10810
|
-
* excessively deep`, and the type-check goes to 172s.
|
|
10811
|
-
*
|
|
10812
|
-
*
|
|
10909
|
+
* - `data` / `create` / `update` — not keyed against the payload. A write
|
|
10910
|
+
* clause's payload is the recursive nested-write union, and reaching for its
|
|
10911
|
+
* keys expands it: six estate sites turn `TS2589: Type instantiation is
|
|
10912
|
+
* excessively deep`, and the type-check goes to 172s. Direct write names
|
|
10913
|
+
* are keyed from the model state instead (`DirectWriteKeysGuard`), nested
|
|
10914
|
+
* write data by walking the caller's literal (`NestedClauseGuard`).
|
|
10813
10915
|
* - `cursor` / `having` / `cache` — NOT guarded. Three more TS2589 sites, on
|
|
10814
10916
|
* compound-unique and aggregate payloads.
|
|
10815
10917
|
*
|
|
10816
|
-
*
|
|
10817
|
-
* `
|
|
10818
|
-
*
|
|
10819
|
-
*
|
|
10820
|
-
*
|
|
10821
|
-
*
|
|
10822
|
-
*
|
|
10823
|
-
*
|
|
10824
|
-
*
|
|
10825
|
-
*
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10918
|
+
* Below the root, every check walks the literal the caller wrote, never the
|
|
10919
|
+
* payload: `NestedClauseGuard` (WHERE model field names, nested write data),
|
|
10920
|
+
* `OperatorBagGuard` (root WHERE operator bags) and
|
|
10921
|
+
* `RecursiveProjectionRootGuard` (nested `select` / `include` / `where`,
|
|
10922
|
+
* `recurse` bags). A guard that inspects a value cannot key a type parameter,
|
|
10923
|
+
* so the projection and operator guards keep each leaf's own arm in a union,
|
|
10924
|
+
* which is what keeps a generic leaf assignable. What stays unguarded —
|
|
10925
|
+
* operator bags below the root WHERE, selectors, variant arms — is pinned as a
|
|
10926
|
+
* compiling misspelling in `tests/types/client/contextual-typing-gate.core.types.ts`
|
|
10927
|
+
* and listed on the quick start.
|
|
10928
|
+
*/
|
|
10929
|
+
/**
|
|
10930
|
+
* The root-reported walks (WHERE model keys, nested write data) follow the
|
|
10931
|
+
* LITERAL the caller wrote, key each spelled object against a key set read
|
|
10932
|
+
* from the model's state, and report what is left as ONE `UnknownClauseKey` on
|
|
10933
|
+
* the root clause. Neither maps over a payload's own keys, which is what
|
|
10934
|
+
* expands the recursive payloads (see above). Cycle detection uses the exact
|
|
10935
|
+
* spelled-value/model pair, never a numeric depth cap, so a held value typed
|
|
10936
|
+
* as a recursive payload stops at its first repeat. `NoInfer` keeps that
|
|
10937
|
+
* comparison from inferring through a relinked model (a mapped type), which
|
|
10938
|
+
* would walk its whole relation graph.
|
|
10939
|
+
*/
|
|
10940
|
+
type SameValue<A, B$1> = (<T$1>() => T$1 extends NoInfer<A> ? 1 : 2) extends (<T$1>() => T$1 extends NoInfer<B$1> ? 1 : 2) ? true : false;
|
|
10941
|
+
type SeenValue<Given, M$1, Seen> = true extends (Seen extends unknown ? SameValue<readonly [Given, M$1], Seen> : never) ? true : false;
|
|
10942
|
+
type ElementOf<Value> = Value extends readonly (infer Element)[] ? Element : Value;
|
|
10830
10943
|
type WhereLogicalKey = "AND" | "OR" | "NOT";
|
|
10831
10944
|
type WhereLogicalKeys<M$1 extends Model$1<any>> = Exclude<WhereLogicalKey, keyof M$1["~"]["state"]["shape"]>;
|
|
10832
10945
|
type WhereModelKeys<M$1 extends Model$1<any>> = keyof M$1["~"]["state"]["shape"] | WhereLogicalKey;
|
|
10833
|
-
|
|
10834
|
-
type
|
|
10835
|
-
|
|
10836
|
-
|
|
10946
|
+
/** The unknown keys inside the quantifiers `Q` a relation filter spelled. */
|
|
10947
|
+
type QuantifiedWhereUnknownKeys<Given, R$1 extends AnyRelation, Seen, Q$1 extends PropertyKey> = { [K in Extract<SpelledClauseKeys<Given>, Q$1>]: WhereUnknownKeys<ValueAt<Given, K>, GetTargetModel<R$1>, Seen> }[Extract<SpelledClauseKeys<Given>, Q$1>];
|
|
10948
|
+
/**
|
|
10949
|
+
* A spelled `recurse` selects the recursive filter on either cardinality (the
|
|
10950
|
+
* runtime dispatcher's rule), so its quantifiers are walked and its option bag
|
|
10951
|
+
* is sealed exactly as on the select side.
|
|
10952
|
+
*/
|
|
10953
|
+
type RelationWhereUnknownKeys<Given, R$1 extends AnyRelation, Seen> = TargetKind<R$1> extends "model" ? "recurse" extends SpelledClauseKeys<Given> ? QuantifiedWhereUnknownKeys<Given, R$1, Seen, "some" | "every" | "none"> | MisspelledRecurrenceKeys<ValueAt<Given, "recurse">> : Cardinality<R$1> extends "one" ? [Extract<SpelledClauseKeys<Given>, "is" | "isNot">] extends [never] ? WhereUnknownKeys<Given, GetTargetModel<R$1>, Seen> : QuantifiedWhereUnknownKeys<Given, R$1, Seen, "is" | "isNot"> : QuantifiedWhereUnknownKeys<Given, R$1, Seen, "some" | "every" | "none"> : never;
|
|
10954
|
+
type WhereUnknownKeys<Given, M$1 extends Model$1<any>, Seen = never, Allowed extends PropertyKey = WhereModelKeys<M$1>> = Given extends readonly unknown[] ? WhereUnknownKeys<Given[number], M$1, Seen, Allowed> : Given extends object ? string extends keyof Given ? never : Exclude<keyof Given, Allowed> | (SeenValue<Given, M$1, Seen> extends true ? never : { [K in Extract<keyof Given, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>]: K extends WhereLogicalKeys<M$1> ? WhereUnknownKeys<NonNullable<Given[K]>, M$1, Seen | readonly [Given, M$1]> : K extends keyof M$1["~"]["state"]["relations"] ? RelationWhereUnknownKeys<NonNullable<Given[K]>, M$1["~"]["state"]["relations"][K], Seen | readonly [Given, M$1]> : never }[Extract<keyof Given, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>]) : never;
|
|
10955
|
+
/**
|
|
10956
|
+
* The data objects one relation's write verbs carry: `create`,
|
|
10957
|
+
* `createMany.data`, `connectOrCreate.create`, `upsert.create` / `.update`,
|
|
10958
|
+
* and the `data` of `update` / `updateMany`. A to-one `update` is read as the
|
|
10959
|
+
* parse boundary reads it (`to-one-update-form.ts`): the `{ where?, data }`
|
|
10960
|
+
* envelope when `where` is spelled or the target owns no `data` field, the
|
|
10961
|
+
* bare data otherwise.
|
|
10962
|
+
*/
|
|
10963
|
+
type NestedWriteData<Verbs, TargetKeys> = ElementOf<ValueAt<Verbs, "create">> | ElementOf<ValueAt<ValueAt<Verbs, "createMany">, "data">> | ValueAt<ElementOf<ValueAt<Verbs, "connectOrCreate" | "upsert">>, "create"> | ValueAt<ElementOf<ValueAt<Verbs, "upsert">>, "update"> | ValueAt<ElementOf<ValueAt<Verbs, "updateMany">>, "data"> | UpdateFormData<ElementOf<ValueAt<Verbs, "update">>, TargetKeys>;
|
|
10964
|
+
type UpdateFormData<Update, TargetKeys> = Update extends {
|
|
10965
|
+
data: infer Data;
|
|
10966
|
+
} ? "where" extends keyof Update ? Data : "data" extends TargetKeys ? Update : Data : Update;
|
|
10967
|
+
/**
|
|
10968
|
+
* The keys an object SPELLED: its required ones. A union of literals (a
|
|
10969
|
+
* ternary between two payload forms) carries each arm's missing keys as
|
|
10970
|
+
* optional `?: undefined` members nobody wrote, and a held value typed as the
|
|
10971
|
+
* payload carries every key as optional and has nothing misspelled.
|
|
10972
|
+
*/
|
|
10973
|
+
type RequiredSpelledKeys<Given> = Given extends object ? { [K in keyof Given]-?: Record<never, never> extends Pick<Given, K> ? never : K }[keyof Given] : never;
|
|
10974
|
+
/**
|
|
10975
|
+
* The keys nested write data spells that its model does not declare, at
|
|
10976
|
+
* every depth below the root data (whose own keys `DirectWriteKeysGuard`
|
|
10977
|
+
* reports on the key itself). Only spelled keys are read, so a payload-typed
|
|
10978
|
+
* value's recursive schema is never expanded, which also bounds the walk.
|
|
10979
|
+
* Selectors (`where`, `connect`, …) stay unkeyed, as
|
|
10980
|
+
* `contextual-typing-gate.core.types.ts` pins.
|
|
10981
|
+
*/
|
|
10982
|
+
type NestedWriteUnknownKeys<Data$1, M$1 extends Model$1<any>> = Data$1 extends readonly unknown[] ? NestedWriteUnknownKeys<Data$1[number], M$1> : { [K in Extract<RequiredSpelledKeys<Data$1>, keyof M$1["~"]["state"]["relations"]>]: TargetKind<M$1["~"]["state"]["relations"][K]> extends "model" ? TargetWriteUnknownKeys<NonNullable<ValueAt<Data$1, K>>, GetTargetModel<M$1["~"]["state"]["relations"][K]>> : never }[Extract<RequiredSpelledKeys<Data$1>, keyof M$1["~"]["state"]["relations"]>];
|
|
10983
|
+
type TargetWriteUnknownKeys<Verbs, T$1 extends Model$1<any>, Keys$1 extends PropertyKey = keyof T$1["~"]["state"]["shape"]> = NestedWriteData<Verbs, Keys$1> extends infer Data ? Data extends object ? Exclude<RequiredSpelledKeys<Data>, Keys$1> | NestedWriteUnknownKeys<Data, T$1> : never : never;
|
|
10984
|
+
/**
|
|
10985
|
+
* Whether the argument SPELLED `Clause`. A literal's keys are required; a
|
|
10986
|
+
* payload type's are optional — an omitted or generically forwarded argument
|
|
10987
|
+
* — and walking one would expand its recursive schema as though every
|
|
10988
|
+
* optional key was spelled.
|
|
10989
|
+
*/
|
|
10990
|
+
type SpelledClause<Arg, Clause extends PropertyKey> = [Arg] extends [{ [Key in Clause]: unknown }] ? true : false;
|
|
10991
|
+
/**
|
|
10992
|
+
* One spelled root clause, refused as a whole with the keys its walk finds:
|
|
10993
|
+
* `where` walks model field names through relation and logical filters,
|
|
10994
|
+
* `data` / `create` / `update` walk nested write data. A clause spelling no
|
|
10995
|
+
* relation or logical group has nothing below its root to walk. A `where`
|
|
10996
|
+
* that IS the payload type is not walked either (the WHERE walk follows
|
|
10997
|
+
* optional keys); the write walk needs no such check, because it descends
|
|
10998
|
+
* only spelled keys.
|
|
10999
|
+
*/
|
|
11000
|
+
type NestedClauseGuard<Arg, Payload, M$1 extends Model$1<any>, Clause extends "where" | "data" | "create" | "update"> = Clause extends keyof Arg ? SpelledClause<Arg, Clause> extends true ? Clause extends keyof Payload ? [Extract<SpelledClauseKeys<ElementOf<NonNullable<Arg[Clause]>>>, WhereLogicalKeys<M$1> | keyof M$1["~"]["state"]["relations"]>] extends [never] ? unknown : (Clause extends "where" ? SameValue<NonNullable<Arg[Clause]>, NonNullable<Payload[Clause]>> extends true ? never : WhereUnknownKeys<NonNullable<Arg[Clause]>, M$1, never, ClauseKeys<NonNullable<Payload[Clause]>>> : NestedWriteUnknownKeys<NonNullable<Arg[Clause]>, M$1>) extends infer Extra ? [Extra] extends [never] ? unknown : { [Key in Clause]?: UnknownClauseKey<Extra> } : unknown : unknown : unknown : unknown;
|
|
11001
|
+
/**
|
|
11002
|
+
* A root WHERE operator bag, sealed at the bag: an object spelled for a
|
|
11003
|
+
* scalar is keyed against every key the field's object arms declare, so
|
|
11004
|
+
* `{ contains: "x", mdoe: "insensitive" }` is refused on `mdoe`. The value's
|
|
11005
|
+
* own primitive, list and `Date` arms stay in the union, which is what keeps
|
|
11006
|
+
* a generic leaf (`title: t`, `T extends string`) assignable: TypeScript
|
|
11007
|
+
* cannot key a type parameter, so a guard that inspected one would refuse it.
|
|
11008
|
+
* Bags inside relation filters and logical groups are not sealed.
|
|
11009
|
+
*/
|
|
11010
|
+
type OperatorBagGuard<Arg, Payload, M$1 extends Model$1<any>> = "where" extends keyof Arg ? SpelledClause<Arg, "where"> extends true ? "where" extends keyof Payload ? {
|
|
11011
|
+
where?: { [K in Extract<SpelledClauseKeys<NonNullable<Arg["where"]>>, keyof M$1["~"]["state"]["scalars"]>]?: OperatorBagSeal<ValueAt<NonNullable<Arg["where"]>, K>, ValueAt<NonNullable<Payload["where"]>, K>> };
|
|
10837
11012
|
} : unknown : unknown : unknown;
|
|
11013
|
+
type OperatorBagSeal<Given, Input$1> = Exclude<Input$1, object> | Extract<Input$1, readonly unknown[] | Date> | Record<Exclude<SpelledClauseKeys<NonNullable<Given>>, ClauseKeys<Extract<NonNullable<Input$1>, object>>>, never>;
|
|
10838
11014
|
type ClauseGuard<Arg, Payload, K$1 extends string> = K$1 extends keyof Arg ? K$1 extends keyof Payload ? { [P in K$1]?: NoExtraClauseKeys<NonNullable<Arg[K$1]>, Payload[K$1]> } : unknown : unknown;
|
|
10839
11015
|
type ValueAt<Container, Key$1 extends PropertyKey> = Container extends unknown ? Key$1 extends keyof Container ? Container[Key$1] : never : never;
|
|
10840
11016
|
type PolymorphicVariantKeys<Relation> = keyof VariantEntries<Relation>;
|
|
@@ -10900,26 +11076,37 @@ type RecurrenceBagGuard<Bag> = [MisspelledRecurrenceKeys<Bag>] extends [never] ?
|
|
|
10900
11076
|
*/
|
|
10901
11077
|
type RelationNodeClauseKey = "where" | "orderBy" | "take" | "skip" | "cursor" | "distinct" | "select" | "include" | "omit" | "recurse" | "only" | "variants";
|
|
10902
11078
|
/**
|
|
10903
|
-
* The
|
|
10904
|
-
* spelled. The walk follows the LITERAL — a node's `select`,
|
|
10905
|
-
* collection `variants` and to-one variant arms —
|
|
10906
|
-
*
|
|
10907
|
-
*
|
|
11079
|
+
* The relation nodes of an operation's projection, sealed at every depth the
|
|
11080
|
+
* caller spelled. The walk follows the LITERAL — a node's `select`,
|
|
11081
|
+
* `include`, `where`, collection `variants` and to-one variant arms — and
|
|
11082
|
+
* reads a target model only for a relation key the caller spelled, so it
|
|
11083
|
+
* costs what the argument contains. On a model-target node it keys `select`
|
|
11084
|
+
* against the target's fields, `include` against its relations (both beside
|
|
11085
|
+
* `_count`), walks `where` as the root WHERE is walked, and seals `recurse`
|
|
11086
|
+
* option bags; variant arms and `variants` are sealed by
|
|
11087
|
+
* `DirectPolymorphicProjectionGuard`, not keyed here. An `any` argument (what
|
|
11088
|
+
* an erased signature passes, as `Parameters<…>` reads it) is not walked.
|
|
11089
|
+
*/
|
|
11090
|
+
type RecursiveProjectionRootGuard<Arg, M$1 extends Model$1<any>> = 0 extends 1 & Arg ? unknown : RecursiveRootClause<Arg, M$1, "select"> & RecursiveRootClause<Arg, M$1, "include">;
|
|
11091
|
+
/**
|
|
11092
|
+
* A clause the argument spelled — a REQUIRED key of the argument. The guard
|
|
11093
|
+
* names no key the caller did not, and an optional clause belongs to a payload
|
|
11094
|
+
* type (an erased signature's, as `Parameters<…>` reads it), never walked.
|
|
10908
11095
|
*/
|
|
10909
|
-
type
|
|
10910
|
-
/** A clause the argument spelled; the guard names no key the caller did not. */
|
|
10911
|
-
type RecursiveRootClause<Arg, Clause extends "select" | "include"> = Clause extends keyof Arg ? { [Key in Clause]?: RecursiveRootMembers<Arg[Key]> } : unknown;
|
|
11096
|
+
type RecursiveRootClause<Arg, M$1 extends Model$1<any>, Clause extends "select" | "include"> = Clause extends keyof Arg ? SpelledClause<Arg, Clause> extends true ? { [Key in Clause]?: RecursiveRootMembers<Arg[Key], M$1> } : unknown : unknown;
|
|
10912
11097
|
/**
|
|
10913
11098
|
* The operation's own projection. Its members meet the node guard directly,
|
|
10914
11099
|
* so a misspelling one relation deep is reported on the key itself.
|
|
10915
11100
|
*/
|
|
10916
|
-
type RecursiveRootMembers<Clause> = { [Key in SpelledClauseKeys<NonNullable<Clause>>]?: RecursiveNodeGuard<ValueAt<NonNullable<Clause>, Key>> };
|
|
11101
|
+
type RecursiveRootMembers<Clause, M$1> = { [Key in SpelledClauseKeys<NonNullable<Clause>>]?: RecursiveNodeGuard<ValueAt<NonNullable<Clause>, Key>, RelationTarget<M$1, Key>> };
|
|
11102
|
+
/** The model a relation key targets; `never` (nothing to key) otherwise. */
|
|
11103
|
+
type RelationTarget<M$1, Key$1> = M$1 extends Model$1<any> ? Key$1 extends keyof M$1["~"]["state"]["relations"] ? TargetKind<M$1["~"]["state"]["relations"][Key$1]> extends "model" ? GetTargetModel<M$1["~"]["state"]["relations"][Key$1]> : never : never : never;
|
|
10917
11104
|
/**
|
|
10918
11105
|
* Only an object is a node to walk. A leaf, or a payload type wide enough to
|
|
10919
11106
|
* admit one, states nothing: the guard is for what a caller spelled, and TS
|
|
10920
11107
|
* falls back to the payload type itself when an argument fails it.
|
|
10921
11108
|
*/
|
|
10922
|
-
type RecursiveNodeGuard<Node> = [Exclude<Node, null | undefined>] extends [object] ? RecursiveNodeObjectGuard<Exclude<Node, null | undefined
|
|
11109
|
+
type RecursiveNodeGuard<Node, T$1> = [Exclude<Node, null | undefined>] extends [object] ? RecursiveNodeObjectGuard<Exclude<Node, null | undefined>, T$1> : unknown;
|
|
10923
11110
|
type ExclusiveSelection<Node> = Node extends {
|
|
10924
11111
|
select: object;
|
|
10925
11112
|
include: object;
|
|
@@ -10928,27 +11115,36 @@ type ExclusiveSelection<Node> = Node extends {
|
|
|
10928
11115
|
} | {
|
|
10929
11116
|
include?: undefined;
|
|
10930
11117
|
} : unknown;
|
|
10931
|
-
type RecursiveNodeObjectGuard<Node> = ExclusiveSelection<Node> & ("recurse" extends keyof Node ? {
|
|
11118
|
+
type RecursiveNodeObjectGuard<Node, T$1> = ExclusiveSelection<Node> & ("recurse" extends keyof Node ? {
|
|
10932
11119
|
recurse?: RecurrenceBagGuard<Node["recurse"]>;
|
|
10933
11120
|
} : unknown) & ("select" extends keyof Node ? {
|
|
10934
|
-
select?: RecursiveProjectionGuard<Node["select"]>;
|
|
11121
|
+
select?: RecursiveProjectionGuard<Node["select"], T$1> & ProjectionKeySeal<Node["select"], T$1, "select">;
|
|
10935
11122
|
} : unknown) & ("include" extends keyof Node ? {
|
|
10936
|
-
include?: RecursiveProjectionGuard<Node["include"]>;
|
|
11123
|
+
include?: RecursiveProjectionGuard<Node["include"], T$1> & ProjectionKeySeal<Node["include"], T$1, "include">;
|
|
11124
|
+
} : unknown) & ([Node] extends [{
|
|
11125
|
+
where: unknown;
|
|
11126
|
+
}] ? {
|
|
11127
|
+
where?: NodeWhereSeal<Node["where"], T$1>;
|
|
10937
11128
|
} : unknown) & ("variants" extends keyof Node ? {
|
|
10938
|
-
variants?: RecursiveProjectionGuard<Node["variants"]>;
|
|
10939
|
-
} : unknown) & RecursiveProjectionGuard<Node, RelationNodeClauseKey>;
|
|
11129
|
+
variants?: RecursiveProjectionGuard<Node["variants"], never>;
|
|
11130
|
+
} : unknown) & RecursiveProjectionGuard<Node, never, RelationNodeClauseKey>;
|
|
10940
11131
|
/**
|
|
10941
11132
|
* A nested projection map. Its members are boolean leaves or nodes; naming
|
|
10942
|
-
* the leaf keeps a generic
|
|
10943
|
-
*
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
type
|
|
11133
|
+
* the leaf keeps a generic leaf assignable, because TypeScript cannot resolve
|
|
11134
|
+
* the walk through a type parameter. A generic NODE whose constraint spells
|
|
11135
|
+
* `select`, `include` or `where` is refused: those keys cannot be proven.
|
|
11136
|
+
*/
|
|
11137
|
+
type RecursiveProjectionGuard<Clause, T$1, Skipped extends PropertyKey = never> = { [Key in Exclude<SpelledClauseKeys<NonNullable<Clause>>, Skipped>]?: boolean | RecursiveNodeGuard<ValueAt<NonNullable<Clause>, Key>, RelationTarget<T$1, Key>> };
|
|
11138
|
+
/** A model-target node's `select` / `include` keys, beside `_count`. */
|
|
11139
|
+
type ProjectionKeySeal<Clause, T$1, Kind$1 extends "select" | "include"> = [T$1] extends [never] ? unknown : T$1 extends Model$1<any> ? Record<Exclude<SpelledClauseKeys<NonNullable<Clause>>, "_count" | keyof T$1["~"]["state"][Kind$1 extends "select" ? "shape" : "relations"]>, never> : unknown;
|
|
11140
|
+
/** A model-target node's `where`, walked as the root WHERE is. */
|
|
11141
|
+
type NodeWhereSeal<Where, T$1> = [T$1] extends [never] ? unknown : T$1 extends Model$1<any> ? WhereUnknownKeys<NonNullable<Where>, T$1> extends infer Extra ? [Extra] extends [never] ? unknown : UnknownClauseKey<Extra> : unknown : unknown;
|
|
11142
|
+
type ScalarStateOf<Field, Kind$1 extends ScalarType> = Field extends {
|
|
10947
11143
|
readonly "~": {
|
|
10948
|
-
readonly state: infer State extends ScalarState<
|
|
11144
|
+
readonly state: infer State extends ScalarState<Kind$1>;
|
|
10949
11145
|
};
|
|
10950
11146
|
} ? State : never;
|
|
10951
|
-
type
|
|
11147
|
+
type ScalarKeysOf<State$1 extends ModelState, Kind$1 extends ScalarType> = { [Key in keyof State$1["scalars"]]: [ScalarStateOf<State$1["scalars"][Key], Kind$1>] extends [never] ? never : Key }[keyof State$1["scalars"]];
|
|
10952
11148
|
/**
|
|
10953
11149
|
* Refuse only keys the caller spelled BESIDE a real decimal operation.
|
|
10954
11150
|
*
|
|
@@ -10962,17 +11158,11 @@ type DirectDecimalScalarKeys<State$1 extends ModelState> = { [Key in keyof State
|
|
|
10962
11158
|
*/
|
|
10963
11159
|
type SpelledDecimalUpdateObjectKeys<Given, OperationKeys extends PropertyKey> = Given extends readonly unknown[] ? never : Given extends object ? string extends keyof Given ? never : [Extract<keyof Given, OperationKeys>] extends [never] ? never : keyof Given : never;
|
|
10964
11160
|
type NoExtraDecimalUpdateLeafKeys<Given, State$1 extends ScalarState<"decimal">, OperationKeys extends PropertyKey = DecimalUpdateOperationKeys<State$1>> = Record<Exclude<SpelledDecimalUpdateObjectKeys<Given, OperationKeys>, OperationKeys>, never>;
|
|
10965
|
-
type UsedDirectDecimalFields<Given, State$1 extends ModelState> = Extract<SpelledClauseKeys<Given>,
|
|
11161
|
+
type UsedDirectDecimalFields<Given, State$1 extends ModelState> = Extract<SpelledClauseKeys<Given>, ScalarKeysOf<State$1, "decimal">>;
|
|
10966
11162
|
/** One direct-field map after union branches have contributed their keys. */
|
|
10967
|
-
type DirectDecimalUpdateObjectGuard<Given, M$1 extends Model$1<any>> = M$1 extends Model$1<infer State> ? { [Key in UsedDirectDecimalFields<Given, State>]?: NoExtraDecimalUpdateLeafKeys<ValueAt<Given, Key>,
|
|
11163
|
+
type DirectDecimalUpdateObjectGuard<Given, M$1 extends Model$1<any>> = M$1 extends Model$1<infer State> ? { [Key in UsedDirectDecimalFields<Given, State>]?: NoExtraDecimalUpdateLeafKeys<ValueAt<Given, Key>, ScalarStateOf<State["scalars"][Key], "decimal">> } : unknown;
|
|
10968
11164
|
type DirectDecimalUpdateClauseGuard<Arg, M$1 extends Model$1<any>, Clause extends "data" | "update"> = Clause extends keyof Arg ? { [Key in Clause]?: DirectDecimalUpdateObjectGuard<NonNullable<Arg[Key]>, M$1> } : unknown;
|
|
10969
11165
|
type DirectDecimalUpdateGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>> = O$1 extends "update" | "updateMany" ? DirectDecimalUpdateClauseGuard<Arg, M$1, "data"> : O$1 extends "upsert" ? DirectDecimalUpdateClauseGuard<Arg, M$1, "update"> : unknown;
|
|
10970
|
-
type GeoPointStateOf<Field> = Field extends {
|
|
10971
|
-
readonly "~": {
|
|
10972
|
-
readonly state: infer State extends ScalarState<"point">;
|
|
10973
|
-
};
|
|
10974
|
-
} ? State : never;
|
|
10975
|
-
type DirectGeoPointScalarKeys<State$1 extends ModelState> = { [Key in keyof State$1["scalars"]]: [GeoPointStateOf<State$1["scalars"][Key]>] extends [never] ? never : Key }[keyof State$1["scalars"]];
|
|
10976
11166
|
type NoExtraRecognizedKeys<Given, Allowed extends PropertyKey, Recognized extends PropertyKey = Allowed> = Given extends readonly unknown[] ? unknown : Given extends object ? string extends keyof Given ? unknown : [Extract<keyof Given, Recognized>] extends [never] ? unknown : Record<Exclude<keyof Given, Allowed>, never> : unknown;
|
|
10977
11167
|
type GeoPointValueGuard<Given> = NoExtraRecognizedKeys<Given, "longitude" | "latitude">;
|
|
10978
11168
|
type GeoBoundsValueGuard<Given> = NoExtraRecognizedKeys<Given, "south" | "west" | "north" | "east">;
|
|
@@ -11006,7 +11196,7 @@ type GeoPointWriteValueGuard<Given> = Given extends object ? "set" extends keyof
|
|
|
11006
11196
|
type UsedGeoPointKeys<Row, PointKeys extends PropertyKey> = Extract<SpelledClauseKeys<Row>, PointKeys>;
|
|
11007
11197
|
type GeoPointRowGuard<Given, PointKeys extends PropertyKey, Mode extends "filter" | "write", Row = (Given extends readonly (infer Member)[] ? Member : Given)> = [UsedGeoPointKeys<Row, PointKeys>] extends [never] ? unknown : Row extends object ? { [Key in UsedGeoPointKeys<Row, PointKeys>]?: Mode extends "filter" ? GeoPointFilterValueGuard<ValueAt<Row, Key>> : GeoPointWriteValueGuard<ValueAt<Row, Key>> } : unknown;
|
|
11008
11198
|
type DirectGeoPointClauseGuard<Arg, Clause extends PropertyKey, PointKeys extends PropertyKey, Mode extends "filter" | "write"> = Clause extends keyof Arg ? { [Key in Clause]?: GeoPointRowGuard<NonNullable<Arg[Key]>, PointKeys, Mode> } : unknown;
|
|
11009
|
-
type DirectGeoPointGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>, PointKeys extends PropertyKey = (M$1 extends Model$1<infer State> ?
|
|
11199
|
+
type DirectGeoPointGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>, PointKeys extends PropertyKey = (M$1 extends Model$1<infer State> ? ScalarKeysOf<State, "point"> : never)> = [PointKeys] extends [never] ? unknown : DirectGeoPointClauseGuard<Arg, "where", PointKeys, "filter"> & (O$1 extends "create" | "createMany" | "update" | "updateMany" ? DirectGeoPointClauseGuard<Arg, "data", PointKeys, "write"> : O$1 extends "upsert" ? DirectGeoPointClauseGuard<Arg, "create", PointKeys, "write"> & DirectGeoPointClauseGuard<Arg, "update", PointKeys, "write"> : unknown);
|
|
11010
11200
|
/** Direct write names come from State, never the recursive write payload. */
|
|
11011
11201
|
type DirectWriteKeysGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>, Keys$1 extends PropertyKey = keyof M$1["~"]["state"]["shape"]> = O$1 extends "create" | "createMany" | "update" | "updateMany" ? ClauseGuard<Arg, {
|
|
11012
11202
|
data: Record<Keys$1, unknown>;
|
|
@@ -11015,18 +11205,27 @@ type DirectWriteKeysGuard<O$1 extends Operations, Arg, M$1 extends Model$1<any>,
|
|
|
11015
11205
|
}, "create"> & ClauseGuard<Arg, {
|
|
11016
11206
|
update: Record<Keys$1, unknown>;
|
|
11017
11207
|
}, "update"> : unknown;
|
|
11018
|
-
type NoExtraOperationKeys<O$1 extends Operations, Arg, Payload, M$1 extends Model$1<any>, Controls$1 = NoControls> = Arg & ExclusiveSelection<Arg> & Record<Exclude<keyof Arg, keyof Payload | keyof Controls$1>, never> & ClauseGuard<Arg, Payload, "where"> & NestedWhereClauseGuard<Arg, Payload, M$1> & ClauseGuard<Arg, Payload, "select"> & ClauseGuard<Arg, Payload, "include"> & ClauseGuard<Arg, Payload, "orderBy"> & ClauseGuard<Arg, Payload, "omit"> & ClauseGuard<Arg, Controls$1, "cache"> & DirectPolymorphicProjectionGuard<Arg, M$1, "select"> & DirectPolymorphicProjectionGuard<Arg, M$1, "include"> & RecursiveProjectionRootGuard<Arg> & DirectWriteKeysGuard<O$1, Arg, M$1> & DirectDecimalUpdateGuard<O$1, Arg, M$1> & DirectGeoPointGuard<O$1, Arg, M$1>;
|
|
11019
11208
|
/**
|
|
11020
|
-
*
|
|
11021
|
-
*
|
|
11022
|
-
*
|
|
11023
|
-
*
|
|
11209
|
+
* groupBy `orderBy` names an aggregate or a field the literal `by` grouped.
|
|
11210
|
+
* Aggregates are admitted before `by` is read, so a `by` list that is a type
|
|
11211
|
+
* parameter still orders by aggregates, while a field beside it is refused:
|
|
11212
|
+
* no grouped key can be proven. An empty `by` stays a runtime refusal (V4001)
|
|
11213
|
+
* because refusing `[]` here would refuse every generic `by` list too.
|
|
11024
11214
|
*/
|
|
11025
|
-
type
|
|
11215
|
+
type GroupByOrderGuard<O$1 extends Operations, Arg, Payload, M$1 extends Model$1<any>> = O$1 extends "groupBy" ? "orderBy" extends keyof Arg ? {
|
|
11216
|
+
orderBy?: NoExtraClauseKeys<NonNullable<Arg["orderBy"]>, Record<Extract<ElementOf<NonNullable<ValueAt<Arg, "by">>>, PropertyKey>, unknown>, Exclude<ClauseKeys<ElementOf<NonNullable<ValueAt<Payload, "orderBy">>>>, keyof M$1["~"]["state"]["scalars"]>>;
|
|
11217
|
+
} : unknown : unknown;
|
|
11218
|
+
type NoExtraOperationKeys<O$1 extends Operations, Arg, Payload, M$1 extends Model$1<any>, Controls$1 = NoControls> = Arg & ExclusiveSelection<Arg> & Record<Exclude<keyof Arg, keyof Payload | keyof Controls$1>, never> & ClauseGuard<Arg, Payload, "where"> & NestedClauseGuard<Arg, Payload, M$1, "where"> & OperatorBagGuard<Arg, Payload, M$1> & ClauseGuard<Arg, Payload, "select"> & ClauseGuard<Arg, Payload, "include"> & ClauseGuard<Arg, Payload, "orderBy"> & ClauseGuard<Arg, Payload, "omit"> & ClauseGuard<Arg, Controls$1, "cache"> & DirectPolymorphicProjectionGuard<Arg, M$1, "select"> & DirectPolymorphicProjectionGuard<Arg, M$1, "include"> & RecursiveProjectionRootGuard<Arg, M$1> & DirectWriteKeysGuard<O$1, Arg, M$1> & NestedClauseGuard<Arg, Payload, M$1, "data"> & NestedClauseGuard<Arg, Payload, M$1, "create"> & NestedClauseGuard<Arg, Payload, M$1, "update"> & GroupByOrderGuard<O$1, Arg, Payload, M$1> & DirectDecimalUpdateGuard<O$1, Arg, M$1> & DirectGeoPointGuard<O$1, Arg, M$1>;
|
|
11026
11219
|
/**
|
|
11027
|
-
*
|
|
11220
|
+
* One client method signature. `Pending` picks its carrier: a PendingOperation
|
|
11221
|
+
* (PromiseLike, so it can be awaited directly or batched in
|
|
11222
|
+
* `$transaction([op1, op2])`), or a plain Promise for a cached read, which is
|
|
11223
|
+
* not batchable.
|
|
11028
11224
|
*/
|
|
11029
|
-
type
|
|
11225
|
+
type OperationMethod<O$1 extends Operations, M$1 extends Model$1<any>, DefaultOmit, ClientDefaults, Controls$1, Payload, Pending extends boolean> = undefined extends Payload ? <Arg extends Payload>(args?: WithControlArgs<NoExtraOperationKeys<O$1, Exclude<Arg, undefined>, Exclude<Payload, undefined>, M$1, Controls$1>, Controls$1>) => OperationCarrier<OperationResultWithClientDefaults<O$1, M$1, Arg, DefaultOmit, ClientDefaults>, Pending> : <Arg extends Payload>(args: WithControlArgs<NoExtraOperationKeys<O$1, Arg, Payload, M$1, Controls$1>, Controls$1>) => OperationCarrier<OperationResultWithClientDefaults<O$1, M$1, Arg, DefaultOmit, ClientDefaults>, Pending>;
|
|
11226
|
+
type OperationCarrier<Result, Pending extends boolean> = Pending extends true ? PendingOperation<Result> : Promise<Result>;
|
|
11227
|
+
type Operation$1<O$1 extends Operations, M$1 extends Model$1<any>, DefaultOmit = undefined, ClientDefaults = never, Controls$1 = NoControls, Payload = OperationPayload<O$1, M$1>> = OperationMethod<O$1, M$1, DefaultOmit, ClientDefaults, Controls$1, Payload, true>;
|
|
11228
|
+
type CachedOperation<O$1 extends Operations, M$1 extends Model$1<any>, DefaultOmit = undefined, ClientDefaults = never, Controls$1 = NoControls> = OperationMethod<O$1, M$1, DefaultOmit, ClientDefaults, Controls$1, OperationPayload<O$1, M$1>, false>;
|
|
11030
11229
|
/**
|
|
11031
11230
|
* Cached client type - provides typed access to only cacheable (read) operations
|
|
11032
11231
|
* Returns Promises directly (not PendingOperation) - cache operations are not batchable
|
|
@@ -11158,21 +11357,6 @@ declare class SavepointQueue {
|
|
|
11158
11357
|
}
|
|
11159
11358
|
//#endregion
|
|
11160
11359
|
//#region src/drivers/shared/driver-options.d.ts
|
|
11161
|
-
/**
|
|
11162
|
-
* The driver-option boundary.
|
|
11163
|
-
*
|
|
11164
|
-
* Every public `namespace` and MySQL2's `migrationNamespaceAttestation` reach
|
|
11165
|
-
* VibORM through a caller-owned object, which may be a proxy or carry an
|
|
11166
|
-
* accessor. This module is the one place those properties are read: exactly
|
|
11167
|
-
* once, with a thrown accessor turned into the client-construction failure the
|
|
11168
|
-
* rest of the surface already raises. A second read is what would let a value
|
|
11169
|
-
* that passed validation be swapped for one that did not before it is used.
|
|
11170
|
-
*
|
|
11171
|
-
* Convenience wrappers read the caller's configuration here and hand their
|
|
11172
|
-
* driver a plain primitive; direct driver construction reads its own options
|
|
11173
|
-
* object here. Both entries reach this owner, and neither reaches a provider
|
|
11174
|
-
* before it answers.
|
|
11175
|
-
*/
|
|
11176
11360
|
/**
|
|
11177
11361
|
* MySQL2's transport assertion. It selects nothing: it states that qualified
|
|
11178
11362
|
* `database.table` references and the pinned migration session's `USE` cannot
|
|
@@ -11511,6 +11695,15 @@ declare abstract class DriverTransactionBase<TClient, TTransaction> extends Driv
|
|
|
11511
11695
|
interface PinnedSessionReservation<TSession> {
|
|
11512
11696
|
/** The reserved producer. Every statement of the session runs on it. */
|
|
11513
11697
|
readonly session: TSession;
|
|
11698
|
+
/**
|
|
11699
|
+
* The failure the provider itself saw end this session's connection, or
|
|
11700
|
+
* `undefined` while it has seen none.
|
|
11701
|
+
*
|
|
11702
|
+
* Only a provider that observes its connection has one (`pg`, through the
|
|
11703
|
+
* client's `error` event). Elsewhere a lost connection is recognized by the
|
|
11704
|
+
* failure that reported it.
|
|
11705
|
+
*/
|
|
11706
|
+
readonly lost?: () => unknown;
|
|
11514
11707
|
/**
|
|
11515
11708
|
* Returns the producer to the provider.
|
|
11516
11709
|
*
|
|
@@ -11520,11 +11713,42 @@ interface PinnedSessionReservation<TSession> {
|
|
|
11520
11713
|
* pool. A provider whose session can never be made clean again (MySQL2, which
|
|
11521
11714
|
* has executed `USE` and possibly author-owned statements) destroys
|
|
11522
11715
|
* unconditionally and ignores the flag.
|
|
11716
|
+
*
|
|
11717
|
+
* `lost` is true when the connection itself is gone or stopped answering:
|
|
11718
|
+
* the provider must send nothing more on it — not even the reset a discard
|
|
11719
|
+
* otherwise runs — and abandon or destroy it.
|
|
11523
11720
|
*/
|
|
11524
|
-
release(discard: boolean): Promise<void>;
|
|
11721
|
+
release(discard: boolean, lost?: boolean): Promise<void>;
|
|
11525
11722
|
}
|
|
11526
11723
|
//#endregion
|
|
11527
11724
|
//#region src/drivers/driver.d.ts
|
|
11725
|
+
/** A PostgreSQL driver's transport assertion for migration sessions. */
|
|
11726
|
+
type MigrationSessionAttestation = "dedicated-session";
|
|
11727
|
+
/**
|
|
11728
|
+
* What a SQLite driver states to run effectful migration work. Each member is a
|
|
11729
|
+
* safety claim with one admitted value; a driver that cannot make all of them
|
|
11730
|
+
* does not declare the capability. Whether it runs callback transactions stays
|
|
11731
|
+
* the driver's own `supportsTransactions` declaration, read beside this one.
|
|
11732
|
+
*/
|
|
11733
|
+
interface SqliteMigrationCapability {
|
|
11734
|
+
/**
|
|
11735
|
+
* `PRAGMA foreign_keys` run between transactions on the migration's
|
|
11736
|
+
* connection takes effect there and reads back.
|
|
11737
|
+
*/
|
|
11738
|
+
readonly foreignKeys: "pragma";
|
|
11739
|
+
/**
|
|
11740
|
+
* The platform reserves no table names: every table outside `sqlite_*` is
|
|
11741
|
+
* the caller's. Cloudflare's `_cf_*` tables are why D1 cannot declare it.
|
|
11742
|
+
*/
|
|
11743
|
+
readonly reservedTablePrefixes: "none";
|
|
11744
|
+
/**
|
|
11745
|
+
* Every transaction this driver opens holds SQLite's database write lock
|
|
11746
|
+
* from its BEGIN (`BEGIN IMMEDIATE`), so no other writer interleaves with a
|
|
11747
|
+
* migration transaction before it commits or rolls back.
|
|
11748
|
+
*/
|
|
11749
|
+
readonly exclusion: "database-write-lock";
|
|
11750
|
+
}
|
|
11751
|
+
declare const SQLITE_MIGRATION_CAPABILITY: SqliteMigrationCapability;
|
|
11528
11752
|
declare abstract class Driver<TClient, TTransaction> extends DriverTransactionBase<TClient, TTransaction> {
|
|
11529
11753
|
protected createTransactionBoundDriver(tx: TTransaction, context: QueryExecutionContext): TransactionBoundDriver<TClient, TTransaction>;
|
|
11530
11754
|
/**
|
|
@@ -11564,6 +11788,40 @@ declare abstract class Driver<TClient, TTransaction> extends DriverTransactionBa
|
|
|
11564
11788
|
* client a caller may hand to several drivers.
|
|
11565
11789
|
*/
|
|
11566
11790
|
protected physicalPinnedSession?(): Promise<object>;
|
|
11791
|
+
/**
|
|
11792
|
+
* Every endpoint this PostgreSQL driver's configuration names for its
|
|
11793
|
+
* sessions — host names and connection URLs, as configured; entries that are
|
|
11794
|
+
* not strings name nothing — read when a migration command is admitted.
|
|
11795
|
+
* Absent on a driver that names none (PGlite, a custom driver). Migration
|
|
11796
|
+
* admission is its one consumer: it refuses effectful commands when one of
|
|
11797
|
+
* them is a transaction-pooling host it knows (Cloudflare Hyperdrive, a Neon
|
|
11798
|
+
* `-pooler` endpoint), because a session lock taken there is held by
|
|
11799
|
+
* whichever server session served that statement.
|
|
11800
|
+
*/
|
|
11801
|
+
protected migrationSessionEndpoints?(): readonly unknown[];
|
|
11802
|
+
/**
|
|
11803
|
+
* The caller's claim, at their risk, that every connection this PostgreSQL
|
|
11804
|
+
* driver opens is one server session for its whole life. It lifts only the
|
|
11805
|
+
* pooler-host refusal; a driver with no pinned-session hook stays refused.
|
|
11806
|
+
* Installed like `migrationNamespaceAttestation`: only the exact literal.
|
|
11807
|
+
*/
|
|
11808
|
+
readonly migrationSessionAttestation: MigrationSessionAttestation | undefined;
|
|
11809
|
+
/**
|
|
11810
|
+
* This SQLite driver's migration capability, or absent. Its presence binds a
|
|
11811
|
+
* custom SQLite driver to VibORM's SQLite migration implementation, and
|
|
11812
|
+
* effectful migration work is admitted only on a driver that declares it.
|
|
11813
|
+
* Only the exact {@link SQLITE_MIGRATION_CAPABILITY} values count.
|
|
11814
|
+
*/
|
|
11815
|
+
readonly sqliteMigrationCapability: SqliteMigrationCapability | undefined;
|
|
11816
|
+
/**
|
|
11817
|
+
* Runs on the migration's connection immediately before a SQLite table
|
|
11818
|
+
* recreation's `PRAGMA foreign_keys = OFF`, outside any transaction, or is
|
|
11819
|
+
* absent. SQLite ignores that pragma while a write is pending, so a driver
|
|
11820
|
+
* whose platform can hold one open settles it here: a Durable Object driver
|
|
11821
|
+
* calls `await ctx.storage.sync()`. The pragma is read back afterwards
|
|
11822
|
+
* either way, and the recreation is refused when it still reads 1.
|
|
11823
|
+
*/
|
|
11824
|
+
protected beforeForeignKeysOff?(): Promise<void>;
|
|
11567
11825
|
disconnect(): Promise<void>;
|
|
11568
11826
|
}
|
|
11569
11827
|
/**
|
|
@@ -11659,7 +11917,8 @@ declare class TransactionBoundDriver<TClient, TTransaction> extends Driver<TClie
|
|
|
11659
11917
|
* substrate (result shape, program lowering, identity helpers); the client never
|
|
11660
11918
|
* spells them, and they share their family's arg schema.
|
|
11661
11919
|
*/
|
|
11662
|
-
|
|
11920
|
+
declare const OPERATIONS: readonly ["findFirst", "findMany", "findUnique", "create", "createMany", "createManyAndReturn", "update", "updateMany", "updateManyAndReturn", "delete", "deleteMany", "deleteManyAndReturn", "upsert", "count", "aggregate", "groupBy", "exist"];
|
|
11921
|
+
type Operation = (typeof OPERATIONS)[number];
|
|
11663
11922
|
//#endregion
|
|
11664
11923
|
//#region src/adapters/adapter-result-parser.d.ts
|
|
11665
11924
|
interface AdapterResultParser {
|
|
@@ -11921,7 +12180,11 @@ interface DatabaseAdapter {
|
|
|
11921
12180
|
true: () => Sql;
|
|
11922
12181
|
/** FALSE literal (database-specific: FALSE vs 0) */
|
|
11923
12182
|
false: () => Sql;
|
|
11924
|
-
/**
|
|
12183
|
+
/**
|
|
12184
|
+
* Returns the dialect's membership operand, valid only as `operators.in` /
|
|
12185
|
+
* `notIn` input: a parenthesized list, a PostgreSQL array parameter, or,
|
|
12186
|
+
* past 25 members, a SQLite `json_each` subquery.
|
|
12187
|
+
*/
|
|
11925
12188
|
list: (values: Sql[]) => Sql;
|
|
11926
12189
|
/** JSON value (PG: native, MySQL/SQLite: JSON.stringify) */
|
|
11927
12190
|
json: (v: unknown) => Sql;
|
|
@@ -12114,7 +12377,8 @@ interface DatabaseAdapter {
|
|
|
12114
12377
|
* would bind the hex text's own bytes, so the binary arm decodes it
|
|
12115
12378
|
* (`decode(…, 'hex')`, `UNHEX`, `unhex`). SQLite's `unhex()` arrived in
|
|
12116
12379
|
* 3.41, above this adapter's 3.35 floor: a compact identifier on SQLite
|
|
12117
|
-
* needs 3.41, and
|
|
12380
|
+
* needs 3.41, and so does a bytes list longer than `literals.list` keeps
|
|
12381
|
+
* parenthesized; nothing else here does.
|
|
12118
12382
|
*/
|
|
12119
12383
|
idCast: (expr: Sql, representation: IdRepresentation) => Sql;
|
|
12120
12384
|
coalesce: (...exprs: Sql[]) => Sql;
|
|
@@ -12138,6 +12402,33 @@ interface DatabaseAdapter {
|
|
|
12138
12402
|
count: (expr?: Sql) => Sql;
|
|
12139
12403
|
countDistinct: (expr: Sql) => Sql;
|
|
12140
12404
|
sum: (expr: Sql) => Sql;
|
|
12405
|
+
/**
|
|
12406
|
+
* A double column's sum as two `SUM`s no row count can overflow: its
|
|
12407
|
+
* members of magnitude at least 1e-288 divided by 2^64, and the smaller
|
|
12408
|
+
* ones as they are. Dividing such a double by 2^64 is exact, so the first
|
|
12409
|
+
* part is the plain sum scaled exactly, and the reader's
|
|
12410
|
+
* `high * 2^64 + low` is that sum — `±Infinity` past the double range,
|
|
12411
|
+
* where PostgreSQL's own `SUM` raises and MySQL's answers 0 (engine-10).
|
|
12412
|
+
*
|
|
12413
|
+
* `having` compares `value` and a grouped `orderBy` sorts by `order`, so
|
|
12414
|
+
* a group is kept and placed by the sum the projection publishes.
|
|
12415
|
+
*/
|
|
12416
|
+
numberSum: (expr: Sql) => {
|
|
12417
|
+
readonly parts: readonly [high: Sql, low: Sql];
|
|
12418
|
+
/** The joined sum as one comparable expression. */
|
|
12419
|
+
readonly value: Sql;
|
|
12420
|
+
/** Sort keys, most significant first, ordering by the joined sum. */
|
|
12421
|
+
readonly order: readonly Sql[];
|
|
12422
|
+
};
|
|
12423
|
+
/**
|
|
12424
|
+
* Stated only where an integer `SUM` is int64 and raises past it
|
|
12425
|
+
* (SQLite): an int64 column's sum as two `SUM`s no realistic row count
|
|
12426
|
+
* can overflow — each member's high 32 bits and the rest — read back
|
|
12427
|
+
* exactly as `high * 2^32 + low` (engine-10), compared and sorted as
|
|
12428
|
+
* `numberSum` states. PostgreSQL and MySQL already sum integers as exact
|
|
12429
|
+
* numerics.
|
|
12430
|
+
*/
|
|
12431
|
+
integerSum?: DatabaseAdapter["aggregates"]["numberSum"];
|
|
12141
12432
|
avg: (expr: Sql) => Sql;
|
|
12142
12433
|
min: (expr: Sql, boolean?: boolean) => Sql;
|
|
12143
12434
|
max: (expr: Sql, boolean?: boolean) => Sql;
|
|
@@ -12662,6 +12953,12 @@ declare class MySQLAdapter implements DatabaseAdapter {
|
|
|
12662
12953
|
count: (expr?: Sql) => Sql;
|
|
12663
12954
|
countDistinct: (expr: Sql) => Sql;
|
|
12664
12955
|
sum: (expr: Sql) => Sql;
|
|
12956
|
+
numberSum: (expr: Sql) => {
|
|
12957
|
+
readonly parts: readonly [high: Sql, low: Sql];
|
|
12958
|
+
readonly value: Sql;
|
|
12959
|
+
readonly order: readonly Sql[];
|
|
12960
|
+
};
|
|
12961
|
+
integerSum?: DatabaseAdapter["aggregates"]["numberSum"] | undefined;
|
|
12665
12962
|
avg: (expr: Sql) => Sql;
|
|
12666
12963
|
min: (expr: Sql, boolean?: boolean) => Sql;
|
|
12667
12964
|
max: (expr: Sql, boolean?: boolean) => Sql;
|
|
@@ -12675,7 +12972,7 @@ declare class MySQLAdapter implements DatabaseAdapter {
|
|
|
12675
12972
|
array: (items: Sql[]) => Sql;
|
|
12676
12973
|
emptyArray: () => Sql;
|
|
12677
12974
|
agg: (expr: Sql) => Sql;
|
|
12678
|
-
objectFromColumns: (
|
|
12975
|
+
objectFromColumns: (pairs: [string, Sql][]) => Sql;
|
|
12679
12976
|
extract: (column: Sql, path: string[]) => Sql;
|
|
12680
12977
|
extractText: (column: Sql, path: string[]) => Sql;
|
|
12681
12978
|
numberAtPath: (column: Sql, path: string[]) => Sql;
|
|
@@ -12802,6 +13099,7 @@ declare class MySQLAdapter implements DatabaseAdapter {
|
|
|
12802
13099
|
}
|
|
12803
13100
|
//#endregion
|
|
12804
13101
|
//#region src/adapters/databases/postgres/postgres-adapter.d.ts
|
|
13102
|
+
declare function postgresAsciiCaseFold(expr: Sql): Sql;
|
|
12805
13103
|
declare function postgresJsonObject(pairs: [string, Sql][]): Sql;
|
|
12806
13104
|
declare class PostgresAdapter implements DatabaseAdapter {
|
|
12807
13105
|
#private;
|
|
@@ -12822,9 +13120,9 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
12822
13120
|
json: (v: unknown) => Sql;
|
|
12823
13121
|
decimal: (canonical: string, descriptor: DecimalDescriptor) => Sql;
|
|
12824
13122
|
id: (physical: string | Uint8Array, representation: IdRepresentation) => Sql;
|
|
13123
|
+
list: (values: Sql[]) => Sql;
|
|
12825
13124
|
value: (v: unknown) => Sql;
|
|
12826
13125
|
null: () => Sql;
|
|
12827
|
-
list: (values: Sql[]) => Sql;
|
|
12828
13126
|
};
|
|
12829
13127
|
operators: {
|
|
12830
13128
|
exists: (subquery: Sql) => Sql;
|
|
@@ -12836,8 +13134,6 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
12836
13134
|
notBetween: (column: Sql, min: Sql, max: Sql) => Sql;
|
|
12837
13135
|
isNull: (expr: Sql) => Sql;
|
|
12838
13136
|
isNotNull: (expr: Sql) => Sql;
|
|
12839
|
-
in: (column: Sql, values: Sql) => Sql;
|
|
12840
|
-
notIn: (column: Sql, values: Sql) => Sql;
|
|
12841
13137
|
like: (column: Sql, pattern: Sql) => Sql;
|
|
12842
13138
|
notLike: (column: Sql, pattern: Sql) => Sql;
|
|
12843
13139
|
ilike: (column: Sql, pattern: Sql) => Sql;
|
|
@@ -12848,6 +13144,8 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
12848
13144
|
startsWithPrefix: (column: Sql, value: string, nativeType?: NativeTypeDeclaration) => Sql;
|
|
12849
13145
|
exactTextEq: (column: Sql, value: Sql, nativeType?: NativeTypeDeclaration) => Sql;
|
|
12850
13146
|
exactTextIn: (column: Sql, values: Sql, nativeType?: NativeTypeDeclaration) => Sql;
|
|
13147
|
+
in: (column: Sql, values: Sql) => Sql;
|
|
13148
|
+
notIn: (column: Sql, values: Sql) => Sql;
|
|
12851
13149
|
eq: (left: Sql, right: Sql) => Sql;
|
|
12852
13150
|
neq: (left: Sql, right: Sql) => Sql;
|
|
12853
13151
|
lt: (left: Sql, right: Sql) => Sql;
|
|
@@ -12857,7 +13155,7 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
12857
13155
|
};
|
|
12858
13156
|
expressions: {
|
|
12859
13157
|
caseSensitiveText: (expr: Sql, nativeType?: NativeTypeDeclaration, textOperation?: boolean) => Sql;
|
|
12860
|
-
asciiCaseFold:
|
|
13158
|
+
asciiCaseFold: typeof postgresAsciiCaseFold;
|
|
12861
13159
|
concat: (...parts: Sql[]) => Sql;
|
|
12862
13160
|
greatest: (...exprs: Sql[]) => Sql;
|
|
12863
13161
|
least: (...exprs: Sql[]) => Sql;
|
|
@@ -12886,6 +13184,12 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
12886
13184
|
count: (expr?: Sql) => Sql;
|
|
12887
13185
|
countDistinct: (expr: Sql) => Sql;
|
|
12888
13186
|
sum: (expr: Sql) => Sql;
|
|
13187
|
+
numberSum: (expr: Sql) => {
|
|
13188
|
+
readonly parts: readonly [high: Sql, low: Sql];
|
|
13189
|
+
readonly value: Sql;
|
|
13190
|
+
readonly order: readonly Sql[];
|
|
13191
|
+
};
|
|
13192
|
+
integerSum?: DatabaseAdapter["aggregates"]["numberSum"] | undefined;
|
|
12889
13193
|
avg: (expr: Sql) => Sql;
|
|
12890
13194
|
};
|
|
12891
13195
|
json: {
|
|
@@ -13024,6 +13328,15 @@ declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
13024
13328
|
//#region src/adapters/databases/sqlite/sqlite-adapter.d.ts
|
|
13025
13329
|
/** Admit the exact TEXT-to-INTEGER cast domain, including its 19-digit edges. */
|
|
13026
13330
|
declare function sqliteIntegerPrecision(coefficient: string): number | undefined;
|
|
13331
|
+
/**
|
|
13332
|
+
* engine-09: a list longer than {@link PLANNED_LIST} whose members are each one
|
|
13333
|
+
* parameter under one spelling — bare, or a decimal's coefficient cast — as
|
|
13334
|
+
* ONE parameter, a JSON array `json_each` reads back and spells per element as
|
|
13335
|
+
* each member was, so `IN` and `NOT IN` keep their answers, NULLs included.
|
|
13336
|
+
* Blobs travel as hex, read through `unhex` (SQLite 3.41). Any other list
|
|
13337
|
+
* keeps a parameter per member.
|
|
13338
|
+
*/
|
|
13339
|
+
declare function sqliteList(members: Sql[]): Sql;
|
|
13027
13340
|
/** Facts a SQLite driver states about its transport. */
|
|
13028
13341
|
interface SQLiteAdapterOptions {
|
|
13029
13342
|
/**
|
|
@@ -13055,8 +13368,8 @@ declare class SQLiteAdapter implements DatabaseAdapter {
|
|
|
13055
13368
|
dateTime: (iso: string, nativeType?: NativeTypeDeclaration) => Sql;
|
|
13056
13369
|
decimal: (canonical: string, descriptor: DecimalDescriptor) => Sql;
|
|
13057
13370
|
id: (physical: string | Uint8Array, _representation: IdRepresentation) => Sql;
|
|
13371
|
+
list: typeof sqliteList;
|
|
13058
13372
|
null: () => Sql;
|
|
13059
|
-
list: (values: Sql[]) => Sql;
|
|
13060
13373
|
};
|
|
13061
13374
|
operators: {
|
|
13062
13375
|
exists: (subquery: Sql) => Sql;
|
|
@@ -13113,9 +13426,19 @@ declare class SQLiteAdapter implements DatabaseAdapter {
|
|
|
13113
13426
|
aggregates: {
|
|
13114
13427
|
decimalAvg: (column: Sql, _descriptor: DecimalDescriptor) => Sql;
|
|
13115
13428
|
decimalSumOperandPrecision: typeof sqliteIntegerPrecision;
|
|
13429
|
+
integerSum: (column: Sql) => {
|
|
13430
|
+
parts: readonly [Sql, Sql];
|
|
13431
|
+
value: Sql;
|
|
13432
|
+
order: Sql[];
|
|
13433
|
+
};
|
|
13116
13434
|
count: (expr?: Sql) => Sql;
|
|
13117
13435
|
countDistinct: (expr: Sql) => Sql;
|
|
13118
13436
|
sum: (expr: Sql) => Sql;
|
|
13437
|
+
numberSum: (expr: Sql) => {
|
|
13438
|
+
readonly parts: readonly [high: Sql, low: Sql];
|
|
13439
|
+
readonly value: Sql;
|
|
13440
|
+
readonly order: readonly Sql[];
|
|
13441
|
+
};
|
|
13119
13442
|
avg: (expr: Sql) => Sql;
|
|
13120
13443
|
min: (expr: Sql, boolean?: boolean) => Sql;
|
|
13121
13444
|
max: (expr: Sql, boolean?: boolean) => Sql;
|
|
@@ -13129,7 +13452,7 @@ declare class SQLiteAdapter implements DatabaseAdapter {
|
|
|
13129
13452
|
array: (items: Sql[]) => Sql;
|
|
13130
13453
|
emptyArray: () => Sql;
|
|
13131
13454
|
agg: (expr: Sql) => Sql;
|
|
13132
|
-
objectFromColumns: (
|
|
13455
|
+
objectFromColumns: (pairs: [string, Sql][]) => Sql;
|
|
13133
13456
|
extract: (column: Sql, path: string[]) => Sql;
|
|
13134
13457
|
extractText: (column: Sql, path: string[]) => Sql;
|
|
13135
13458
|
numberAtPath: (column: Sql, path: string[]) => Sql;
|
|
@@ -13260,4 +13583,4 @@ declare const mysqlAdapter: MySQLAdapter;
|
|
|
13260
13583
|
declare const postgresAdapter: PostgresAdapter;
|
|
13261
13584
|
declare const sqliteAdapter: SQLiteAdapter;
|
|
13262
13585
|
//#endregion
|
|
13263
|
-
export {
|
|
13586
|
+
export { SchemaRegistryOperation as $, GeneratorDefaultBrand as $n, InvalidTransactionInputError as $r, EmptyClientExtensionState as $t, Schema$1 as A, CacheOperationNotCacheableError as Ai, Dialect as An, BaseBigIntSchema as Ar, getOperationPayloadSchema as At, LinkedClientConfig as B, GeoBounds as Bi, isFieldRef as Bn, JsonNullSentinel as Br, VibORMConfig as Bt, Client as C, isForeignKeyError as Ci, WithCacheOptions as Cn, IsoTimestampSchema as Cr, BooleanScalar as Ct, OperationPayloadSchema as D, CacheConfigurationError as Di, TransactionOptionSupport as Dn, BooleanSchema as Dr, ModelToManyRelation as Dt, OperationPayload as E, isValueTooLongError as Ei, DriverTransactionOptions as En, BaseBooleanSchema as Er, ReferencesStage as Et, GroupByResultType as F, isVibORMError as Fi, StringSchema as Fn, AnyJsonNullSentinel as Fr, ExtendedClient as Ft, VariantToOneRelation as G, MYSQL as Gi, InitialModelState as Gn, Getter as Gr, NoControls as Gt, RelationLinks as H, GeoPolygon as Hi, IndexDefinition as Hn, JsonSchema$1 as Hr, defaultOmit as Ht, InferSelectInclude as I, toPrismaErrorCode as Ii, AnyFieldRef as In, AnyNull as Ir, ExtendedOperationResult as It, InferInput as J, PG as Ji, ModelState as Jn, RelationCardinality as Jr, defineExtension as Jt, Scalar as K, NativeType as Ki, Model$1 as Kn, JunctionReferentialAction as Kr, PlacedControl as Kt, ClientSchema as L, wrapError as Li, FieldRef as Ln, DbNull as Lr, ExtensionState as Lt, AggregateResultType as M, VibORMError as Mi, QueryResult as Mn, createJsonSchemaConverter as Mr, renderSchemaType as Mt, BatchPayload as N, VibORMErrorCode as Ni, V$1 as Nn, toJsonSchema as Nr, validateOperationPayload as Nt, OperationResult as O, CacheInvalidKeyError as Oi, BatchQuery as On, BaseBlobSchema as Or, s as Ot, CountResultType as P, isRetryableError as Pi, v as Pn, createSchemaRegistry as Pr, DriverConfig as Pt, SchemaRegistryLookup as Q, AutoGenerateType as Qn, isValidationError as Qr, ClientExtensionState as Qt, FlatSchema as R, DiagnosticDisclosure as Ri, ModelFieldRefs as Rn, JsonNull as Rr, NoExtraDriverConfigKeys as Rt, CachedClient as S, isCheckConstraintError as Si, CacheInvalidationOptions as Sn, IsoTimeSchema as Sr, DateScalar as St, MutationOperations as T, isUniqueConstraintError as Ti, BatchTransactionOptions as Tn, EnumSchema as Tr, ModelToOneRelation as Tt, ModelShape as U, DecimalDescriptor as Ui, IndexOptions as Un, inferred as Ur, OfficialCacheExtension as Ut, type Links as V, GeoPoint as Vi, AnyModel as Vn, isJsonNullSentinel as Vr, createClient as Vt, VariantToManyRelation as W, Decimal as Wi, IndexType as Wn, AnyRelation as Wr, DefinitionControls as Wt, ParseResult as X, DecimalSchema as Xn, ValidationError as Xr, StatementHandler as Xt, InferOutput as Y, SQLITE as Yi, UpdateState as Yn, RelationSlot as Yr, StatementContext as Yt, Prettify as Z, AutoGenerate as Zn, ValidationErrorSource as Zr, AccumulatedExtensionState as Zt, ObservationCompletion as _, CheckConstraintError as _i, isPendingOperation as _n, JsonValue as _r, IntScalar as _t, PostgresAdapter as a, NestedWriteError as ai, validateSchema as an, BaseVectorSchema as ar, ModelRelationNestedInput as at, OFFICIAL_INSTRUMENTATION_NAME as b, UniqueConstraintError as bi, CacheSetOptions as bn, BaseIsoTimestampSchema as br, TimeScalar as bt, Operation as c, QueryEngineError as ci, isSchemaValidationError as cn, PointSchema as cr, ScalarSchemas as ct, MigrationSessionAttestation as d, isClientInitializationError as di, ValidationResult$1 as dn, BaseNumberSchema as dr, NumericScalar as dt, TransactionError as ei, ExtensionCacheState as en, InitialScalarState as er, VibSchema as et, SQLITE_MIGRATION_CAPABILITY as f, isNotFoundError as fi, DateTimePhysicalForm as fn, IntegerSchema as fr, VectorScalar as ft, MigrationNamespaceAttestation as g, isMigrationError as gi, UnwrapPendingOperations as gn, JsonSchema as gr, JsonScalar as gt, DriverResultParser as h, MigrationError as hi, UnwrapPendingOperation as hn, InputJsonValue as hr, NumberScalar as ht, SQLiteAdapter as i, NestedWriteAssertionError as ii, RawOperation as in, parse as ir, ModelOperationInput as it, ValidatedOperationPayload as j, PrismaErrorCode as ji, QueryExecutionContext as jn, BigIntSchema as jr, renderOperationResultType as jt, Operations as k, CacheInvalidTTLError as ki, CommittedBatchNotification as kn, BlobSchema as kr, getSchemas as kt, AnyDriver as l, QueryError as li, SchemaValidationIssue as ln, ObjectSchema as lr, ArgsSchemas as lt, PinnedSessionReservation as m, isUnsupportedOperationError as mi, PendingOperation as mn, BaseJsonSchema as mr, PointScalar as mt, postgresAdapter as n, ConnectionError as ni, ExtensionResultConsumerState as nn, ScalarType as nr, ModelCoreInput as nt, MySQLAdapter as o, NotFoundError as oi, validateSchemaOrThrow as on, VectorSchema as or, ModelSchemas as ot, SqliteMigrationCapability as p, isPendingOperationError as pi, Schema$3 as pn, NumberSchema as pr, StringScalar as pt, BigIntScalar as q, NativeTypeMap as qi, ModelInternal as qn, ReferentialAction as qr, ClientExtension as qt, sqliteAdapter as r, FeatureNotSupportedError as ri, MergeExtensionState as rn, UpdateState$1 as rr, ModelCoreSchemas as rt, DatabaseAdapter as s, PendingOperationError as si, SchemaValidationError as sn, BasePointSchema as sr, ModelStateSchemas as st, mysqlAdapter as t, ClientInitializationError as ti, ExtensionContributionState as tn, ScalarState as tr, ModelArgsSchemas as tt, Driver as u, UnsupportedOperationError as ui, Severity as un, BaseIntegerSchema as ur, CoreSchemas as ut, ObservationUnit as v, ForeignKeyError as vi, CacheDriver as vn, BaseIsoDateSchema as vr, EnumScalar as vt, InferDatabase as w, isNotNullConstraintError as wi, sqliteResultParser as wn, BaseEnumSchema as wr, BlobScalar as wt, CacheableOperations as x, ValueTooLongError as xi, WaitUntilFn as xn, IsoDateSchema as xr, DateTimeScalar as xt, ObserveHandler as y, NotNullConstraintError as yi, CacheEntry as yn, BaseIsoTimeSchema as yr, DecimalScalar as yt, Linked as z, GeoArea as zi, createModelFieldRefs as zn, JsonNullKind as zr, VibORMClient as zt };
|