viborm 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-namespace-BLejG8FA.mjs → adapter-namespace-NnXlXR8c.mjs} +2 -2
- package/dist/{adapter-namespace-BLejG8FA.mjs.map → adapter-namespace-NnXlXR8c.mjs.map} +1 -1
- package/dist/adapters.d.mts +1 -1
- package/dist/adapters.mjs +1 -1
- package/dist/builder-BxCr9ANq.mjs +2 -0
- package/dist/builder-BxCr9ANq.mjs.map +1 -0
- package/dist/bun-sql.d.mts +1 -1
- package/dist/bun-sql.mjs +1 -1
- package/dist/bun-sqlite.d.mts +1 -1
- package/dist/bun-sqlite.mjs +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.d.mts +1 -1
- package/dist/cache.mjs +1 -1
- package/dist/{chain-D5J9hIw-.mjs → chain-C4EUyLzF.mjs} +2 -2
- package/dist/{chain-D5J9hIw-.mjs.map → chain-C4EUyLzF.mjs.map} +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/{client-BzgBm_86.d.mts → client-D-XiaClb.d.mts} +1 -1
- package/dist/client-DACEO6tS.mjs +2 -0
- package/dist/client-DACEO6tS.mjs.map +1 -0
- package/dist/{client-aU3YhZ6G.mjs → client-sAey5P-I.mjs} +2 -2
- package/dist/{client-aU3YhZ6G.mjs.map → client-sAey5P-I.mjs.map} +1 -1
- package/dist/client.d.mts +1 -1
- package/dist/client.mjs +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +1 -1
- package/dist/current-C2fZL9Ln.mjs +2 -0
- package/dist/current-C2fZL9Ln.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-lX7IJBlz.mjs → datetime-physical-codec-CFoeuitT.mjs} +2 -2
- package/dist/{datetime-physical-codec-lX7IJBlz.mjs.map → datetime-physical-codec-CFoeuitT.mjs.map} +1 -1
- package/dist/{driver-u2qJicrE.mjs → driver-BqD-3_jO.mjs} +2 -2
- package/dist/{driver-u2qJicrE.mjs.map → driver-BqD-3_jO.mjs.map} +1 -1
- package/dist/driver-DseQwbsu.mjs +2 -0
- package/dist/driver-DseQwbsu.mjs.map +1 -0
- package/dist/driver.d.mts +1 -1
- package/dist/driver.mjs +1 -1
- package/dist/every-CEQMQEdt.mjs +2 -0
- package/dist/{every-CzF00eDV.mjs.map → every-CEQMQEdt.mjs.map} +1 -1
- package/dist/execution-context-asSCmyas.mjs +2 -0
- package/dist/execution-context-asSCmyas.mjs.map +1 -0
- package/dist/{geo-area-codec-BmMmWgU_.mjs → geo-area-codec-4W5b7whM.mjs} +2 -2
- package/dist/{geo-area-codec-BmMmWgU_.mjs.map → geo-area-codec-4W5b7whM.mjs.map} +1 -1
- package/dist/geo-point-codec-pAWYj5ZZ.mjs +2 -0
- package/dist/geo-point-codec-pAWYj5ZZ.mjs.map +1 -0
- package/dist/{hydration-BflrXEIQ.mjs → hydration-Az2rjp5a.mjs} +2 -2
- package/dist/{hydration-BflrXEIQ.mjs.map → hydration-Az2rjp5a.mjs.map} +1 -1
- package/dist/{identifier-conversion-Dc0Rf4Gi.mjs → identifier-conversion-ufaCNi9E.mjs} +2 -2
- package/dist/{identifier-conversion-Dc0Rf4Gi.mjs.map → identifier-conversion-ufaCNi9E.mjs.map} +1 -1
- package/dist/{index-B4IWFJfv.d.mts → index-Ci8b13Lm.d.mts} +52 -6
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/instrumentation.d.mts +1 -1
- package/dist/instrumentation.mjs +1 -1
- package/dist/instrumentation.mjs.map +1 -1
- package/dist/{key-B89Z4vxn.mjs → key-CyLRw0ne.mjs} +2 -2
- package/dist/{key-B89Z4vxn.mjs.map → key-CyLRw0ne.mjs.map} +1 -1
- package/dist/{libsql-CrDXsfpL.mjs → libsql-DPrXWc_J.mjs} +2 -2
- package/dist/{libsql-CrDXsfpL.mjs.map → libsql-DPrXWc_J.mjs.map} +1 -1
- package/dist/libsql.d.mts +1 -1
- package/dist/libsql.mjs +1 -1
- package/dist/libsql.mjs.map +1 -1
- package/dist/{memory-TXO4KgBy.mjs → memory-DiTWROVS.mjs} +2 -2
- package/dist/{memory-TXO4KgBy.mjs.map → memory-DiTWROVS.mjs.map} +1 -1
- package/dist/migrations/mysql.d.mts +4 -4
- package/dist/migrations/mysql.mjs +1 -1
- package/dist/migrations/postgres.d.mts +4 -4
- package/dist/migrations/postgres.mjs +1 -1
- package/dist/migrations/sqlite.d.mts +4 -4
- package/dist/migrations/sqlite.mjs +1 -1
- package/dist/migrations/tenant.d.mts +2 -2
- package/dist/migrations/tenant.mjs +1 -1
- package/dist/migrations.d.mts +4 -4
- package/dist/migrations.mjs +1 -1
- package/dist/{mysql-adapter-C5CMIYRS.mjs → mysql-adapter-B1U35CJn.mjs} +2 -2
- package/dist/{mysql-adapter-C5CMIYRS.mjs.map → mysql-adapter-B1U35CJn.mjs.map} +1 -1
- package/dist/{mysql-C2vOPcuA.mjs → mysql-fJlFIW7m.mjs} +2 -2
- package/dist/{mysql-C2vOPcuA.mjs.map → mysql-fJlFIW7m.mjs.map} +1 -1
- package/dist/mysql2.d.mts +1 -1
- package/dist/mysql2.mjs +1 -1
- package/dist/neon-http.d.mts +1 -1
- package/dist/neon-http.mjs +1 -1
- package/dist/{object-store-uRqi0URP.d.mts → object-store-H7fJwgPR.d.mts} +3 -3
- package/dist/permissions.d.mts +1 -1
- package/dist/permissions.mjs +1 -1
- package/dist/pg.d.mts +1 -1
- package/dist/pg.mjs +1 -1
- package/dist/pg.mjs.map +1 -1
- package/dist/pglite.d.mts +1 -1
- package/dist/pglite.mjs +1 -1
- package/dist/{physical-uJfmo4-Z.mjs → physical-C4D-979R.mjs} +2 -2
- package/dist/{physical-uJfmo4-Z.mjs.map → physical-C4D-979R.mjs.map} +1 -1
- package/dist/planetscale.d.mts +1 -1
- package/dist/planetscale.mjs +1 -1
- package/dist/planetscale.mjs.map +1 -1
- package/dist/{planner-SzkGh-3T.d.mts → planner-CUcPdJwD.d.mts} +1 -1
- package/dist/{postgres-BSmy1PYR.mjs → postgres-DD92WdFu.mjs} +2 -2
- package/dist/{postgres-BSmy1PYR.mjs.map → postgres-DD92WdFu.mjs.map} +1 -1
- package/dist/{postgres-adapter-BAqRfWl1.mjs → postgres-adapter-B7hzWhky.mjs} +2 -2
- package/dist/{postgres-adapter-BAqRfWl1.mjs.map → postgres-adapter-B7hzWhky.mjs.map} +1 -1
- package/dist/{postgres-adapter-B1RyJlWL.mjs → postgres-adapter-CJmoxTW7.mjs} +2 -2
- package/dist/{postgres-adapter-B1RyJlWL.mjs.map → postgres-adapter-CJmoxTW7.mjs.map} +1 -1
- package/dist/postgres.d.mts +1 -1
- package/dist/postgres.mjs +1 -1
- package/dist/postgres.mjs.map +1 -1
- package/dist/{provider-limits-V09frtmK.mjs → provider-limits-D0ECF7_Q.mjs} +2 -2
- package/dist/{provider-limits-V09frtmK.mjs.map → provider-limits-D0ECF7_Q.mjs.map} +1 -1
- package/dist/result-shape-ic2j3Tze.mjs +2 -0
- package/dist/result-shape-ic2j3Tze.mjs.map +1 -0
- package/dist/{rows-BiaiswSV.mjs → rows-YyvK9MDz.mjs} +2 -2
- package/dist/{rows-BiaiswSV.mjs.map → rows-YyvK9MDz.mjs.map} +1 -1
- package/dist/{scalar-Cm7nMFmO.mjs → scalar-Dyns7kc7.mjs} +2 -2
- package/dist/{scalar-Cm7nMFmO.mjs.map → scalar-Dyns7kc7.mjs.map} +1 -1
- package/dist/schema/json.d.mts +1 -1
- package/dist/schema/json.mjs +1 -1
- package/dist/{schema-tGtziyCJ.mjs → schema-CUm_yh6L.mjs} +2 -2
- package/dist/{schema-tGtziyCJ.mjs.map → schema-CUm_yh6L.mjs.map} +1 -1
- package/dist/{schema-introspection-C1-XrQP4.mjs → schema-introspection-LpRNeSG2.mjs} +2 -2
- package/dist/{schema-introspection-C1-XrQP4.mjs.map → schema-introspection-LpRNeSG2.mjs.map} +1 -1
- package/dist/schema.d.mts +1 -1
- package/dist/schema.mjs +1 -1
- package/dist/soft-delete.d.mts +1 -1
- package/dist/{sqlite-adapter-CoDeF2h2.mjs → sqlite-adapter-CLWY4B8w.mjs} +2 -2
- package/dist/sqlite-adapter-CLWY4B8w.mjs.map +1 -0
- package/dist/{sqlite-utils-C0TyzOys.mjs → sqlite-utils-C5_KQPZn.mjs} +2 -2
- package/dist/{sqlite-utils-C0TyzOys.mjs.map → sqlite-utils-C5_KQPZn.mjs.map} +1 -1
- package/dist/sqlite3.d.mts +1 -1
- package/dist/sqlite3.mjs +1 -1
- package/dist/{to-many-Btc9X5Ga.mjs → to-many-DxQuOBuq.mjs} +2 -2
- package/dist/{to-many-Btc9X5Ga.mjs.map → to-many-DxQuOBuq.mjs.map} +1 -1
- package/dist/{utils-DkAxKcDD.mjs → utils-CQ2nQwwO.mjs} +2 -2
- package/dist/{utils-DkAxKcDD.mjs.map → utils-CQ2nQwwO.mjs.map} +1 -1
- package/dist/{v-514RME2X.mjs → v-BcroBusN.mjs} +2 -2
- package/dist/{v-514RME2X.mjs.map → v-BcroBusN.mjs.map} +1 -1
- package/dist/{validation-C7Z6wTJa.mjs → validation-CjWRiLWU.mjs} +2 -2
- package/dist/{validation-C7Z6wTJa.mjs.map → validation-CjWRiLWU.mjs.map} +1 -1
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/dist/{validator-CQOw7G3q.mjs → validator-yrGnrsAo.mjs} +2 -2
- package/dist/{validator-CQOw7G3q.mjs.map → validator-yrGnrsAo.mjs.map} +1 -1
- package/dist/version-DLtcW9kn.mjs +2 -0
- package/dist/{version-n393hhwM.mjs.map → version-DLtcW9kn.mjs.map} +1 -1
- package/package.json +15 -15
- package/dist/builder-BS8EW4BQ.mjs +0 -2
- package/dist/builder-BS8EW4BQ.mjs.map +0 -1
- package/dist/client-Bhl2mWam.mjs +0 -2
- package/dist/client-Bhl2mWam.mjs.map +0 -1
- package/dist/current-oXcxSCBQ.mjs +0 -2
- package/dist/current-oXcxSCBQ.mjs.map +0 -1
- package/dist/driver-CQQbCQh9.mjs +0 -2
- package/dist/driver-CQQbCQh9.mjs.map +0 -1
- package/dist/every-CzF00eDV.mjs +0 -2
- package/dist/execution-context-rJXTRVrJ.mjs +0 -2
- package/dist/execution-context-rJXTRVrJ.mjs.map +0 -1
- package/dist/geo-point-codec-D95uXgDF.mjs +0 -2
- package/dist/geo-point-codec-D95uXgDF.mjs.map +0 -1
- package/dist/result-shape-Fi1-Fvri.mjs +0 -2
- package/dist/result-shape-Fi1-Fvri.mjs.map +0 -1
- package/dist/sqlite-adapter-CoDeF2h2.mjs.map +0 -1
- package/dist/version-n393hhwM.mjs +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-
|
|
1
|
+
{"version":3,"file":"version-DLtcW9kn.mjs","names":["packageMetadata.version"],"sources":["../package.json","../src/version.ts"],"sourcesContent":["","import packageMetadata from \"../package.json\";\n\n/** Package version shared by runtime surfaces and bundled from package.json. */\nexport const VIBORM_VERSION = packageMetadata.version;\n"],"mappings":"ACGA,MAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "viborm",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Type-safe ORM for PostgreSQL, MySQL, and SQLite with a Prisma-inspired API",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -390,29 +390,29 @@
|
|
|
390
390
|
"name": "D1 Worker (viborm/d1)",
|
|
391
391
|
"path": "node_modules/.cache/viborm-size/d1-worker.mjs",
|
|
392
392
|
"gzip": true,
|
|
393
|
-
"limit": "
|
|
394
|
-
"message": "Raised 170 → 171.9 kB by the measured +1,868 B of RBAC M1 wave 1 (OD-17): rows predicates admitted, layered and parameterized, numbered binds, bound views. Raised 171.9 → 177.6 kB by the measured +5,630 B (177.29 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 177.6 → 179 kB by the measured +1,355 B (178.65 kB) of RBAC M2 wave 5 (E5: shared relation bodies, D1 balanced conjunctions, the judged write's own sentinel, the allocation fixes; the uncacheable control, OD-10; OD-17, measured + 0.3 kB headroom). Raised 179 → 179.7 kB by the measured 179.37 kB of the RBAC second review's fixes (2026-10-17): per-dialect produced rows for a judged createMany (ENG-3, setOperations.typedRows), caller SQL kept out of shared-body keys (ENG-4, Sql.peekRuns), isolated nesting levels where deepExpressions is false (ENG-6, subqueries.isolated) (OD-17, measured rounded up to 0.1 kB + 0.3 kB). Permissions application reuse (2026-10-18) measures 179,947 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 182,905 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 183,229 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 187,904 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 191,623 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 192,646 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 193,276 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 194,142 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged."
|
|
393
|
+
"limit": "195.6 kB",
|
|
394
|
+
"message": "Raised 170 → 171.9 kB by the measured +1,868 B of RBAC M1 wave 1 (OD-17): rows predicates admitted, layered and parameterized, numbered binds, bound views. Raised 171.9 → 177.6 kB by the measured +5,630 B (177.29 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 177.6 → 179 kB by the measured +1,355 B (178.65 kB) of RBAC M2 wave 5 (E5: shared relation bodies, D1 balanced conjunctions, the judged write's own sentinel, the allocation fixes; the uncacheable control, OD-10; OD-17, measured + 0.3 kB headroom). Raised 179 → 179.7 kB by the measured 179.37 kB of the RBAC second review's fixes (2026-10-17): per-dialect produced rows for a judged createMany (ENG-3, setOperations.typedRows), caller SQL kept out of shared-body keys (ENG-4, Sql.peekRuns), isolated nesting levels where deepExpressions is false (ENG-6, subqueries.isolated) (OD-17, measured rounded up to 0.1 kB + 0.3 kB). Permissions application reuse (2026-10-18) measures 179,947 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 182,905 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 183,229 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 187,904 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 191,623 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 192,646 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 193,276 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 194,142 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. The 1.4.1 fixes (opt-in findUnique batching in its leader's context, non-null unique selectors, grouped batch-route reads, indexed target matching; 2026-10-24) measure 195.25 kB on CI's Node 22.12 build, so 194.5 kB → 195.6 kB under the same OD-17 rule."
|
|
395
395
|
},
|
|
396
396
|
{
|
|
397
397
|
"name": "pg + migrations Worker (viborm/pg + viborm/migrations/postgres)",
|
|
398
398
|
"path": "node_modules/.cache/viborm-size/pg-migrations-worker.mjs",
|
|
399
399
|
"gzip": true,
|
|
400
|
-
"limit": "
|
|
401
|
-
"message": "Raised 273 → 274.4 kB by the measured +1,392 B of RBAC M1 wave 2 (K3, OD-17): rows verbs, written fields, write judgements and the clear premise; it held wave 1's +1,819 B inside its headroom. Raised 274.4 → 279.5 kB by the measured +5,720 B (279.12 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 279.5 → 280.8 kB by the measured +1,340 B (280.46 kB) of RBAC M2 wave 5 (E5: shared relation bodies, D1 balanced conjunctions, the judged write's own sentinel, the allocation fixes; the uncacheable control, OD-10; OD-17, measured + 0.3 kB headroom). Raised 280.8 → 281.6 kB by the measured 281.27 kB of the RBAC second review's fixes (2026-10-17): per-dialect produced rows for a judged createMany (ENG-3, setOperations.typedRows), caller SQL kept out of shared-body keys (ENG-4, Sql.peekRuns), isolated nesting levels where deepExpressions is false (ENG-6, subqueries.isolated), and createClient forwarding sharedRelationBodies (ENG-5) (OD-17, measured rounded up to 0.1 kB + 0.3 kB). Permissions application reuse (2026-10-18) measures 281,876 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 284,679 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 286,646 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 291,400 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 295,514 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 296,563 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 297,199 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts (2026-10-22) measure 298,985 B after two bundle-reduction reviews. Owner-approved limit follows rounding up to 0.1 kB plus 0.3 kB headroom; other resource and coverage limits are unchanged. Final prune-review fixes measure 299,039 B and remain within that approved limit. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 298,088 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts merged with shared connect UPDATEs and batched planning reads (2026-10-23) measure 299,920 B together. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged."
|
|
400
|
+
"limit": "301.4 kB",
|
|
401
|
+
"message": "Raised 273 → 274.4 kB by the measured +1,392 B of RBAC M1 wave 2 (K3, OD-17): rows verbs, written fields, write judgements and the clear premise; it held wave 1's +1,819 B inside its headroom. Raised 274.4 → 279.5 kB by the measured +5,720 B (279.12 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 279.5 → 280.8 kB by the measured +1,340 B (280.46 kB) of RBAC M2 wave 5 (E5: shared relation bodies, D1 balanced conjunctions, the judged write's own sentinel, the allocation fixes; the uncacheable control, OD-10; OD-17, measured + 0.3 kB headroom). Raised 280.8 → 281.6 kB by the measured 281.27 kB of the RBAC second review's fixes (2026-10-17): per-dialect produced rows for a judged createMany (ENG-3, setOperations.typedRows), caller SQL kept out of shared-body keys (ENG-4, Sql.peekRuns), isolated nesting levels where deepExpressions is false (ENG-6, subqueries.isolated), and createClient forwarding sharedRelationBodies (ENG-5) (OD-17, measured rounded up to 0.1 kB + 0.3 kB). Permissions application reuse (2026-10-18) measures 281,876 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 284,679 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 286,646 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 291,400 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 295,514 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 296,563 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 297,199 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts (2026-10-22) measure 298,985 B after two bundle-reduction reviews. Owner-approved limit follows rounding up to 0.1 kB plus 0.3 kB headroom; other resource and coverage limits are unchanged. Final prune-review fixes measure 299,039 B and remain within that approved limit. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 298,088 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts merged with shared connect UPDATEs and batched planning reads (2026-10-23) measure 299,920 B together. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. The 1.4.1 fixes (opt-in findUnique batching in its leader's context, non-null unique selectors, grouped batch-route reads, indexed target matching; 2026-10-24) measure 301.01 kB on CI's Node 22.12 build, so 300.3 kB → 301.4 kB under the same OD-17 rule."
|
|
402
402
|
},
|
|
403
403
|
{
|
|
404
404
|
"name": "pg application (viborm/pg)",
|
|
405
405
|
"path": "node_modules/.cache/viborm-size/pg-representative.mjs",
|
|
406
406
|
"gzip": true,
|
|
407
|
-
"limit": "
|
|
408
|
-
"message": "Raised 170 → 171.9 kB by the measured +1,900 B of RBAC M1 wave 1 (OD-17): rows predicates admitted, layered and parameterized, numbered binds, bound views. Raised 171.9 → 173.34 kB by the measured +1,440 B of RBAC M1 wave 2 (K3, OD-17): rows verbs, written fields, write judgements and the clear premise. Raised 173.34 → 178.2 kB by the measured +5,650 B (177.84 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 178.2 → 179.5 kB by the measured +1,278 B (179.12 kB) of RBAC M2 wave 5 (E5: shared relation bodies, D1 balanced conjunctions, the judged write's own sentinel, the allocation fixes; the uncacheable control, OD-10; OD-17, measured + 0.3 kB headroom). Raised 179.5 → 180.3 kB by the measured 179.99 kB of the RBAC second review's fixes (2026-10-17): per-dialect produced rows for a judged createMany (ENG-3, setOperations.typedRows), caller SQL kept out of shared-body keys (ENG-4, Sql.peekRuns), isolated nesting levels where deepExpressions is false (ENG-6, subqueries.isolated), and createClient forwarding sharedRelationBodies (ENG-5) (OD-17, measured rounded up to 0.1 kB + 0.3 kB). Permissions application reuse (2026-10-18) measures 180,567 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 183,392 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 183,719 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 188,385 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 192,547 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 193,572 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 194,198 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 195,084 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged."
|
|
407
|
+
"limit": "196.6 kB",
|
|
408
|
+
"message": "Raised 170 → 171.9 kB by the measured +1,900 B of RBAC M1 wave 1 (OD-17): rows predicates admitted, layered and parameterized, numbered binds, bound views. Raised 171.9 → 173.34 kB by the measured +1,440 B of RBAC M1 wave 2 (K3, OD-17): rows verbs, written fields, write judgements and the clear premise. Raised 173.34 → 178.2 kB by the measured +5,650 B (177.84 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 178.2 → 179.5 kB by the measured +1,278 B (179.12 kB) of RBAC M2 wave 5 (E5: shared relation bodies, D1 balanced conjunctions, the judged write's own sentinel, the allocation fixes; the uncacheable control, OD-10; OD-17, measured + 0.3 kB headroom). Raised 179.5 → 180.3 kB by the measured 179.99 kB of the RBAC second review's fixes (2026-10-17): per-dialect produced rows for a judged createMany (ENG-3, setOperations.typedRows), caller SQL kept out of shared-body keys (ENG-4, Sql.peekRuns), isolated nesting levels where deepExpressions is false (ENG-6, subqueries.isolated), and createClient forwarding sharedRelationBodies (ENG-5) (OD-17, measured rounded up to 0.1 kB + 0.3 kB). Permissions application reuse (2026-10-18) measures 180,567 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 183,392 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 183,719 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 188,385 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 192,547 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 193,572 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 194,198 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 195,084 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. The 1.4.1 fixes (opt-in findUnique batching in its leader's context, non-null unique selectors, grouped batch-route reads, indexed target matching; 2026-10-24) measure 196.22 kB on CI's Node 22.12 build, so 195.4 kB → 196.6 kB under the same OD-17 rule."
|
|
409
409
|
},
|
|
410
410
|
{
|
|
411
411
|
"name": "pg application + soft delete",
|
|
412
412
|
"path": "node_modules/.cache/viborm-size/pg-soft-delete.mjs",
|
|
413
413
|
"gzip": true,
|
|
414
|
-
"limit": "
|
|
415
|
-
"message": "Raised 173.5 → 178.6 kB by the measured +5,670 B (178.24 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 178.6 → 179.9 kB by the measured +1,270 B (179.51 kB) of RBAC M2 wave 5 (E5: shared relation bodies, D1 balanced conjunctions, the judged write's own sentinel, the allocation fixes; the uncacheable control, OD-10; OD-17, measured + 0.3 kB headroom). Raised 179.9 → 180.7 kB by the measured 180.39 kB of the RBAC second review's fixes (2026-10-17): per-dialect produced rows for a judged createMany (ENG-3, setOperations.typedRows), caller SQL kept out of shared-body keys (ENG-4, Sql.peekRuns), isolated nesting levels where deepExpressions is false (ENG-6, subqueries.isolated), createClient forwarding sharedRelationBodies (ENG-5), and soft delete's module-level steps (COST-1, COST-2) (OD-17, measured rounded up to 0.1 kB + 0.3 kB). Permissions application reuse (2026-10-18) measures 180,978 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 183,799 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 184,116 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 188,764 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 192,936 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 193,977 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 194,609 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 195,500 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged."
|
|
414
|
+
"limit": "197 kB",
|
|
415
|
+
"message": "Raised 173.5 → 178.6 kB by the measured +5,670 B (178.24 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 178.6 → 179.9 kB by the measured +1,270 B (179.51 kB) of RBAC M2 wave 5 (E5: shared relation bodies, D1 balanced conjunctions, the judged write's own sentinel, the allocation fixes; the uncacheable control, OD-10; OD-17, measured + 0.3 kB headroom). Raised 179.9 → 180.7 kB by the measured 180.39 kB of the RBAC second review's fixes (2026-10-17): per-dialect produced rows for a judged createMany (ENG-3, setOperations.typedRows), caller SQL kept out of shared-body keys (ENG-4, Sql.peekRuns), isolated nesting levels where deepExpressions is false (ENG-6, subqueries.isolated), createClient forwarding sharedRelationBodies (ENG-5), and soft delete's module-level steps (COST-1, COST-2) (OD-17, measured rounded up to 0.1 kB + 0.3 kB). Permissions application reuse (2026-10-18) measures 180,978 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 183,799 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 184,116 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 188,764 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 192,936 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 193,977 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 194,609 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 195,500 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. The 1.4.1 fixes (opt-in findUnique batching in its leader's context, non-null unique selectors, grouped batch-route reads, indexed target matching; 2026-10-24) measure 196.66 kB on CI's Node 22.12 build, so 195.8 kB → 197 kB under the same OD-17 rule."
|
|
416
416
|
},
|
|
417
417
|
{
|
|
418
418
|
"name": "soft-delete extension entry",
|
|
@@ -425,15 +425,15 @@
|
|
|
425
425
|
"name": "pg application + permissions",
|
|
426
426
|
"path": "node_modules/.cache/viborm-size/pg-permissions.mjs",
|
|
427
427
|
"gzip": true,
|
|
428
|
-
"limit": "
|
|
429
|
-
"message": "The pg application with viborm/permissions applied (the guide's blog policy: an actor schema, an explicit authorId predicate and an actor condition, $as per request, one read, one create, one can): measured 184,652 B at the M2 exit (wave 5), +5,534 B over the pg application row (the entry's compiler with placement, moves, acyclic relations and evidence, can/assert through $access). First measured 181,404 B at c7d1951cd (U10). Limit = measured rounded up to 0.1 kB + 0.3 kB (OD-17). Raised 185 → 185.8 kB by the measured +488 B (185.49 kB) of the independent review's fixes (2026-10-16): refusals of unknown policy, model and field-entry keys, mistyped declaration keys, keyLimit models and undeclared ceilings; can/assert over findUnique with one ask per level; the prover's structural equality and R6 safeguard (OD-17). Comma-separated action keys measure 185,861 B (2026-10-16): normalized bindings and rejection of empty, repeated, overlapping and reserved members. Limit 186.2 kB follows the same rounding plus 0.3 kB rule (OD-17). CRUD permissions and complementary credential scopes measure 186,347 B (2026-10-17); limit 186.7 kB follows the approved measured rounding plus 0.3 kB rule (OD-17). Conditional parameter-read preservation and the permissions rename measure 187,685 B (2026-10-17), +1,338 B from the last recorded application measurement; limit 188 kB follows OD-17 rounding plus 0.3 kB. The simplifier preserves missing/null and whole-list refusals while retaining compact inherited predicates. Raised by the second review's fixes (2026-10-17: typed VALUES rows for judged inserts, caller-text runs in shared-body keys, isolated nesting levels on D1), measured 188.19 kB after the permissions rename; limit = measured rounded up to 0.1 kB + 0.3 kB (OD-17). Actor admission and polymorphic projection consistency (2026-10-18) measure 189,787 B: required native actor validation, per-grant availability and variant projection admission. Limit follows OD-17 rounding to 0.1 kB plus 0.3 kB. Permissions application reuse (2026-10-18) measures 190,939 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Cold compilation sharing (2026-10-18) measures 191,498 B: compilation-local structural keys and shared guards in the policy simplifier, and admission that parses and walks each shared sub-predicate once. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 196,216 B: per-model compilation (the policy compiler, the declaration snapshot, frozen lazy entries), $exists and { $row, up } in rules, and the refusal of field references and empty actor conditions. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 196,634 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 201,329 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 205,450 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 206,535 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 207,162 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 208,063 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged."
|
|
428
|
+
"limit": "209.5 kB",
|
|
429
|
+
"message": "The pg application with viborm/permissions applied (the guide's blog policy: an actor schema, an explicit authorId predicate and an actor condition, $as per request, one read, one create, one can): measured 184,652 B at the M2 exit (wave 5), +5,534 B over the pg application row (the entry's compiler with placement, moves, acyclic relations and evidence, can/assert through $access). First measured 181,404 B at c7d1951cd (U10). Limit = measured rounded up to 0.1 kB + 0.3 kB (OD-17). Raised 185 → 185.8 kB by the measured +488 B (185.49 kB) of the independent review's fixes (2026-10-16): refusals of unknown policy, model and field-entry keys, mistyped declaration keys, keyLimit models and undeclared ceilings; can/assert over findUnique with one ask per level; the prover's structural equality and R6 safeguard (OD-17). Comma-separated action keys measure 185,861 B (2026-10-16): normalized bindings and rejection of empty, repeated, overlapping and reserved members. Limit 186.2 kB follows the same rounding plus 0.3 kB rule (OD-17). CRUD permissions and complementary credential scopes measure 186,347 B (2026-10-17); limit 186.7 kB follows the approved measured rounding plus 0.3 kB rule (OD-17). Conditional parameter-read preservation and the permissions rename measure 187,685 B (2026-10-17), +1,338 B from the last recorded application measurement; limit 188 kB follows OD-17 rounding plus 0.3 kB. The simplifier preserves missing/null and whole-list refusals while retaining compact inherited predicates. Raised by the second review's fixes (2026-10-17: typed VALUES rows for judged inserts, caller-text runs in shared-body keys, isolated nesting levels on D1), measured 188.19 kB after the permissions rename; limit = measured rounded up to 0.1 kB + 0.3 kB (OD-17). Actor admission and polymorphic projection consistency (2026-10-18) measure 189,787 B: required native actor validation, per-grant availability and variant projection admission. Limit follows OD-17 rounding to 0.1 kB plus 0.3 kB. Permissions application reuse (2026-10-18) measures 190,939 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Cold compilation sharing (2026-10-18) measures 191,498 B: compilation-local structural keys and shared guards in the policy simplifier, and admission that parses and walks each shared sub-predicate once. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 196,216 B: per-model compilation (the policy compiler, the declaration snapshot, frozen lazy entries), $exists and { $row, up } in rules, and the refusal of field references and empty actor conditions. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 196,634 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 201,329 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 205,450 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 206,535 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 207,162 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 208,063 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. The 1.4.1 fixes (opt-in findUnique batching in its leader's context, non-null unique selectors, grouped batch-route reads, indexed target matching; 2026-10-24) measure 209.17 kB on CI's Node 22.12 build, so 208.4 kB → 209.5 kB under the same OD-17 rule."
|
|
430
430
|
},
|
|
431
431
|
{
|
|
432
432
|
"name": "permissions extension entry",
|
|
433
433
|
"path": "node_modules/.cache/viborm-size/permissions-entry.mjs",
|
|
434
434
|
"gzip": true,
|
|
435
|
-
"limit": "32.
|
|
436
|
-
"message": "viborm/permissions alone: permissions(), its policy compiler (placement, moves, acyclic relations, evidence and the implication that drops what administering already says), $as, can/assert through $access with explicit application predicates, and the error classes it raises from the root's shared chunks (VibORMError and its code table, ClientInitializationError, ForbiddenError), which an application already holds. Measured 13,061 B at the M2 exit (wave 5); 11,188 B at c7d1951cd. Limit = measured rounded up to 0.1 kB + 0.3 kB (OD-17). Raised 13.4 → 14.3 kB by the measured +509 B (13.91 kB) of the independent review's fixes (2026-10-16), the same code as the pg + rbac row (OD-17). Actor admission (2026-10-18) measures 29,230 B. The isolated entry now includes the public native validation factories used to require actor fields while preserving defaults, transforms and sparse output; ordinary ORM applications already share those factories (the pg + permissions application measures 189,787 B). Per-grant availability is compiled through existing public conditions. Limit follows OD-17 rounding to 0.1 kB plus 0.3 kB. Permissions application reuse (2026-10-18) measures 30,020 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Cold compilation sharing (2026-10-18) measures 30,407 B: compilation-local structural keys and shared guards in the policy simplifier, and admission that parses and walks each shared sub-predicate once. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 32,160 B: per-model compilation (the policy compiler, the declaration snapshot, frozen lazy entries), $exists and { $row, up } in rules, and the refusal of field references and empty actor conditions. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged."
|
|
435
|
+
"limit": "32.7 kB",
|
|
436
|
+
"message": "viborm/permissions alone: permissions(), its policy compiler (placement, moves, acyclic relations, evidence and the implication that drops what administering already says), $as, can/assert through $access with explicit application predicates, and the error classes it raises from the root's shared chunks (VibORMError and its code table, ClientInitializationError, ForbiddenError), which an application already holds. Measured 13,061 B at the M2 exit (wave 5); 11,188 B at c7d1951cd. Limit = measured rounded up to 0.1 kB + 0.3 kB (OD-17). Raised 13.4 → 14.3 kB by the measured +509 B (13.91 kB) of the independent review's fixes (2026-10-16), the same code as the pg + rbac row (OD-17). Actor admission (2026-10-18) measures 29,230 B. The isolated entry now includes the public native validation factories used to require actor fields while preserving defaults, transforms and sparse output; ordinary ORM applications already share those factories (the pg + permissions application measures 189,787 B). Per-grant availability is compiled through existing public conditions. Limit follows OD-17 rounding to 0.1 kB plus 0.3 kB. Permissions application reuse (2026-10-18) measures 30,020 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Cold compilation sharing (2026-10-18) measures 30,407 B: compilation-local structural keys and shared guards in the policy simplifier, and admission that parses and walks each shared sub-predicate once. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 32,160 B: per-model compilation (the policy compiler, the declaration snapshot, frozen lazy entries), $exists and { $row, up } in rules, and the refusal of field references and empty actor conditions. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. The 1.4.1 fixes (opt-in findUnique batching in its leader's context, non-null unique selectors, grouped batch-route reads, indexed target matching; 2026-10-24) measure 32.37 kB on CI's Node 22.12 build, so 32.3 kB → 32.7 kB under the same OD-17 rule."
|
|
437
437
|
},
|
|
438
438
|
{
|
|
439
439
|
"name": "identifier generators only",
|
|
@@ -451,8 +451,8 @@
|
|
|
451
451
|
"name": "every public entry",
|
|
452
452
|
"path": "node_modules/.cache/viborm-size/full.mjs",
|
|
453
453
|
"gzip": true,
|
|
454
|
-
"limit": "
|
|
455
|
-
"message": "Raised 394 → 398.1 kB by the measured +5,700 B (397.74 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 398.1 → 405.9 kB by the measured +7,818 B (405.56 kB) of RBAC M2 wave 5: the fixture now exports viborm/rbac (U10), the entry's placement, moves and evidence (U9), and the core growth of E5 and OD-10 (OD-17, measured + 0.3 kB headroom). Raised 405.9 → 406.9 kB by the measured +692 B (406.59 kB) of the independent review's fixes (2026-10-16): the rbac entry's refusals and prover fixes, and the marker judgement in core (OD-17). The permissions rename and conditional-read simplification fixes measure 407,193 B (2026-10-17); limit 407.5 kB follows OD-17 rounding plus 0.3 kB. Raised by the second review's fixes (2026-10-17: typed VALUES rows for judged inserts, caller-text runs in shared-body keys, isolated nesting levels on D1), measured 407.81 kB after the permissions rename; limit = measured rounded up to 0.1 kB + 0.3 kB (OD-17). Actor admission and polymorphic projection consistency (2026-10-18) measure 409,474 B; limit follows OD-17 rounding to 0.1 kB plus 0.3 kB. Permissions application reuse (2026-10-18) measures 410,754 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Cold compilation sharing (2026-10-18) measures 411,254 B: compilation-local structural keys and shared guards in the policy simplifier, and admission that parses and walks each shared sub-predicate once. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 415,968 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 418,009 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 422,953 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 427,195 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 428,233 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 428,889 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts (2026-10-22) measure 430,540 B after two bundle-reduction reviews. Owner-approved limit follows rounding up to 0.1 kB plus 0.3 kB headroom; other resource and coverage limits are unchanged. Final prune-review fixes measure 430,609 B and remain within that approved limit. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 429,766 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts merged with shared connect UPDATEs and batched planning reads (2026-10-23) measure 431,468 B together. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged."
|
|
454
|
+
"limit": "432.9 kB",
|
|
455
|
+
"message": "Raised 394 → 398.1 kB by the measured +5,700 B (397.74 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 398.1 → 405.9 kB by the measured +7,818 B (405.56 kB) of RBAC M2 wave 5: the fixture now exports viborm/rbac (U10), the entry's placement, moves and evidence (U9), and the core growth of E5 and OD-10 (OD-17, measured + 0.3 kB headroom). Raised 405.9 → 406.9 kB by the measured +692 B (406.59 kB) of the independent review's fixes (2026-10-16): the rbac entry's refusals and prover fixes, and the marker judgement in core (OD-17). The permissions rename and conditional-read simplification fixes measure 407,193 B (2026-10-17); limit 407.5 kB follows OD-17 rounding plus 0.3 kB. Raised by the second review's fixes (2026-10-17: typed VALUES rows for judged inserts, caller-text runs in shared-body keys, isolated nesting levels on D1), measured 407.81 kB after the permissions rename; limit = measured rounded up to 0.1 kB + 0.3 kB (OD-17). Actor admission and polymorphic projection consistency (2026-10-18) measure 409,474 B; limit follows OD-17 rounding to 0.1 kB plus 0.3 kB. Permissions application reuse (2026-10-18) measures 410,754 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Cold compilation sharing (2026-10-18) measures 411,254 B: compilation-local structural keys and shared guards in the policy simplifier, and admission that parses and walks each shared sub-predicate once. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 415,968 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 418,009 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 422,953 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 427,195 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 428,233 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 428,889 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts (2026-10-22) measure 430,540 B after two bundle-reduction reviews. Owner-approved limit follows rounding up to 0.1 kB plus 0.3 kB headroom; other resource and coverage limits are unchanged. Final prune-review fixes measure 430,609 B and remain within that approved limit. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 429,766 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts merged with shared connect UPDATEs and batched planning reads (2026-10-23) measure 431,468 B together. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. The 1.4.1 fixes (opt-in findUnique batching in its leader's context, non-null unique selectors, grouped batch-route reads, indexed target matching; 2026-10-24) measure 432.54 kB on CI's Node 22.12 build, so 431.8 kB → 432.9 kB under the same OD-17 rule."
|
|
456
456
|
}
|
|
457
457
|
]
|
|
458
458
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./chunk-BuuaeEvq.mjs";import{o as t,s as n}from"./value-guards-CK9guf2Z.mjs";import{t as r}from"./validation-gwZYm3Yn.mjs";import{A as i,D as a,c as o,i as s,l as c,n as l,o as u,p as d,r as f,s as p,t as m}from"./v-514RME2X.mjs";import{$ as h,Q as g,Z as _,c as ee,ct as te,rt as v,s as y,tt as ne}from"./geo-point-codec-D95uXgDF.mjs";import{r as re}from"./sql-BvHwL73I.mjs";import{t as ie}from"./hydration-BflrXEIQ.mjs";import{d as ae,m as oe,n as se}from"./validator-CQOw7G3q.mjs";import{i as ce,r as le}from"./physical-uJfmo4-Z.mjs";import{t as ue}from"./current-oXcxSCBQ.mjs";import{t as b}from"./types-C5Oxz9yp.mjs";import{n as de}from"./geo-area-codec-BmMmWgU_.mjs";function lazyRecord(e){let t={};for(let n of Object.keys(e)){let r=e[n],i;Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get(){return r&&=(i=r(),void 0),i}})}return t}var fe=class LazyScalarSchemas{base;#e;#t;#n;constructor(e){this.base=e.base,this.#e={build:e.create},this.#t={build:e.update},this.#n={build:e.filter},Object.defineProperties(this,{create:{enumerable:!0,configurable:!0,get:LazyScalarSchemas.#r},update:{enumerable:!0,configurable:!0,get:LazyScalarSchemas.#i},filter:{enumerable:!0,configurable:!0,get:LazyScalarSchemas.#a}})}static#r(){if(`value`in this.#e)return this.#e.value;let e=this.#e.build();return this.#e={value:e},e}static#i(){if(`value`in this.#t)return this.#t.value;let e=this.#t.build();return this.#t={value:e},e}static#a(){if(`value`in this.#n)return this.#n.value;let e=this.#n.build();return this.#n={value:e},e}};function lazyScalarSchemas(e){return new fe(e)}const x=l.enum([`asc`,`desc`]),pe=l.enum([`l2`,`cosine`]),forbiddenOrderByKeySchema=e=>l.refused(`OrderBy key '${e}' is not valid here.`),S=l.union([x,l.object({sort:x,nulls:l.enum([`first`,`last`]),_distance:forbiddenOrderByKeySchema(`_distance`)},{atLeast:[`sort`]})]),me=l.object({_distance:l.object({to:l.array(l.number()),metric:pe,sort:x},{atLeast:[`to`,`metric`]}),sort:forbiddenOrderByKeySchema(`sort`),nulls:forbiddenOrderByKeySchema(`nulls`)},{atLeast:[`_distance`]}),he=l.object({_distance:l.object({to:l.point(),sort:x},{partial:!1}),sort:forbiddenOrderByKeySchema(`sort`),nulls:forbiddenOrderByKeySchema(`nulls`)},{atLeast:[`_distance`]}),C=l.union([S,me]),isOrderableScalarState=e=>e.type!==`point`&&(e.type!==`decimal`||e.array!==!0),w=l.refused(`A decimal list cannot be used for numeric ordering.`);function isDecimalListScalarKey(e,t){let n=e[`~`].state.scalars[t][`~`].state;return n.type===`decimal`&&n.array===!0}const getOrderBySchema=(e,t)=>{let n=[],r=[],i=[],a=[],o=Object.keys(e[`~`].state.scalars);for(let t of o){if(isDecimalListScalarKey(e,t)){a.push(t);continue}let o=e[`~`].state.scalars[t][`~`].state;if(o.type===`vector`){n.push(t);continue}if(o.type===`point`){r.push(t);continue}i.push(t)}let s=f(i,S),c=f(n,C),u=f(r,he),p=f(a,w),m=d(t.relations,`orderBy`),h=d(t.polymorphic,`orderBy`),g=l.object({...s,...c,...u,...p,...m,...h}),_=l.noOperandExpression(g,`'orderBy'`);return Reflect.set(g[`~standard`],`validate`,_[`~standard`].validate),g},paginationTake=()=>l.integer();function nonNegativeInteger(e){return _(`integer`,t=>{let n=y(t);return n.issues?n:n.value<0?g(e):n})}const paginationSkip=()=>nonNegativeInteger(`skip must be greater than or equal to 0`),bulkWriteLimit=()=>nonNegativeInteger(`limit must be greater than or equal to 0`),ge=[`int`,`number`,`decimal`,`bigint`],isSummableScalar=e=>e.array!==!0&&ge.includes(e.type),getAggregateScalarSchemas=e=>{let t=e[`~`].state,n=[`_all`],r=[],i=[],a=[],o=[];for(let e of Object.keys(t.scalars)){let s=t.scalars[e];n.push(e),isSummableScalar(s[`~`].state)&&r.push(e),s[`~`].state.array!==!0&&s[`~`].state.type!==`point`&&i.push(e),s[`~`].state.array===!0&&a.push(e),s[`~`].state.type===`point`&&o.push(e)}let s=l.boolean({optional:!0}),projection=e=>l.fromKeys(a,l.refused(`A list cannot be projected by '${e}'; only '_count' is supported.`)),pointProjection=e=>l.fromKeys(o,l.refused(`A GeoPoint cannot be projected by '${e}'; use a distance projection or '_count'.`));return{count:l.fromKeys(n,s),avg:l.object({...l.fromKeys(r,s).entries,...projection(`_avg`).entries,...pointProjection(`_avg`).entries}),sum:l.object({...l.fromKeys(r,s).entries,...projection(`_sum`).entries,...pointProjection(`_sum`).entries}),min:l.object({...l.fromKeys(i,s).entries,...projection(`_min`).entries,...pointProjection(`_min`).entries}),max:l.object({...l.fromKeys(i,s).entries,...projection(`_max`).entries,...pointProjection(`_max`).entries})}},getCountArgs=(e,t)=>{let n=getAggregateScalarSchemas(e);return l.object({where:l.lazyRef(()=>t.where),orderBy:l.lazyRef(()=>l.union([t.orderBy,l.array(t.orderBy)])),cursor:l.lazyRef(()=>t.whereUnique),take:paginationTake(),skip:paginationSkip(),select:n.count},{optional:!0})},getExistArgs=e=>l.object({where:l.lazyRef(()=>e.where)},{optional:!0}),getAggregateArgs=(e,t)=>{let n=getAggregateScalarSchemas(e);return l.object({where:l.lazyRef(()=>t.where),orderBy:l.lazyRef(()=>l.union([t.orderBy,l.array(t.orderBy)])),cursor:l.lazyRef(()=>t.whereUnique),take:paginationTake(),skip:paginationSkip(),_count:l.union([l.literal(!0),n.count]),_avg:n.avg,_sum:n.sum,_min:n.min,_max:n.max})},buildAggregateFilterOps=(e,t)=>l.object({equals:t(),in:l.array(e()),notIn:l.array(e()),gt:e(),gte:e(),lt:e(),lte:e(),not:t()},{optional:!0}),T=buildAggregateFilterOps(()=>l.number(),()=>l.number({nullable:!0})),E=l.object({equals:l.literal(null),not:l.literal(null)},{optional:!0}),isRuntimeListFilterSchema=e=>{if(e.type!==`union`)return!1;let t=Reflect.get(e,`options`);if(!Array.isArray(t)||t.length!==2)return!1;let n=t[1];return typeof n==`object`&&!!n&&Reflect.get(n,`type`)===`object`},listHavingSchema=e=>{let refusal=e=>l.refused(`A list cannot use '${e}' in having; only '_count' is supported.`),t={_count:T,_avg:refusal(`_avg`),_sum:refusal(`_sum`),_min:refusal(`_min`),_max:refusal(`_max`)};return isRuntimeListFilterSchema(e)?l.noOperandExpression(l.union([e.options[0],e.options[1].extend(t)]),`'having'`):l.refused(`The list filter schema cannot be used in having because its trusted shape is unavailable.`)},sumOperandDomain=e=>({precision:2**53-1,scale:e.scale}),havingAggregateSchema=(e,t)=>{let n=e?.type===`decimal`?e.decimal:void 0;if(!n)return l.object({_count:T,_avg:e&&isSummableScalar(e)?T:l.refused(`Only numeric scalars support '_avg' in having.`),_sum:e&&isSummableScalar(e)?T:l.refused(`Only numeric scalars support '_sum' in having.`),_min:l.union([t,E]),_max:l.union([t,E])},{optional:!0});let r=buildAggregateFilterOps(()=>l.decimal({decimal:n}),()=>l.decimal({decimal:n,nullable:!0})),i=sumOperandDomain(n);return l.object({_count:T,_avg:r,_sum:buildAggregateFilterOps(()=>l.decimal({decimal:i}),()=>l.decimal({decimal:i,nullable:!0})),_min:r,_max:r},{optional:!0})};function getHavingSchema(e,t){let n={};for(let[r,i]of Object.entries(t.scalars)){let t=e[`~`].state.scalars[r]?.[`~`].state;if(t?.type===`point`){n[r]=l.refused(`A GeoPoint cannot be used in 'having'.`);continue}n[r]=t?.array===!0?listHavingSchema(i.filter):l.noOperandExpression(l.union([havingAggregateSchema(t,i.filter),i.filter]),`'having'`)}let r=l.object({AND:()=>l.optional(l.union([r,l.array(r)])),OR:()=>l.optional(l.array(r)),NOT:()=>l.optional(l.union([r,l.array(r)]))},{optional:!0}).extend(n);return s(r,e)}const D=l.enum([`asc`,`desc`]),getGroupByOrderBySchema=e=>{let t=e[`~`].state,n=[],r=[],i=[],a=[],o=[],s=[],c=[];for(let e of Object.keys(t.scalars)){let l=t.scalars[e];n.push(e),l[`~`].state.array===!0&&a.push(e),l[`~`].state.type===`point`?c.push(e):isOrderableScalarState(l[`~`].state)?r.push(e):i.push(e),isSummableScalar(l[`~`].state)&&o.push(e),l[`~`].state.array!==!0&&l[`~`].state.type!==`point`&&s.push(e)}let aggregateOrder=(e,t)=>l.object({...l.fromKeys(t,D).entries,...l.fromKeys(a,l.refused(`A list cannot be ordered by '${e}'; only '_count' is supported.`)).entries,...l.fromKeys(c,l.refused(`A GeoPoint cannot be ordered by '${e}'; use '_distance' or '_count'.`)).entries});return l.object({...l.fromKeys(r,S).entries,...l.fromKeys(i,w).entries,_count:l.fromKeys([`_all`,...n],D),_avg:aggregateOrder(`_avg`,o),_sum:aggregateOrder(`_sum`,o),_min:aggregateOrder(`_min`,s),_max:aggregateOrder(`_max`,s)})},O=[`_avg`,`_sum`,`_min`,`_max`],groupByCollisions=e=>{let t=e.by;if(new Set(t).size!==t.length)return`GroupBy operation does not allow duplicate fields in 'by'`;for(let n of O)if(e[n]!==void 0&&t.includes(n))return`Aggregate '${n}' cannot be selected together with a model field named '${n}'.`},k=new Set([`_count`,...O]),_e=new Set([`AND`,`OR`,`NOT`]),ungroupedHavingPath=(e,n,r)=>{for(let[i,a]of Object.entries(e??{}))if(!(a===void 0||n.includes(i))){if(_e.has(i)&&!Object.hasOwn(r,i)){let e=Array.isArray(a)?a:[a];for(let[t,o]of e.entries()){let e=ungroupedHavingPath(o,n,r);if(e)return Array.isArray(a)?[i,t,...e]:[i,...e]}continue}if(!(t(a)&&Object.entries(a).some(([e,t])=>t!==void 0&&k.has(e))))return[i]}},groupedMembershipIssue=({by:e,having:t,orderBy:n},r)=>{if(e.length===0)return{message:`groupBy needs at least one field in 'by'.`,path:[`by`]};let i=ungroupedHavingPath(t,e,r);if(i)return{message:`Scalar '${String(i.at(-1))}' used in 'having' must be included in 'by'.`,path:[`having`,...i]};let a=Array.isArray(n)?n:[n];for(let[t,r]of a.entries())for(let[i,a]of Object.entries(r??{}))if(!(a===void 0||e.includes(i))&&!k.has(i))return{message:`GroupBy orderBy field '${i}' must be included in 'by' or be an aggregate (_count, _avg, _sum, _min, _max).`,path:Array.isArray(n)?[`orderBy`,t,i]:[`orderBy`,i]}},getGroupByArgs=(e,t,n)=>{let r=e[`~`].state,i=Object.keys(r.scalars).filter(e=>r.scalars[e][`~`].state.type!==`point`),a=l.enum(i),o=getAggregateScalarSchemas(e),s=getHavingSchema(e,t),c=getGroupByOrderBySchema(e);return l.object({by:l.union([l.array(a),l.shorthandArray(a)]),where:l.lazyRef(()=>n.where),having:s,orderBy:l.union([c,l.array(c)]),take:paginationTake(),skip:paginationSkip(),_count:l.union([l.literal(!0),o.count]),_avg:o.avg,_sum:o.sum,_min:o.min,_max:o.max},{atLeast:[`by`],refuse:e=>groupByCollisions(e)??groupedMembershipIssue(e,r.scalars)})},projectableScalarNames=e=>{let t=e[`~`].state,n=t.omit,r=Object.keys(t.scalars);return n?r.filter(e=>!Object.hasOwn(n,e)||n[e]!==!0):r},ve=l.boolean({optional:!0}),getOmitSchema=e=>l.object(l.fromKeys(projectableScalarNames(e),ve).entries,{optional:!0}),A=e(e=>({issues:[{message:e}]}),`issue`),modelLabel=e=>e[`~`].names.ts??e[`~`].state.tableName??`model`,buildOmitSelection=(e,t)=>{let n={};for(let r of projectableScalarNames(e))t[r]!==!0&&(n[r]=!0);return Object.keys(n).length>0?n:void 0},emptyOmitProjectionMessage=(e,t)=>`'omit' on '${t}' excluded every readable field of model '${modelLabel(e)}'. At least one field must remain in the result: drop a field from 'omit', or use 'select' to name what you want.`,emptySelectedOmitProjectionMessage=(e,t)=>`'omit' on '${t}' excluded every selected field of model '${modelLabel(e)}'. At least one field must remain in the result: remove a field from 'omit' or add another field to 'select'.`,hasProjectedValue=e=>{for(let t in e){let n=e[t];if(n!==!1&&n!==void 0)return!0}return!1},subtractOmitFromSelection=(e,t)=>{let n={};for(let r of Object.keys(e))t[r]!==!0&&(n[r]=e[r]);return n},withOmitProjection=(e,n,r)=>{let i=e[`~standard`],validate=e=>{let a=t(e)&&e.omit!==void 0,o=i.validate(e);return!a||o.issues?o:projectOmit(o,n,r)};return{...e,parse:validate,"~standard":{version:i.version,vendor:i.vendor,validate,get types(){return i.types},get jsonSchema(){return i.jsonSchema}}}};function projectOmit(e,n,r){let i=e.value,a=i.omit,o=t(i.select)?i.select:void 0,s=o?subtractOmitFromSelection(o,a):buildOmitSelection(n,a);if(!s)return A(emptyOmitProjectionMessage(n,r));if(o&&hasProjectedValue(o)&&!hasProjectedValue(s))return A(emptySelectedOmitProjectionMessage(n,r));let{omit:c,...l}=i;return{value:{...l,select:s}}}const getUpsertProjectionSchema=(e,t)=>withOmitProjection(l.object({select:l.lazyRef(()=>t.select),include:l.lazyRef(()=>t.include),omit:l.lazyRef(()=>t.omit)}),e,`upsert`),ye={issues:[{message:`Mutually exclusive fields cannot be used together: select, include`}]},hasSelectAndInclude=e=>t(e)&&e.select!==void 0&&e.include!==void 0,rejectSelectInclude=e=>{let t=e[`~standard`],validate=e=>hasSelectAndInclude(e)?ye:t.validate(e);return{...e,parse:validate,"~standard":{version:t.version,vendor:t.vendor,validate,get types(){return t.types},get jsonSchema(){return t.jsonSchema}}}},getDistinctSchema=e=>{let t=Object.keys(e[`~`].state.scalars).filter(t=>e[`~`].state.scalars[t][`~`].state.type!==`point`);return l.singleOrArray(l.enum(t))},getFindUniqueArgs=(e,t)=>withOmitProjection(rejectSelectInclude(l.object({where:l.lazyRef(()=>t.whereUniqueExtended),select:l.lazyRef(()=>t.select),include:l.lazyRef(()=>t.include),omit:l.lazyRef(()=>t.omit)},{atLeast:[`where`]})),e,`findUnique`),getFindFirstArgs=(e,t)=>withOmitProjection(rejectSelectInclude(l.object({where:l.lazyRef(()=>t.where),orderBy:l.lazyRef(()=>l.union([t.orderBy,l.array(t.orderBy)])),take:paginationTake(),skip:paginationSkip(),cursor:l.lazyRef(()=>t.whereUnique),select:l.lazyRef(()=>t.select),include:l.lazyRef(()=>t.include),omit:l.lazyRef(()=>t.omit),distinct:l.lazyRef(()=>getDistinctSchema(e))},{optional:!0})),e,`findFirst`),getFindManyArgs=(e,t)=>withOmitProjection(rejectSelectInclude(l.object({where:l.lazyRef(()=>t.where),orderBy:l.lazyRef(()=>l.union([t.orderBy,l.array(t.orderBy)])),take:paginationTake(),skip:paginationSkip(),cursor:l.lazyRef(()=>t.whereUnique),select:l.lazyRef(()=>t.select),include:l.lazyRef(()=>t.include),omit:l.lazyRef(()=>t.omit),distinct:l.lazyRef(()=>getDistinctSchema(e))},{optional:!0})),e,`findMany`),restrictToScalarProjection=(e,t,n)=>{let r=new Set(Object.keys(t[`~`].state.relations)),i=e[`~standard`],validate=e=>{if(hasOwnKey(e,`include`))return issue(`'include' is not supported on '${n}': a bulk write returns the rows its write statement produced, and viborm does not project relations into them. Select the scalar fields you need and read relations in a separate query.`);let t=findProjectedRelation(e,r);return t===void 0?i.validate(e):issue(`'select.${t}' is not supported on '${n}': a bulk write projects scalar fields only. Read the relation in a separate query.`)};return{...e,parse:validate,"~standard":{version:i.version,vendor:i.vendor,validate,get types(){return i.types},get jsonSchema(){return i.jsonSchema}}}},issue=e=>({issues:[{message:e}]}),hasOwnKey=(e,n)=>t(e)&&Object.hasOwn(e,n),findProjectedRelation=(e,n)=>{if(!t(e))return;let r=e.select;if(t(r)){for(let e of Object.keys(r))if(r[e]!==void 0&&(e===`_count`||n.has(e)))return e}},matchesEveryRow=e=>e===0||e===1,and=(e,t)=>e===2||t===2?2:e===3||t===3?3:e===1||t===1?1:0,conjunction=e=>e.reduce(and,0),negation=e=>e===1?2:e===2?1:e,disjunction=e=>{let t=2;for(let n of e){if(n===1)return 1;n===3&&(t=3)}return t};function truthOf(e,n,r){if(!t(e))return 3;let i=0;for(let t in e){let a=e[t],o=n===``?t:`${n}.${t}`;if(a===void 0){if(!r)return 3;r.push(o);continue}if(i=and(i,memberTruth(t,a,o,r)),n===``&&!matchesEveryRow(i))return i}return i}function memberTruth(e,n,r,i){if(e===`AND`||e===`OR`||e===`NOT`){let t=(Array.isArray(n)?n:[n]).map((e,t)=>truthOf(e,Array.isArray(n)?`${r}[${t}]`:r,i));return e===`AND`?conjunction(t):e===`OR`?disjunction(t.filter(e=>e!==0)):conjunction(t.map(negation))}if(t(n)&&n.every!==void 0){for(let e of Object.keys(n))if(e!==`every`){if(n[e]!==void 0||!i)return 3;i.push(`${r}.${e}`)}return matchesEveryRow(truthOf(n.every,`${r}.every`,i))?1:3}return 3}function undefinedOnlyWhere(e){let t=[];if(matchesEveryRow(truthOf(e,``,t))&&t.length!==0)return matchesEveryRow(truthOf(e,``,void 0))?void 0:t}function refusingUndefinedOnlyWhere(e,n,r,i){let a=e[`~standard`],o=a.validate,s=r?`every related row`:`every row`,c=`${r?`This nested `:``}${n} would ${n===`deleteMany`?`delete`:`update`} ${s}`;return a.validate=e=>{let n=o(e);if(n.issues)return n;let r=Array.isArray(e)?e:[e];for(let n=0;n<r.length;n++){let a=r[n],o=undefinedOnlyWhere(i?t(a)?a[i]:void 0:a);if(!o)continue;let l=Array.isArray(e)?[n]:[];return i&&l.push(i),{issues:[{message:`${c}: its where names only undefined values (${o.join(`, `)}), and an undefined value is no condition. Remove them, or pass where: {} to mean ${s}.`,path:l}]}}return n},e}const getCreateArgs=(e,t)=>withOmitProjection(rejectSelectInclude(l.object({data:l.lazyRef(()=>t.create),select:l.lazyRef(()=>t.select),include:l.lazyRef(()=>t.include),omit:l.lazyRef(()=>t.omit)},{atLeast:[`data`]})),e,`create`),refuseDefaultOnlySkipDuplicates=e=>{if(e.skipDuplicates===!0)return e.data.some(e=>t(e)&&Object.values(e).every(e=>e===void 0))?`createMany with skipDuplicates cannot include a row with no explicit scalar values; no portable duplicate-only DEFAULT VALUES primitive exists.`:void 0},getCreateManyArgs=(e,t)=>withOmitProjection(restrictToScalarProjection(l.object({data:l.lazyRef(()=>l.array(t.bulkCreate)),skipDuplicates:l.boolean({optional:!0}),select:l.lazyRef(()=>t.scalarSelect),omit:l.lazyRef(()=>t.omit)},{atLeast:[`data`],refuse:refuseDefaultOnlySkipDuplicates}),e,`createMany`),e,`createMany`),getUpdateArgs=(e,t)=>withOmitProjection(rejectSelectInclude(l.object({where:l.lazyRef(()=>t.whereUniqueExtended),data:l.lazyRef(()=>t.update),select:l.lazyRef(()=>t.select),include:l.lazyRef(()=>t.include),omit:l.lazyRef(()=>t.omit)},{atLeast:[`where`,`data`]})),e,`update`),getUpdateManyArgs=(e,t)=>withOmitProjection(restrictToScalarProjection(refusingUndefinedOnlyWhere(l.object({where:l.lazyRef(()=>t.where),data:l.lazyRef(()=>t.update),select:l.lazyRef(()=>t.scalarSelect),omit:l.lazyRef(()=>t.omit),limit:bulkWriteLimit()},{atLeast:[`data`]}),`updateMany`,!1,`where`),e,`updateMany`),e,`updateMany`),getDeleteArgs=(e,t)=>withOmitProjection(rejectSelectInclude(l.object({where:l.lazyRef(()=>t.whereUniqueExtended),select:l.lazyRef(()=>t.select),include:l.lazyRef(()=>t.include),omit:l.lazyRef(()=>t.omit)},{atLeast:[`where`]})),e,`delete`),getDeleteManyArgs=(e,t)=>withOmitProjection(restrictToScalarProjection(refusingUndefinedOnlyWhere(l.object({where:l.lazyRef(()=>t.where),select:l.lazyRef(()=>t.scalarSelect),omit:l.lazyRef(()=>t.omit),limit:bulkWriteLimit()},{optional:!0}),`deleteMany`,!1,`where`),e,`deleteMany`),e,`deleteMany`),getUpsertArgs=(e,t)=>withOmitProjection(rejectSelectInclude(l.object({where:l.lazyRef(()=>t.whereUniqueExtended),create:l.lazyRef(()=>t.create),update:l.lazyRef(()=>t.update),select:l.lazyRef(()=>t.select),include:l.lazyRef(()=>t.include),omit:l.lazyRef(()=>t.omit),targetWhere:l.lazyRef(()=>t.where),setWhere:l.lazyRef(()=>t.where)},{atLeast:[`where`,`create`,`update`]})),e,`upsert`),getArgsSchemas=(e,t,n)=>lazyRecord({findUnique:()=>getFindUniqueArgs(e,n),findFirst:()=>getFindFirstArgs(e,n),findMany:()=>getFindManyArgs(e,n),create:()=>getCreateArgs(e,n),createMany:()=>getCreateManyArgs(e,n),update:()=>getUpdateArgs(e,n),updateMany:()=>getUpdateManyArgs(e,n),delete:()=>getDeleteArgs(e,n),deleteMany:()=>getDeleteManyArgs(e,n),upsert:()=>getUpsertArgs(e,n),count:()=>getCountArgs(e,n),exist:()=>getExistArgs(n),aggregate:()=>getAggregateArgs(e,n),groupBy:()=>getGroupByArgs(e,t,n)}),slotMayBeEmpty=e=>{let t=e.edge;return t.kind===`junction`||t.kind===`variantJunctionCarrier`?!0:t.kind===`variantRowCarrier`?isSlot(t.carrier,e.slot)?t.storage.typeColumn.nullable:!0:isSlot(t.owner,e.slot)?nullableForeignFields(t).length>0:!0},clearableMembership=e=>{let t=e.edge;if(t.kind===`junction`||t.kind===`variantJunctionCarrier`)return{kind:`junctionRow`};if(t.kind===`variantRowCarrier`)return t.storage.typeColumn.nullable?{kind:`columns`,fields:[t.storage.typeColumn.name,t.storage.idColumn.name]}:{kind:`none`};let[n,...r]=nullableForeignFields(t);return n?{kind:`columns`,fields:[n,...r]}:{kind:`none`}},membershipCanBeCleared=e=>clearableMembership(e).kind!==`none`;function isSlot(e,t){return e.source===t.source&&e.field===t.field}function nullableForeignFields(e){let t=e.owner.source[`~`].state.scalars;return e.reference.members.map(e=>e.foreignField).filter(e=>t[e]?.[`~`].state.nullable===!0)}const getScalarCreate=(e,t)=>{let n=e[`~`].state,r={atLeast:Object.keys(n.scalars).filter(e=>!n.shape[e][`~`].state.optional),provides:e[`~`].names.ts};return l.fromObject(t.scalars,`create`,r)};function getBulkCreate(e,t,n){let r=e[`~`].state,i=getFkFields(r),a=getFkRequirementKeySets(r,n),o=getRequiredCreateScalars(r,i),s=l.fromObject(t.scalars,`create`),c=l.fromObject(t.relations,`create`),u=l.fromObject(t.polymorphic,`createMany`);return l.object({...s.entries,...c.entries,...u.entries},{atLeast:o,requiresOneOfKeySets:a,provides:e[`~`].names.ts})}const getRelationCreate=e=>l.fromObject(e.relations,`create`);function getFkFields(e){let t=new Set;for(let n of Object.values(e.relations)){let e=n[`~`].state.foreignKey;if(e)for(let n of e.fields)t.add(n)}return t}function getRequiredCreateScalars(e,t){return Object.keys(e.scalars).filter(n=>!t.has(n)&&mustBeSuppliedOnCreate(e,n))}function mustBeSuppliedOnCreate(e,t){let n=e.scalars[t][`~`].state;return!(n.hasDefault||n.optional)}function getFkRequirementKeySets(e,t){let n=[];for(let[r,i]of Object.entries(e.relations)){let a=i[`~`].state;if(a.cardinality!==`one`)continue;let o=a.foreignKey;if(o){let i=o.fields.filter(t=>mustBeSuppliedOnCreate(e,t));if(i.length>0){let e=t.get(r),a=e&&!slotMayBeEmpty(e)?o.fields:i;n.push([a,[r]])}continue}let s=t.get(r);s&&!slotMayBeEmpty(s)&&n.push([[r]])}return n}const getCreateSchema=(e,t,n)=>{let r=e[`~`].state,i=getFkFields(r),a=getFkRequirementKeySets(r,n),o=getRequiredCreateScalars(r,i),s=l.fromObject(t.scalars,`create`),c=l.fromObject(t.relations,`create`),u=l.fromObject(t.polymorphic,`create`);return l.object({...s.entries,...c.entries,...u.entries},{atLeast:o,requiresOneOfKeySets:a,provides:e[`~`].names.ts})},getUniqueScalarSchemas=(e,t)=>{let n={};for(let r of Object.keys(e[`~`].state.uniques)){let e=t.scalars[r];e&&(n[r]=e)}return n},getScalarFilter=e=>l.fromObject(e.scalars,`filter`),getUniqueFilter=(e,t)=>l.fromObject(getUniqueScalarSchemas(e,t),`base`),getRelationFilter=e=>l.fromObject(e.relations,`filter`),compoundSelector=(e,t)=>{let n={};for(let r of Object.keys(e.entries))n[r]=t[r].base;return l.object(n,{partial:!1})},compoundSelectors=(e,t)=>{let n={};for(let[r,i]of Object.entries(e??{}))n[r]=compoundSelector(i,t);return n},getCompoundConstraintFilter=(e,t)=>{let n=e[`~`].state;if(!(n.compoundUniques||n.compoundId))return l.object({});let r=t.scalars;return l.object({...compoundSelectors(n.compoundUniques,r),...compoundSelectors(n.compoundId,r)})},getCompoundIdFilter=(e,t)=>{let n=e[`~`].state;return n.compoundId?l.object(compoundSelectors(n.compoundId,t.scalars)):l.object({})},j=l.boolean({optional:!0}),be=l.enum([`l2`,`cosine`]),toManyRelationNames=e=>{let t=e[`~`].state.relations,n=[];for(let e of Object.keys(t))t[e][`~`].state.cardinality===`many`&&n.push(e);return n},getCountSchema=(e,t)=>{let n=toManyRelationNames(e),r=l.fromObject(t.relations,`countFilter`,{optional:!0}),i=l.fromObject(t.polymorphic,`countFilter`,{optional:!0});return l.union([l.coerce(l.literal(!0),()=>{let e={};for(let t of n)e[t]=!0;return{select:e}}),l.object({select:l.object({...r.entries,...i.entries},{optional:!0})},{optional:!0})])},xe=l.object({_distance:l.object({to:l.array(l.number()),metric:be},{partial:!1})},{partial:!1}),Se=l.object({_distance:l.object({to:l.point()},{partial:!1})},{partial:!1}),Ce=l.union([j,xe]),we=l.union([j,Se]),selects=e=>e!==void 0&&e!==!1,requireSelectedField=e=>Object.entries(e).some(([e,n])=>e===`_count`?t(n)&&Object.values(new Object(n.select)).some(selects):selects(n))?void 0:`select needs at least one truthy value; leave it out to return the default row.`,getScalarSelectEntries=e=>{let t=[],n=[],r=[],i=projectableScalarNames(e);for(let a of i){let i=e[`~`].state.scalars[a];if(i[`~`].state.type===`vector`){t.push(a);continue}if(i[`~`].state.type===`point`){n.push(a);continue}r.push(a)}let a=l.fromKeys(r,j),o=l.fromKeys(t,Ce),s=l.fromKeys(n,we);return{...a.entries,...o.entries,...s.entries}},getScalarSelectSchema=e=>l.object(getScalarSelectEntries(e),{refuse:requireSelectedField}),getSelectSchema=(e,t)=>{let n=getScalarSelectEntries(e),r=l.fromObject(t.relations,`select`),i=l.fromObject(t.polymorphic,`select`);return l.object({...n,...r.entries,...i.entries,_count:getCountSchema(e,t)},{refuse:requireSelectedField})},getIncludeSchema=(e,t)=>{let n=l.fromObject(t.relations,`include`,{optional:!0}),r=l.fromObject(t.polymorphic,`include`,{optional:!0});return l.object({...n.entries,...r.entries,_count:getCountSchema(e,t)})},getScalarUpdate=e=>l.fromObject(e.scalars,`update`),getRelationUpdate=e=>l.fromObject(e.relations,`update`),getUpdateSchema=e=>{let t=l.fromObject(e.relations,`update`),n=l.fromObject(e.polymorphic,`update`);return getScalarUpdate(e).extend(t.entries).extend(n.entries)},getWhereSchema=(e,t)=>{let n=d(t.scalars,`filter`),r=d(t.relations,`filter`),i=d(t.polymorphic,`filter`),a=l.object({AND:()=>l.optional(l.union([a,l.array(a)])),OR:()=>l.optional(l.array(a)),NOT:()=>l.optional(l.union([a,l.array(a)])),...n,...r,...i});return s(u(a),e)};function getDecimalListWhereUniqueEntries(e){let t=[];for(let n of Object.keys(e[`~`].state.scalars)){let r=e[`~`].state.scalars[n][`~`].state;r.type===`decimal`&&r.array===!0&&t.push(n)}return l.fromKeys(t,l.refused(`A decimal list cannot be used as a unique selector or cursor.`))}const getWhereUniqueSchema=(e,t)=>{let n=getUniqueFilter(e,t),r=getCompoundConstraintFilter(e,t),i={...n.entries,...r.entries},a=Object.keys(i),o=getDecimalListWhereUniqueEntries(e),s={...i,...o.entries};return l.object(s,{nonEmpty:!0,requiresOneOf:[a]})},getWhereUniqueExtendedSchema=(e,t)=>{let n=getUniqueFilter(e,t),r=getCompoundConstraintFilter(e,t),i=getWhereSchema(e,t),a={...n.entries,...r.entries},o=Object.keys(a),c={...i.entries,...a};return s(l.object(c,{nonEmpty:!0,requiresOneOf:[o]}),e)},getCoreSchemas=(e,t,n)=>{let r=lazyRecord({scalarFilter:()=>getScalarFilter(t),uniqueFilter:()=>getUniqueFilter(e,t),relationFilter:()=>getRelationFilter(t),compoundIdFilter:()=>getCompoundIdFilter(e,t),compoundConstraintFilter:()=>getCompoundConstraintFilter(e,t),scalarCreate:()=>getScalarCreate(e,t),bulkCreate:()=>getBulkCreate(e,t,n),relationCreate:()=>getRelationCreate(t),scalarUpdate:()=>getScalarUpdate(t),relationUpdate:()=>getRelationUpdate(t),where:()=>getWhereSchema(e,t),whereUnique:()=>getWhereUniqueSchema(e,t),whereUniqueExtended:()=>getWhereUniqueExtendedSchema(e,t),create:()=>getCreateSchema(e,t,n),update:()=>getUpdateSchema(t),select:()=>getSelectSchema(e,t),omit:()=>getOmitSchema(e),upsertProjection:()=>getUpsertProjectionSchema(e,r),scalarSelect:()=>getScalarSelectSchema(e),include:()=>getIncludeSchema(e,t),orderBy:()=>getOrderBySchema(e,t)});return r},getModelSchemas=(e,t,n)=>{let r=getCoreSchemas(e,t,n);return{core:r,args:getArgsSchemas(e,t,r),scalars:t.scalars,relations:t.relations,polymorphic:t.polymorphic}},countFilterFactory=(e,t)=>l.union([l.literal(!0),l.object({where:()=>t().core.where})]),M={kind:`none`,keys:[]},isAskingSlot=(e,t)=>t.source===e.slot.source&&t.field===e.slot.field,ownedByEnclosingStep=e=>{let t=e.edge;return t.kind===`foreignKey`?isAskingSlot(e,t.owner)?M:{kind:`columns`,keys:t.reference.members.map(e=>e.foreignField)}:t.kind===`variantRowCarrier`||t.kind===`variantJunctionCarrier`?isAskingSlot(e,t.carrier)?M:{kind:`carrier`,keys:[t.carrier.field]}:M},nestedRelationDataProjection=(t,n)=>{let r=ownedByEnclosingStep(t),bareUpdate=()=>n().core.update,i=e(()=>m.omit(n().core.create,r.keys),`getCreateSchema`),a=e(()=>m.omit(bareUpdate(),r.keys),`getUpdateSchema`);return{getCreateSchema:i,getUpdateSchema:a,getSelectedUpsertUpdateSchema:r.kind===`carrier`?bareUpdate:a,getCreateUpsertUpdateSchema:r.kind===`columns`?bareUpdate:a}},Te=new Set([`disconnect`,`delete`]),Ee=new Set([`create`,`connect`,`connectOrCreate`]);function isAcceptedComposition(e,t){if(e.length<=1)return!0;let n,r,i=!1;for(let t of e)if(Te.has(t)){if(n!==void 0)return!1;n=t}else if(Ee.has(t)){if(r!==void 0)return!1;r=t}else if(t===`update`)i=!0;else return!1;return r===void 0||n===`delete`&&r===`connectOrCreate`?!1:i?t||n===void 0&&r===`connect`:!0}const unsupportedCombination=e=>({issues:[{message:`Unsupported to-one operation combination: ${e.join(`, `)}`}]});function enforceCompositionLattice(e,n,r,i){if(e.issues)return e;let a=e.value;if(!t(a))return e;let o=[];for(let e of n){let t=a[e];t!==void 0&&t!==!1&&o.push(e)}return i?o.length===1?e:o.length===0?{issues:[{message:`Missing to-one operation: expected exactly one of ${n.join(`, `)}`}]}:unsupportedCombination(o):isAcceptedComposition(o,r)?e:unsupportedCombination(o)}function toOneMutationSchema(e,t,n,r){let i=l.object(e,t),a=Object.keys(e),o=i[`~standard`].validate,s=n===!0,c=r===`exactlyOne`,validate=(e,t)=>enforceCompositionLattice(o(e,t),a,s,c),u={...i,"~standard":{version:1,vendor:`viborm`,validate,get jsonSchema(){return i[`~standard`].jsonSchema}}};return Object.defineProperty(u,` vibInferred`,{value:void 0,enumerable:!1}),u}const toOneCreateFactory=(e,t)=>{let n=nestedRelationDataProjection(e,t).getCreateSchema;return toOneMutationSchema({create:n,connect:()=>t().core.whereUnique,connectOrCreate:m.object({where:()=>t().core.whereUnique,create:n},{partial:!1})},{optional:!0})},toManyCreateFactory=(e,t)=>{let n=nestedRelationDataProjection(e,t),r=n.getCreateSchema,i=m.object({data:()=>m.array(r()),skipDuplicates:m.boolean({optional:!0})},{atLeast:[`data`],refuse:refuseDefaultOnlySkipDuplicates});return m.object({create:()=>m.singleOrArray(r()),createMany:i,connect:()=>m.singleOrArray(t().core.whereUnique),connectOrCreate:()=>m.singleOrArray(m.object({where:()=>t().core.whereUnique,create:r},{partial:!1})),upsert:()=>m.singleOrArray(m.object({where:()=>t().core.whereUnique,create:r,update:n.getCreateUpsertUpdateSchema},{partial:!1}))},{optional:!0})},De=1e4;function carriesRepeatedKey(e,t){return e===!1||t<e}const N=Object.freeze({minimum:1,maximum:1e3}),P=Object.assign(_(`integer`,e=>{let t=y(e);return t.issues?t:t.value>=N.minimum&&t.value<=N.maximum?h(t.value):g(`recurse.depth must be a positive safe integer between 1 and 1000`)}),N),F=l.object({depth:l.optional(l.union([P,l.literal(!1)])),preventCycles:l.optional(l.refused(`preventCycles applies only to a junction graph; a foreign-key recursion rejects every cycle it reaches`))}),I=l.object({depth:l.optional(P),preventCycles:l.optional(l.boolean())}),L=l.object({depth:l.literal(!1),preventCycles:l.optional(l.literal(!0))},{atLeast:[`depth`]}),R={maxOccurrences:l.optional(_(`integer`,e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=1?h(e):g(`recurse.maxOccurrences must be a positive safe integer`)))},withBudget=(e,t)=>t===void 0?e:{...e,maxOccurrences:t},normalizeForeignKey=e=>withBudget({depth:e.depth??100,cycles:`reject`},e.maxOccurrences),normalizeGraph=e=>withBudget({depth:e.depth??100,cycles:e.preventCycles===!1?`allow`:`prevent`},e.maxOccurrences),z=l.coerce(l.literal(!0),()=>normalizeForeignKey({})),B=l.coerce(l.literal(!0),()=>normalizeGraph({})),Oe={projection:{foreignKey:l.union([z,l.coerce(F.extend(R),normalizeForeignKey)]),junction:l.union([B,l.coerce(l.union([I.extend(R),L.extend(R)]),normalizeGraph)])},filter:{foreignKey:l.union([z,l.coerce(F,normalizeForeignKey)]),junction:l.union([B,l.coerce(l.union([I,L]),normalizeGraph)])}};function recurrenceSchema(e,t=`projection`){let{edge:n,slot:r}=e;if(n.kind!==`foreignKey`&&n.kind!==`junction`)return;let[i,a]=n.endpoints;if(i.source===a.source&&oe(r.source).rowKey)return Oe[t][n.kind]}const V=`recurse is available only on an ordinary self relation (a foreign key or a junction, never variant storage) whose model has a complete primary key`,unavailableRecurrence=()=>l.optional(l.refused(V)),unavailableRecursiveClause=e=>l.optional(l.refused(`${e} cannot be combined with recurse`)),withoutUnspelledClosure=e=>{if(!(t(e)&&(`recurse`in e||`self`in e&&e.self===void 0)))return e;let{recurse:n,self:r,...i}=e;return r===void 0?i:{...i,self:r}},withRecursiveNode=(e,n)=>{let r=e[`~standard`].validate,i=n?.[`~standard`].validate,a=_(`union`,e=>!t(e)||e.recurse===void 0?r(withoutUnspelledClosure(e)):i?i(e):g(V,[`recurse`])),o=Array.isArray(e.options)?e.options:[e];return Object.assign(a,{options:[...o,...n?[n]:[]]})},H=_(`object`,()=>h({is:null})),U=[`some`,`every`,`none`],ke=[`is`,`isNot`],requireRelationQuantifier=(e,t)=>{let n=`Relation filter '${e.slot.field}' requires one of: ${t.join(`, `)}.`;return e=>t.some(t=>e[t]!==void 0)?void 0:n},quantifierEntries=e=>({some:()=>e().core.where,every:()=>e().core.where,none:()=>e().core.where}),recursiveFilter=(e,t)=>{let n=recurrenceSchema(e,`filter`);return n&&m.object({recurse:o(n),self:m.boolean(),...quantifierEntries(t),is:unavailableRecursiveClause(`is`),isNot:unavailableRecursiveClause(`isNot`)},{atLeast:[`recurse`],refuse:requireRelationQuantifier(e,U)})},Ae=new Set([`is`,`isNot`]),isExplicitToOneFilter=e=>{for(let t in e)if(!Ae.has(t))return!1;return!0},toOneFilterFactory=(e,n)=>{let r=slotMayBeEmpty(e),i=m.object({is:()=>m.maybeNullable(n().core.where,r),isNot:()=>m.maybeNullable(n().core.where,r)},{refuse:requireRelationQuantifier(e,ke)}),a=m.lazy(()=>m.coerce(n().core.where,e=>({is:e}))),o=r?[H,i,a]:[i,a],s=_(`union`,e=>e===null?r?v(H,e):g(`Expected object`):t(e)?isExplicitToOneFilter(e)?v(i,e):v(a,e):g(`Expected object`));return withRecursiveNode(Object.assign(s,{options:o}),recursiveFilter(e,n))},toManyFilterFactory=(e,t)=>withRecursiveNode(m.object(quantifierEntries(t),{refuse:requireRelationQuantifier(e,U)}),recursiveFilter(e,t)),isOrderableToOneRelation=e=>e.cardinality===`one`&&!b(e),createToManyRelationOrderByFailureSchema=e=>l.refused(`Relation orderBy '${e}' cannot order through a to-many relation; use '_count'.`),getModelScalarOrderByEntries=e=>{let t=[],n=[],r=[],i=Object.keys(e[`~`].state.scalars);for(let a of i){if(isDecimalListScalarKey(e,a)){r.push(a);continue}if(e[`~`].state.scalars[a][`~`].state.type===`vector`){t.push(a);continue}n.push(a)}let a=f(n,S),o=f(t,C),s=f(r,w);return{...a,...o,...s}},getToOneRelationOrderByEntries=(e,t)=>{if(t<=0)return{};let n={},r=e[`~`].state.relations;for(let[e,i]of Object.entries(r)){let r=i[`~`].state;if(isOrderableToOneRelation(r)){n[e]=()=>l.lazyRef(()=>buildToOneOrderBySchema(i[`~`].settleTarget(),t-1));continue}n[e]=createToManyRelationOrderByFailureSchema(e)}return n},buildToOneOrderBySchema=(e,t)=>{let n=getModelScalarOrderByEntries(e),r=getToOneRelationOrderByEntries(e,t);return l.object({...n,...r})},toOneOrderByFactory=(e,t)=>()=>l.lazyRef(()=>buildToOneOrderBySchema(e[`~`].settleTarget(),7)),toManyOrderByFactory=e=>l.object({_count:l.enum([`asc`,`desc`])}),getTargetState=e=>getTargetModel(e)[`~`].state,getTargetModel=e=>e[`~`].settleTarget(),buildSelectionForModel=e=>{let t={};for(let n of projectableScalarNames(e))t[n]=!0;return t},nestedOmitLabel=e=>{let t=e[`~`].state.name;return t?`include.${t}`:`a nested include`},withOmitForModel=(e,t,n)=>withOmitProjection(n,e,t),withNestedOmit=(e,t)=>withOmitForModel(getTargetModel(e),nestedOmitLabel(e),t),askingKeyRefusal=e=>l.optional(l.refused(`${e} is produced by recurse and cannot be selected again inside its own recursive node`)),projectionWithoutAsking=(e,t)=>e.extend({[t]:askingKeyRefusal(t)}),termOrList=e=>l.union([e,l.array(e)]),buildRecursiveNode=(e,t,n,r,i={})=>l.coerce(withNestedOmit(e,rejectSelectInclude(l.object({...i,select:()=>projectionWithoutAsking(r().core.select,t),include:()=>projectionWithoutAsking(r().core.include,t),omit:()=>r().core.omit,recurse:n}))),includeToField(e)),withRecurrence=(e,t,n,r,i)=>{let a=recurrenceSchema(n);return a?withRecursiveNode(e,buildRecursiveNode(t,n.slot.field,a,r,i?.())):e},nestedDistinctNames=e=>Object.keys(getTargetState(e).scalars),includeToFieldForModel=e=>t=>{if(Object.hasOwn(t,`select`)&&t.select!==!1)return t;let n=buildSelectionForModel(e);return Object.keys(n).length===0?t:{...t,select:n}},includeToField=e=>includeToFieldForModel(getTargetModel(e)),defaultSelectionNode=e=>{let t=buildSelectionForModel(e);return Object.keys(t).length>0?{select:t}:{}},booleanToSelect=e=>l.coerce(l.boolean(),t=>t?defaultSelectionNode(getTargetModel(e)):!1),toOneIncludeFactory=(e,t,n)=>withRecurrence(l.union([booleanToSelect(e),l.coerce(withNestedOmit(e,rejectSelectInclude(l.object({select:()=>n().core.select,include:()=>n().core.include,omit:()=>n().core.omit,recurse:unavailableRecurrence()}))),includeToField(e))]),e,t,n),buildToManyNestedNode=e=>{let{targetModel:t,label:n,scalarNames:r}=e,at=t=>e.core()[t];return l.coerce(withOmitForModel(t,n,rejectSelectInclude(l.object({where:()=>at(`where`),orderBy:()=>termOrList(at(`orderBy`)),take:paginationTake(),skip:paginationSkip(),cursor:()=>at(`whereUnique`),distinct:l.enum(r,{array:!0}),select:()=>at(`select`),include:()=>at(`include`),omit:()=>at(`omit`),recurse:unavailableRecurrence()}))),includeToFieldForModel(t))},toManyIncludeFactory=(e,t,n)=>withRecurrence(l.union([booleanToSelect(e),buildToManyNestedNode({targetModel:getTargetModel(e),label:nestedOmitLabel(e),core:()=>n().core,scalarNames:nestedDistinctNames(e)})]),e,t,n,()=>({where:()=>n().core.where,orderBy:()=>termOrList(n().core.orderBy),take:unavailableRecursiveClause(`take`),skip:unavailableRecursiveClause(`skip`),cursor:unavailableRecursiveClause(`cursor`),distinct:unavailableRecursiveClause(`distinct`)})),je=toOneIncludeFactory,Me=toManyIncludeFactory;function readToOneUpdateForm(e,t){return hasEnvelopeShape(e)?!t||e.where!==void 0?`envelope`:`ambiguous`:`bare`}function toOneUpdateEnvelope(e,t){return t?{where:{},data:e}:{data:e}}function hasEnvelopeShape(e){return isPlainObject(e)&&Object.hasOwn(e,`data`)&&isPlainObject(e.data)}function isPlainObject(e){if(!t(e))return!1;let n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function toOneUpdateTargetFactory(e,t){let n=t,r=l.object({where:()=>e().core.where,data:n},{atLeast:[`data`]}),i=l.lazy(n),a=[r,i],o,targetOwnsDataField=()=>(o===void 0&&(o=Object.hasOwn(n().entries,`data`)),o),s=_(`union`,e=>{let t=targetOwnsDataField(),n=readToOneUpdateForm(e,t);if(n===`ambiguous`)return g("Ambiguous to-one nested `update`: `{ data: … }` reads both as the `{ where?, data }` envelope and as bare update data for this target's own `data` field. Spell the envelope out — `update: { where: {}, data: { … } }` updates the target's fields (put a filter in `where` to make it conditional), and `update: { where: {}, data: { data: … } }` writes its `data` field.");if(n===`envelope`)return v(r,e);let a=v(i,e);return a.issues?a:h(toOneUpdateEnvelope(a.value,t))});return s.options=a,s}const toOneUpdateFactory=(e,t,n)=>{let r=nestedRelationDataProjection(t,n),i=r.getCreateSchema,a=r.getUpdateSchema,o={create:i,connect:()=>n().core.whereUnique,connectOrCreate:l.object({where:()=>n().core.whereUnique,create:i},{partial:!1}),update:()=>toOneUpdateTargetFactory(n,a),upsert:l.object({create:i,update:a},{partial:!1})},s=e.foreignKey===void 0;return slotMayBeEmpty(t)?membershipCanBeCleared(t)?toOneMutationSchema({...o,disconnect:l.boolean(),delete:l.boolean()},void 0,s):toOneMutationSchema({...o,delete:l.boolean()},void 0,s):toOneMutationSchema(o,void 0,s)},toManyUpdateFactory=(e,t)=>{let n=nestedRelationDataProjection(e,t),r=n.getCreateSchema,i=n.getUpdateSchema,a=n.getSelectedUpsertUpdateSchema,o=l.object({data:()=>l.array(r()),skipDuplicates:l.boolean({optional:!0})},{atLeast:[`data`],refuse:refuseDefaultOnlySkipDuplicates}),s=l.object({where:()=>t().core.whereUnique,create:r},{partial:!1}),c=l.object({where:()=>t().core.whereUniqueExtended,data:i},{atLeast:[`where`,`data`]}),u=refusingUndefinedOnlyWhere(l.object({where:()=>t().core.where,data:i},{atLeast:[`data`]}),`updateMany`,!0,`where`),d=l.object({where:()=>t().core.whereUniqueExtended,create:r,update:a},{partial:!1}),f=membershipCanBeCleared(e)?{disconnect:()=>l.singleOrArray(t().core.whereUnique)}:{};return l.object({create:()=>l.singleOrArray(r()),createMany:o,connect:()=>l.singleOrArray(t().core.whereUnique),...f,delete:()=>l.singleOrArray(t().core.whereUniqueExtended),connectOrCreate:l.singleOrArray(s),set:()=>l.singleOrArray(t().core.whereUnique),update:l.singleOrArray(c),updateMany:l.singleOrArray(u),upsert:l.singleOrArray(d),deleteMany:()=>refusingUndefinedOnlyWhere(l.singleOrArray(t().core.where),`deleteMany`,!0)})},toOneSchemas=(e,t,n)=>{let r=e[`~`].state;return{filter:l.lazy(()=>toOneFilterFactory(t,n)),create:l.lazy(()=>toOneCreateFactory(t,n)),update:l.lazy(()=>toOneUpdateFactory(r,t,n)),select:l.lazy(()=>je(e,t,n)),include:l.lazy(()=>toOneIncludeFactory(e,t,n)),orderBy:toOneOrderByFactory(e,n),countFilter:l.lazy(()=>countFilterFactory(r,n))}},toManySchemas=(e,t,n)=>{let r=e[`~`].state;return{filter:l.lazy(()=>toManyFilterFactory(t,n)),create:l.lazy(()=>toManyCreateFactory(t,n)),update:l.lazy(()=>toManyUpdateFactory(t,n)),select:l.lazy(()=>Me(e,t,n)),include:l.lazy(()=>toManyIncludeFactory(e,t,n)),orderBy:l.lazy(()=>toManyOrderByFactory(r)),countFilter:l.lazy(()=>countFilterFactory(r,n))}},getRelationSchemas=(e,t,n)=>e[`~`].state.cardinality===`many`?toManySchemas(e,t,n):toOneSchemas(e,t,n),getRelationsSchemas=(e,t,n)=>{let r={},i=e[`~`].state.relations;for(let a in i){let o=i[a];if(b(o[`~`].state))continue;let s=resolvedSlotOrThrow(e,a,n);r[a]=()=>getRelationSchemas(o,s,t(o))}return lazyRecord(r)},resolvedSlotOrThrow=(e,t,n)=>{let i=n.get(t);if(i)return i;let a=e[`~`].names.ts??`model`;throw new r({kind:`registry`,property:t},[{path:`${a}.${t}`,message:`The resolved relation index does not describe '${a}.${t}'`}])},polymorphicPublicTypes=e=>Object.keys(e.target.entries);function taggedVerb(e,t,n){return l.singleOrArray(l.union(e.map(e=>l.object({type:l.literal(e),...t(e)},n))))}function collectionVerbs(e,t){let n=t,r=polymorphicPublicTypes(e),tagged=(e,t={partial:!1})=>taggedVerb(r,e,t);return{create:tagged(e=>({data:()=>n[e]().core.create})),createMany:tagged(e=>({data:()=>l.array(n[e]().core.create),skipDuplicates:l.boolean({optional:!0})}),{atLeast:[`type`,`data`],refuse:refuseDefaultOnlySkipDuplicates}),connect:tagged(e=>({where:()=>n[e]().core.whereUnique})),connectOrCreate:tagged(e=>({where:()=>n[e]().core.whereUnique,create:()=>n[e]().core.create})),set:tagged(e=>({where:()=>n[e]().core.whereUnique})),disconnect:tagged(e=>({where:()=>n[e]().core.whereUnique})),delete:tagged(e=>({where:()=>n[e]().core.whereUniqueExtended})),deleteMany:refusingUndefinedOnlyWhere(tagged(e=>({where:()=>n[e]().core.where})),`deleteMany`,!0,`where`),update:tagged(e=>({where:()=>n[e]().core.whereUniqueExtended,data:()=>n[e]().core.update}),{atLeast:[`type`,`where`,`data`]}),updateMany:refusingUndefinedOnlyWhere(tagged(e=>({where:()=>n[e]().core.where,data:()=>n[e]().core.update}),{atLeast:[`type`,`data`]}),`updateMany`,!0,`where`),upsert:tagged(e=>({where:()=>n[e]().core.whereUniqueExtended,create:()=>n[e]().core.create,update:()=>n[e]().core.update}))}}function polymorphicCollectionCreateFactory(e,t){let n=collectionVerbs(e,t);return l.object({create:n.create,createMany:n.createMany,connect:n.connect,connectOrCreate:n.connectOrCreate},{optional:!0})}function polymorphicCollectionUpdateFactory(e,t){let n=collectionVerbs(e,t);return l.object({create:n.create,createMany:n.createMany,connect:n.connect,connectOrCreate:n.connectOrCreate,set:n.set,disconnect:n.disconnect,delete:n.delete,deleteMany:n.deleteMany,update:n.update,updateMany:n.updateMany,upsert:n.upsert})}function taggedTargetPredicate(e,t){let n=polymorphicPublicTypes(e).flatMap(e=>{let n=t[e];return[l.object({type:l.literal(e)},{partial:!1}),l.object({type:l.literal(e),is:()=>n().core.where},{partial:!1}),l.object({type:l.literal(e),isNot:()=>n().core.where},{partial:!1})]});return l.union(n)}function polymorphicCollectionCountFilterFactory(e,t){let n=t;return l.union([l.literal(!0),l.object({where:taggedTargetPredicate(e,n)})])}const polymorphicToOneCountFilterRefusal=()=>l.refused(`A polymorphic to-one slot has no collection to count.`);function polymorphicCreateFactory(e,t){let n=t,r=polymorphicPublicTypes(e);return toOneMutationSchema({connect:l.union(r.map(e=>l.object({type:l.literal(e),where:()=>n[e]().core.whereUnique},{partial:!1}))),create:l.union(r.map(e=>l.object({type:l.literal(e),data:()=>n[e]().core.create},{partial:!1}))),connectOrCreate:l.union(r.map(e=>l.object({type:l.literal(e),where:()=>n[e]().core.whereUnique,create:()=>n[e]().core.create},{partial:!1})))},void 0,!1,`exactlyOne`)}function polymorphicCreateManyFactory(e,t){let n=t;return l.union(polymorphicPublicTypes(e).map(e=>l.object({connect:l.object({type:l.literal(e),where:()=>n[e]().core.whereUnique},{partial:!1})},{partial:!1})))}function polymorphicFilterFactory(e,n){let r=taggedTargetPredicate(e,n),i=[l.object({is:l.literal(null)},{partial:!1}),l.object({isNot:l.literal(null)},{partial:!1})],a=l.union(i),o=l.literal(null,{transform:()=>({is:null})}),s=e.optional===!0,c=s?[o,a,r]:[r],u=_(`union`,e=>e===null?s?v(o,e):g(`Expected polymorphic filter with a type`):t(e)?Object.hasOwn(e,`type`)?v(r,e):s?v(a,e):g(`Expected polymorphic filter with a type`):g(`Expected object`));return u.options=c,u}function polymorphicCollectionFilterFactory(e,t,n){let r=taggedTargetPredicate(t,n),i=`Polymorphic collection filter '${e}' requires one of: some, every, none.`;return l.object({some:r,every:r,none:r},{refuse:e=>e.some!==void 0||e.every!==void 0||e.none!==void 0?void 0:i})}const polymorphicCollectionOrderByFactory=()=>l.object({_count:l.enum([`asc`,`desc`])}),polymorphicToOneOrderByRefusal=()=>l.refused(`A polymorphic to-one slot cannot be ordered on: the target model is chosen per row, so there is no single column to sort by.`);function polymorphicSelectFactory(e,t){let n=e[`~`].state,r=t,i={};for(let t of polymorphicPublicTypes(n)){let n=r[t],a=e[`~`].settleTarget(t);i[t]=()=>l.union([l.literal(!0),l.lazy(()=>{let e=n(),r=a,i=withOmitProjection(rejectSelectInclude(l.object({select:()=>e.core.select,include:()=>e.core.include,omit:()=>e.core.omit})),r,`polymorphic.${t}`);return l.coerce(i,e=>{if(e.select!==void 0)return e;let t={};for(let e of projectableScalarNames(r))t[e]=!0;return Object.keys(t).length===0?e:{...e,select:t}})})])}return l.union([l.boolean(),l.object(i)])}const Ne=polymorphicSelectFactory,onlyAllowList=e=>{let t=l.enum(e,{array:!0});return Object.assign(_(`polymorphic_only`,n=>{let r=v(t,n);if(r.issues)return r;let i=new Set;for(let e of r.value){if(i.has(e))return g(`Duplicate value in 'only': '${e}'`);i.add(e)}return h(e.filter(e=>i.has(e)))}),{wrapped:t})},rejectVariantsOutsideOnly=e=>{let n=e[`~standard`],validate=e=>{if(!t(e))return n.validate(e);let r=e.only,i=e.variants;if(!(Array.isArray(r)&&t(i)))return n.validate(e);let a=n.validate(e);if(a.issues)return a;let o=new Set(r),s=Object.keys(i).find(e=>!o.has(e));return s===void 0?a:{issues:[{message:`Variant '${s}' is not in 'only'`,path:[`variants`,s]}]}};return{...e,parse:validate,"~standard":{version:n.version,vendor:n.vendor,validate,get types(){return n.types},get jsonSchema(){return n.jsonSchema}}}};function polymorphicCollectionSelectFactory(e,t){let n=e[`~`].state,r=polymorphicPublicTypes(n),i={};for(let n of r){let r=t[n],a=e[`~`].settleTarget(n);i[n]=()=>l.union([l.coerce(l.literal(!0),()=>defaultSelectionNode(a)),l.lazy(()=>buildToManyNestedNode({targetModel:a,label:`polymorphic.${n}`,core:()=>r().core,scalarNames:Object.keys(a[`~`].state.scalars)}))])}let a=rejectVariantsOutsideOnly(l.object({only:onlyAllowList(r),variants:l.object(i)}));return l.union([l.boolean(),a])}const Pe=polymorphicCollectionSelectFactory;function polymorphicUpdateFactory(e,t){let n=t,r=polymorphicPublicTypes(e),typed=e=>({type:l.literal(e)}),i={connect:l.union(r.map(e=>l.object({...typed(e),where:()=>n[e]().core.whereUnique},{partial:!1}))),create:l.union(r.map(e=>l.object({...typed(e),data:()=>n[e]().core.create},{partial:!1}))),connectOrCreate:l.union(r.map(e=>l.object({...typed(e),where:()=>n[e]().core.whereUnique,create:()=>n[e]().core.create},{partial:!1}))),update:l.union(r.map(e=>l.object({...typed(e),where:()=>n[e]().core.where,data:()=>n[e]().core.update},{atLeast:[`type`,`data`]}))),upsert:l.union(r.map(e=>l.object({...typed(e),create:()=>n[e]().core.create,update:()=>n[e]().core.update},{partial:!1})))};return e.optional===!0?toOneMutationSchema({...i,delete:l.union(r.map(e=>l.object(typed(e),{partial:!1}))),disconnect:l.literal(!0)},void 0,!1,`exactlyOne`):toOneMutationSchema(i,void 0,!1,`exactlyOne`)}function getTargetSchemas(e,t,n){let r={};for(let i of Object.keys(t.target.entries))r[i]=()=>n(e[`~`].settleTarget(i));return r}function getPolymorphicRelationsSchemas(e,t){let n={},r=e[`~`].state.relations;for(let e of Object.keys(r)){let i=r[e],a=i[`~`].state;b(a)&&(n[e]=()=>{let n=getTargetSchemas(i,a,t);return a.cardinality===`many`?lazyRecord({filter:()=>polymorphicCollectionFilterFactory(e,a,n),create:()=>polymorphicCollectionCreateFactory(a,n),createMany:()=>polymorphicCollectionCreateFactory(a,n),update:()=>polymorphicCollectionUpdateFactory(a,n),select:()=>polymorphicCollectionSelectFactory(i,n),include:()=>Pe(i,n),orderBy:()=>polymorphicCollectionOrderByFactory(),countFilter:()=>polymorphicCollectionCountFilterFactory(a,n)}):lazyRecord({filter:()=>polymorphicFilterFactory(a,n),create:()=>polymorphicCreateFactory(a,n),createMany:()=>polymorphicCreateManyFactory(a,n),update:()=>polymorphicUpdateFactory(a,n),select:()=>polymorphicSelectFactory(i,n),include:()=>Ne(i,n),orderBy:()=>polymorphicToOneOrderByRefusal(),countFilter:()=>polymorphicToOneCountFilterRefusal()})})}return lazyRecord(n)}const scalarInternKey=(e,t)=>{if(e.schema!==void 0)return null;let n=t===void 0?``:`:${t.format}:${t.prefix??``}:${t.length??``}`;return`${e.nullable?1:0}${e.array?1:0}${e.withTimezone?1:0}${n}`},createScalarInterner=()=>{let e=new Map;return(t,n)=>{if(t===null)return n();let r=e.get(t);return r===void 0&&(r=n(),e.set(t,r)),r}},Fe=new Set([`path`,`mode`]),requireFilterOperation=e=>Object.entries(e).some(([e,t])=>!Fe.has(e)&&t!==void 0)?void 0:`Filter must contain at least one operation.`,buildNegatableFilterSchema=(e,t)=>{let n=l.object({...e.entries,not:l.union([l.shorthandFilter(t),l.lazyRef(()=>n)])},{refuse:requireFilterOperation});return l.union([l.shorthandFilter(t),c(n)])},comparisonFilterFamily=(e,t,n)=>{let createBase=()=>l.object({in:p(n()),notIn:p(n()),lt:l.comparisonOperand(e,t()),lte:l.comparisonOperand(e,t()),gt:l.comparisonOperand(e,t()),gte:l.comparisonOperand(e,t())}),r;return t=>{r??=createBase();let n=l.comparisonOperand(e,t);return buildNegatableFilterSchema(r.extend({equals:n}),n)}},listFilterFamily=(e,t)=>{let createBase=()=>l.object({has:p(e()),hasEvery:p(t()),hasSome:p(t()),isEmpty:l.boolean()}),n;return e=>(n??=createBase(),buildNegatableFilterSchema(n.extend({equals:p(e)}),e))},Ie=_(`nonzero_divisor`,e=>e===0||e===0n?g(`Division by zero is not allowed`):h(e)),arithmeticUpdateFamily=e=>(t,n=!1)=>l.union([l.shorthandUpdate(t),l.object({set:t,increment:n?l.refused(W):e(),decrement:n?l.refused(W):e(),multiply:n?l.refused(W):e(),divide:n?l.refused(W):withScalarOutputDomain(e(),Ie)})]),W=`Arithmetic on a field with .schema() cannot validate the resulting stored value; use set with a validated value.`;function withScalarOutputDomain(e,t){let n=e[`~standard`].validate,r={...e};Object.defineProperties(r,Object.getOwnPropertyDescriptors(e));let i=Object.getOwnPropertyDescriptors(e[`~standard`]);Reflect.deleteProperty(i,`validate`);let a=Object.defineProperties({},i);return Object.defineProperty(a,`validate`,{value:e=>{let r=n(e);return r.issues?r:v(t,r.value)}}),Object.defineProperty(r,`~standard`,{value:a}),r}const buildSetUpdate=e=>l.union([l.shorthandUpdate(e),l.object({set:e},{partial:!1})]),listUpdateFamily=(e,t)=>n=>l.union([l.shorthandUpdate(n),l.object({set:n,push:l.union([l.shorthandArray(e()),t()]),unshift:l.union([l.shorthandArray(e()),t()])})]),once=e=>{let t;return()=>(t??=e(),t)},createScalarInterners=()=>({update:createScalarInterner(),filter:createScalarInterner()}),internedVariant=(e,t,n)=>()=>e(t,n),internedScalarSchemas=(e,t,n)=>lazyScalarSchemas({base:n.base,create:n.create,update:internedVariant(e.update,t,n.update),filter:internedVariant(e.filter,t,n.filter)}),comparableScalar=(e,t,n)=>{let r=once(()=>t()),i=once(()=>t({array:!0})),a=comparisonFilterFamily(e,r,i),o=listFilterFamily(r,i),s=n?arithmeticUpdateFamily(r):buildSetUpdate,c=listUpdateFamily(r,i),l=createScalarInterners();return e=>{let storedDomain=(n=!1)=>t({nullable:e.nullable,array:e.array,disallowZero:n}),n=e.schema===void 0?e.base:withScalarOutputDomain(e.base,storedDomain()),refinedListUpdate=()=>listUpdateFamily(()=>withScalarOutputDomain(t({...e,array:!1,nullable:!1,optional:!1,default:void 0}),r()),()=>withScalarOutputDomain(t({...e,array:!0,nullable:!1,optional:!1,default:void 0}),i()))(n);return internedScalarSchemas(l,scalarInternKey(e),{base:n,create:()=>e.schema===void 0?t(e):withScalarOutputDomain(t(e),storedDomain(e.disallowZero)),update:()=>e.array?e.schema===void 0?c(e.base):refinedListUpdate():s(n,e.schema!==void 0),filter:()=>e.array?o(storedDomain()):a(storedDomain())})}},Le=comparableScalar(`bigint`,l.bigint,!0),G=l.blob({array:!0}),buildBlobFilterSchema=e=>buildNegatableFilterSchema(l.object({equals:e,in:G,notIn:G}),e),buildBlobSchema=e=>lazyScalarSchemas({base:e.base,create:()=>l.blob(e),update:()=>buildSetUpdate(e.base),filter:()=>buildBlobFilterSchema(e.base)}),K=once(()=>l.boolean()),q=once(()=>l.boolean({array:!0})),buildBooleanFilterSchema=e=>{let t=l.comparisonOperand(`boolean`,e);return buildNegatableFilterSchema(l.object({equals:t}),t)},Re=listFilterFamily(K,q),ze=listUpdateFamily(K,q),Be=createScalarInterners(),buildBooleanSchema=e=>internedScalarSchemas(Be,scalarInternKey(e),{base:e.base,create:()=>l.boolean(e),update:()=>e.array?ze(e.base):buildSetUpdate(e.base),filter:()=>e.array?Re(e.base):buildBooleanFilterSchema(e.base)}),Ve=comparableScalar(`date`,l.isoDate,!1),He=comparableScalar(`datetime`,l.isoTimestamp,!1),domainOf=e=>({decimal:e.decimal}),decimalComparisonOperand=e=>{let t=l.comparisonOperand(`decimal`,e),n=t[`~standard`].validate,r=_(`comparison_operand`,e=>{let t=n(e);return t.issues?ne(t.issues):re(t.value)?g(`An SQL fragment is not a decimal operand: it carries no precision or scale, so the comparison would mean something different on each provider. Use a field reference or raw SQL.`):h(t.value)}),i={type:`comparison_operand`,fieldType:`decimal`,wrapped:e,acceptsUndefined:t.acceptsUndefined};return Object.assign(r,i)},OPERATION_REFUSAL=e=>`A decimal update takes exactly one operation: ${e.join(`, `)}`,Ue=new Set([`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`,`__proto__`,`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`]),exactlyOneOperation=e=>{let n=Object.keys(e),r=new Set(n),isOperation=e=>r.has(e),i=_(`exact_one`,r=>{let i;try{if(!t(r))return g(`Expected object`);let e=Reflect.ownKeys(r);if(e.length!==1)return g(OPERATION_REFUSAL(n));let[a]=e;if(typeof a!=`string`||!isOperation(a))return g(OPERATION_REFUSAL(n));let o=new Set,s=Reflect.getPrototypeOf(r);for(;s!==null;){if(o.has(s))return g(OPERATION_REFUSAL(n));o.add(s);let e=s===Object.prototype;for(let t of Reflect.ownKeys(s))if(!e||typeof t!=`string`||!Ue.has(t))return g(OPERATION_REFUSAL(n));s=Reflect.getPrototypeOf(s)}let c=Reflect.get(r,a);if(c===void 0)return g(OPERATION_REFUSAL(n));i={operation:a,operand:c}}catch{return g(OPERATION_REFUSAL(n))}let{operation:a,operand:o}=i,s=e[a],c=v(s,o);if(c.issues){if(s.type===`refused`)return c;let[e]=c.issues;return g(e.message,[a,...e.path??[]])}let l=Object.create(null);return l[a]=c.value,h(l)}),a={type:`exact_one`,entries:e};return Object.assign(i,a)},buildDecimalCreateSchema=e=>{if(!e.hasDefault||typeof e.default==`function`)return l.decimal(e);if(e.array&&Array.isArray(e.default)){let t=e.default;return l.optional(e.base,()=>t.slice())}return l.optional(e.base,e.default)};function buildDecimalSchema(e){let t=domainOf(e),member=()=>l.decimal(t),list=()=>l.decimal({...t,array:!0}),writeMember=()=>l.decimal({...t,schema:e.schema}),writeList=()=>l.decimal({...t,array:!0,schema:e.schema}),arithmeticMember=()=>e.schema===void 0?member():l.refused(W),filterBase=()=>l.decimal({...t,nullable:e.nullable,array:e.array});return lazyScalarSchemas({base:e.base,create:()=>buildDecimalCreateSchema(e),update:()=>e.array?l.union([l.shorthandUpdate(e.base),exactlyOneOperation({set:e.base,push:l.union([l.shorthandArray(writeMember()),writeList()]),unshift:l.union([l.shorthandArray(writeMember()),writeList()]),increment:l.refused(`A decimal list update does not support 'increment'.`),decrement:l.refused(`A decimal list update does not support 'decrement'.`),multiply:l.refused(`A decimal list update does not support 'multiply'.`),divide:l.refused(`A decimal list update does not support 'divide'.`)})]):l.union([l.shorthandUpdate(e.base),exactlyOneOperation({set:e.base,increment:arithmeticMember(),decrement:arithmeticMember(),multiply:arithmeticMember(),divide:arithmeticMember()})]),filter:()=>e.array?buildNegatableFilterSchema(l.object({equals:filterBase(),has:member(),hasEvery:list(),hasSome:list(),isEmpty:l.boolean(),in:l.refused(`A decimal list filter does not support 'in'.`),notIn:l.refused(`A decimal list filter does not support 'notIn'.`),lt:l.refused(`A decimal list filter does not support 'lt'.`),lte:l.refused(`A decimal list filter does not support 'lte'.`),gt:l.refused(`A decimal list filter does not support 'gt'.`),gte:l.refused(`A decimal list filter does not support 'gte'.`)}),filterBase()):buildDecimalFilterSchema(filterBase(),member,list)})}const buildDecimalFilterSchema=(e,t,n)=>{let r=decimalComparisonOperand(e);return buildNegatableFilterSchema(l.object({equals:r,in:p(n()),notIn:p(n()),lt:decimalComparisonOperand(t()),lte:decimalComparisonOperand(t()),gt:decimalComparisonOperand(t()),gte:decimalComparisonOperand(t())}),r)},orderedEnumRefusal=e=>l.refused(`Filter operation '${e}' is not supported on an enum field: PostgreSQL orders enum values by their declaration order while MySQL and SQLite compare them as text, so the same query would answer differently per provider. Use 'equals'/'in', or model the field as a string or int if you need ordering.`),enumBase=e=>l.enum(e),enumList=e=>l.enum(e,{array:!0}),buildEnumFilterSchema=(e,t)=>{let n=enumList(t),r=l.comparisonOperand(`enum`,e);return buildNegatableFilterSchema(l.object({equals:r,in:p(n),notIn:p(n),lt:orderedEnumRefusal(`lt`),lte:orderedEnumRefusal(`lte`),gt:orderedEnumRefusal(`gt`),gte:orderedEnumRefusal(`gte`)}),r)},buildEnumListFilterSchema=(e,t)=>listFilterFamily(()=>enumBase(t),()=>enumList(t))(e),buildEnumListUpdateSchema=(e,t)=>listUpdateFamily(()=>enumBase(t),()=>enumList(t))(e),buildEnumSchema=e=>{let t=e.base.values;return lazyScalarSchemas({base:e.base,create:()=>l.enum(t,e),update:()=>e.array?buildEnumListUpdateSchema(e.base,t):buildSetUpdate(e.base),filter:()=>e.array?buildEnumListFilterSchema(e.base,t):buildEnumFilterSchema(e.base,t)})},We=comparableScalar(`int`,l.integer,!0),J=`a JSON filter operand`,Y=`JSON write data`,X=[`DbNull`,`JsonNull`,`AnyNull`],Ge=[`DbNull`,`JsonNull`],Ke=[`JsonNull`],qe=/^\d+$/,unsupportedPathString=(e,t)=>`JSON filter has an unsupported path string '${e}': ${t}. The supported grammar is '\$', '\$.key', '\$.key[0]' and nothing else; use the array form (path: ['a', 'b']) for keys containing '.', '[' or ']'.`,parseJsonStringPath=e=>{if(!e.startsWith(`$`))return unsupportedPathString(e,`a path string must start with '$'`);let t=[],n=1;for(;n<e.length;){let r=e[n];if(r===`.`){n+=1;let r=n;for(;n<e.length&&e[n]!==`.`&&e[n]!==`[`;)n+=1;let i=e.slice(r,n);if(i.length===0)return unsupportedPathString(e,`an object key may not be empty`);if(i.includes(`*`))return unsupportedPathString(e,`wildcards are not supported`);t.push(i);continue}if(r===`[`){let r=e.indexOf(`]`,n);if(r===-1)return unsupportedPathString(e,`an unclosed '['`);let i=e.slice(n+1,r);if(!qe.test(i))return unsupportedPathString(e,`'[${i}]' is not a non-negative integer array index`);t.push(i),n=r+1;continue}return unsupportedPathString(e,`unexpected '${r}'`)}return t},portablePathRefusal=e=>e.some(e=>e.includes(`"`)||e.includes(`\\`))?`JSON filter requires a portable JSON path; segments containing '"' or '\\' are not supported.`:void 0,Je=l.array(l.string()),Ye=l.string(),buildJsonPathSchema=()=>{let e=_(`union`,e=>{if(Array.isArray(e)){let t=e.map(String),n=portablePathRefusal(t);return n?g(n):h(t)}if(typeof e!=`string`)return g(`Expected string or array of strings`);let t=parseJsonStringPath(e);if(typeof t==`string`)return g(t);let n=portablePathRefusal(t);return n?g(n):h(t)});return e.options=[Je,Ye],e},Xe=[`string_contains`,`string_starts_with`,`string_ends_with`],inertModeRefusal=e=>{if(e.mode===`insensitive`&&!(e.not!==void 0&&i(e.not)===void 0))return Xe.some(t=>e[t]!==void 0)?void 0:`JSON filter sets mode: 'insensitive' but has no string_contains/string_starts_with/string_ends_with operation for it to apply to.`},pathSentinelRefusal=e=>{if(e.path===void 0)return;let{equals:n,not:r}=e,a=i(n)??i(r)??(t(r)?i(r.equals):void 0);return a&&`JSON filter cannot combine 'path' with the ${a} sentinel: the sentinels distinguish the database NULL from the JSON null value of the WHOLE column. Use 'path' with 'equals: null' to test for a JSON null at that path.`},buildJsonFilterSchema=e=>{let t=l.union([l.number(),l.string()]),n=l.noFieldRef(e,J),r={equals:p(l.jsonNullOr(X,n,J)),path:buildJsonPathSchema(),mode:l.enum([`default`,`insensitive`]),lt:t,lte:t,gt:t,gte:t,string_contains:l.string(),string_starts_with:l.string(),string_ends_with:l.string(),array_contains:n,array_starts_with:n,array_ends_with:n},refuse=e=>requireFilterOperation(e)??inertModeRefusal(e)??pathSentinelRefusal(e),a=l.object(r,{refuse}),o=l.object({...r,not:l.jsonNullOr(X,a,J)},{refuse}),s=o[`~standard`].validate;return Object.defineProperty(o[`~standard`],`validate`,{value:e=>{let t=i(e);return t?g(`${t} is an operand, not a JSON filter; compare with { equals: ${t} }.`):s(e)}}),o},nullWriteRefusal=e=>e?`null is ambiguous in JSON write data: it could mean the database NULL or the JSON value null. Use DbNull for the database NULL, or JsonNull for the JSON value null.`:`null is ambiguous in JSON write data: it could mean the database NULL or the JSON value null. This field is not nullable, so use JsonNull to write the JSON value null.`,buildJsonWriteOperand=(e,t)=>l.jsonWrite(e.nullable?Ge:Ke,l.noFieldRef(t,Y),Y,nullWriteRefusal(e.nullable)),isSetEnvelope=e=>t(e)&&Object.hasOwn(e,`set`)&&Object.keys(e).length===1,buildJsonUpdateSchema=(e,t)=>{let n=buildJsonWriteOperand(e,t),r=l.object({set:n},{partial:!1}),i=l.shorthandUpdate(n),a=l.union([r,i]);return Object.defineProperty(a[`~standard`],`validate`,{value:e=>isSetEnvelope(e)?v(r,e):v(i,e)}),a},buildJsonSchema=e=>lazyScalarSchemas({base:e.base,create:()=>{let t=buildJsonWriteOperand(e,l.json(e)),n=t[`~standard`].validate,admit=t=>{if(t!==void 0||!e.hasDefault)return n(t);let r;try{r=typeof e.default==`function`?e.default():e.default}catch{return g(`JSON default failed`)}return r===void 0?g(`JSON default must resolve to a value`):r===null?e.nullable?h(null):n(a):n(r)};return Object.defineProperty(t[`~standard`],`validate`,{value:e=>{if(!isSetEnvelope(e))return admit(e);let t=admit(e.set);return t.issues?{issues:t.issues.map(({message:e,path:t})=>({message:e,path:[`set`,...t??[]]}))}:t}}),t},update:()=>buildJsonUpdateSchema(e,e.base),filter:()=>buildJsonFilterSchema(l.json())}),Ze=comparableScalar(`number`,l.number,!0),Z=_(`number`,e=>{let t=ee(e);return t.issues?t:t.value<0?g(`Distance comparisons must use non-negative meters`):h(t.value)}),pointDistanceSchema=()=>l.object({to:l.point(),lt:Z,lte:Z,gt:Z,gte:Z},{atLeast:[`to`],requiresOneOf:[[`lt`,`lte`,`gt`,`gte`]]}),buildPointFilterSchema=e=>buildNegatableFilterSchema(l.object({equals:e,distance:pointDistanceSchema(),within:de()}),e),buildPointSchema=e=>lazyScalarSchemas({base:e.base,create:()=>l.point(e),update:()=>buildSetUpdate(e.base),filter:()=>buildPointFilterSchema(e.base)}),Q=once(()=>l.string()),$=once(()=>l.string({array:!0})),Qe=once(()=>l.object({in:$(),notIn:$(),contains:l.fieldRefOr(`string`,Q()),startsWith:l.fieldRefOr(`string`,Q()),endsWith:l.fieldRefOr(`string`,Q()),mode:l.enum([`default`,`insensitive`])})),$e=once(()=>l.object({in:$(),notIn:$()})),buildStringFilterSchema=(e,t)=>{let n=l.comparisonOperand(`string`,e);return buildNegatableFilterSchema(Qe().extend({equals:n,lt:n,lte:n,gt:n,gte:n,in:p(t),notIn:p(t)}),n)},buildCompactIdFilterSchema=(e,t)=>{let n=l.comparisonOperand(`string`,e);return buildNegatableFilterSchema($e().extend({equals:n,lt:n,lte:n,gt:n,gte:n,in:p(t),notIn:p(t)}),n)},et=listFilterFamily(Q,$),tt=listUpdateFamily(Q,$),nt=createScalarInterners(),domainBaseOf=(e,t)=>{if(t===void 0)return e.base;let n={nullable:e.nullable,array:e.array,schema:e.schema,idDomain:t};return l.string(n)},domainMembersOf=e=>e===void 0?$():l.string({array:!0,idDomain:e}),domainStateOf=(e,t)=>t===void 0?e:{...e,idDomain:t},buildStringSchema=(e,t)=>{let n=e.array===!0?ce(e):le(e)??t,filterBase=()=>l.string({nullable:e.nullable,array:e.array,idDomain:n}),r=domainBaseOf(e,n),i=e.schema===void 0||n!==void 0?r:withScalarOutputDomain(r,filterBase()),refinedListUpdate=()=>listUpdateFamily(()=>n===void 0?withScalarOutputDomain(l.string({schema:e.schema}),Q()):l.string({schema:e.schema,idDomain:n}),()=>n===void 0?withScalarOutputDomain(l.string({array:!0,schema:e.schema}),$()):l.string({array:!0,schema:e.schema,idDomain:n}))(i);return internedScalarSchemas(nt,scalarInternKey(e,n),{base:i,create:()=>e.schema===void 0||n!==void 0?l.string(domainStateOf(e,n)):withScalarOutputDomain(l.string(domainStateOf(e,n)),filterBase()),update:()=>e.array?e.schema===void 0&&n===void 0?tt(i):refinedListUpdate():buildSetUpdate(i),filter:()=>e.array?n===void 0?et(filterBase()):listFilterFamily(()=>l.string({idDomain:n}),()=>domainMembersOf(n))(filterBase()):n!==void 0&&te(n.format)?buildCompactIdFilterSchema(filterBase(),domainMembersOf(n)):buildStringFilterSchema(filterBase(),domainMembersOf(n))})},rt=comparableScalar(`time`,l.isoTime,!1),buildVectorFilterSchema=e=>buildNegatableFilterSchema(l.object({equals:e}),e),buildVectorSchema=e=>lazyScalarSchemas({base:e.base,create:()=>l.vector(e.dimension,e),update:()=>buildSetUpdate(e.base),filter:()=>buildVectorFilterSchema(e.base)}),getScalarSchemas=(e,t)=>it[e.type](e,t),it={bigint:Le,blob:buildBlobSchema,boolean:buildBooleanSchema,datetime:He,decimal:buildDecimalSchema,enum:buildEnumSchema,int:We,json:buildJsonSchema,number:Ze,point:buildPointSchema,string:buildStringSchema,vector:buildVectorSchema,date:Ve,time:rt},getScalarsSchemas=(e,t)=>{let n={},r=e[`~`].state.scalars;for(let e in r){let i=r[e][`~`].state;n[e]=()=>{let n=getScalarSchemas(i,t?.get(e));return i.autoGenerate?.kind===`now`?insertOnly(n):i.autoGenerate?.kind===`updatedAt`&&!i.array?updatesAt(n,i.type):n}}return lazyRecord(n)},insertOnly=e=>Object.defineProperty(e,`update`,{value:void 0,enumerable:!0}),updatedAtUpdate=(e,t)=>{let n={acceptsUndefined:!0,wrapped:e};return Object.assign(_(`optional`,n=>v(e,n===void 0?ue(t):n)),n)},updatesAt=(e,t)=>lazyScalarSchemas({base:e.base,create:()=>e.create,update:()=>updatedAtUpdate(e.update,t),filter:()=>e.filter});var SchemaRegistry=class{#e=new Map;#t;#n;proxy;constructor(e,t){this.#t=e,this.#n=t,this.proxy=new Proxy({},{get:(t,i)=>{if(!(n(i)&&Object.hasOwn(e,i)&&e[i])){let e=String(i);throw new r({kind:`registry`,property:e},[{path:e,message:`${e} does not exist`}])}return this.getModelSchemas(e[i])}})}#r=e=>()=>{let t=e[`~`].settleTarget();return this.getModelSchemas(t)};#i=e=>{let t=getScalarsSchemas(e,ae(this.#n).get(e)),n=this.#n.get(e),r=getRelationsSchemas(e,this.#r,n),i=getPolymorphicRelationsSchemas(e,this.getModelSchemas),{args:a,core:o}=getModelSchemas(e,{scalars:t,relations:r,polymorphic:i},n);return{scalars:t,relations:r,polymorphic:i,args:a,core:o}};getModelSchemas=e=>{let t=this.#e.get(e);return t||(t=this.#i(e),this.#e.set(e,t)),t};validate=(e,t,n)=>{let i=Object.hasOwn(this.#t,e)?this.#t[e]:void 0;if(!i){let n=String(e);throw new r({kind:`operation`,operation:t,model:n},[{path:n,message:`${n} does not exist`}],{meta:{model:n}})}let a=this.getModelSchemas(i);if(!Object.hasOwn(a.args,t))throw new r({kind:`registry`,model:e,property:String(t)},[{path:`operation`,message:`${String(t)} does not exist`}]);try{let i=v(a.args[t],n);if(i.issues)throw new r(t,i.issues.map(e=>({path:e.path?.map(e=>e).join(`.`)??``,message:e.message})),{meta:{model:e}});return i.value??{}}catch(n){throw n instanceof r?n:new r({kind:`operation`,operation:t,model:e},[{path:``,message:`The external schema validator threw unexpectedly`}],{...n instanceof Error?{cause:n}:{},meta:{model:e}})}}};const createResolvedSchemaRegistry=(e,t)=>new SchemaRegistry(e,t),createSchemaRegistry=e=>(ie(e),createResolvedSchemaRegistry(e,se(e)));export{clearableMembership as a,carriesRepeatedKey as i,createSchemaRegistry as n,slotMayBeEmpty as o,De as r,projectableScalarNames as s,createResolvedSchemaRegistry as t};
|
|
2
|
-
//# sourceMappingURL=builder-BS8EW4BQ.mjs.map
|