okmodel 0.5.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -1116
- package/dist/adapters/capabilities.d.ts +3 -0
- package/dist/adapters/failure.d.ts +13 -2
- package/dist/adapters/lazy-errors.d.ts +22 -0
- package/dist/adapters/pg/bunsql-extra.d.ts +54 -3
- package/dist/adapters/pg/bunsql.d.ts +14 -1
- package/dist/adapters/pg/cursor.d.ts +17 -0
- package/dist/adapters/pg/no-inflight-timeout.d.ts +20 -0
- package/dist/adapters/pg/nodepostgres-extra.d.ts +22 -1
- package/dist/adapters/pg/nodepostgres.d.ts +12 -0
- package/dist/adapters/pg/pglite-wire.d.ts +24 -0
- package/dist/adapters/pg/pglite.d.ts +10 -0
- package/dist/adapters/pg/postgres-extra.d.ts +41 -3
- package/dist/adapters/pg/reserved.d.ts +42 -0
- package/dist/adapters/pg/session.d.ts +0 -18
- package/dist/contracts/catalog/document.d.ts +19 -5
- package/dist/contracts/catalog/object.d.ts +2 -1
- package/dist/contracts/catalog/policy.d.ts +48 -0
- package/dist/contracts/catalog/types.d.ts +25 -1
- package/dist/contracts/catalog/view.d.ts +2 -0
- package/dist/contracts/connection.d.ts +7 -6
- package/dist/contracts/internal.js +1 -1
- package/dist/contracts/location.d.ts +10 -0
- package/dist/dialects/pg/column.d.ts +13 -2
- package/dist/dialects/pg/ddl.d.ts +37 -1
- package/dist/dialects/pg/emit.d.ts +19 -1
- package/dist/dialects/pg/errors.d.ts +32 -1
- package/dist/dialects/pg/ext/citext.js +1 -1
- package/dist/dialects/pg/ext/index.js +1 -1
- package/dist/dialects/pg/ext/pg-trgm.js +1 -1
- package/dist/dialects/pg/filter-parse.d.ts +5 -4
- package/dist/dialects/pg/floor.d.ts +68 -0
- package/dist/dialects/pg/fn/index.js +2 -2
- package/dist/dialects/pg/index.d.ts +8 -2
- package/dist/dialects/pg/index.js +67 -171
- package/dist/dialects/pg/introspect.d.ts +7 -0
- package/dist/dialects/pg/keys.d.ts +11 -8
- package/dist/dialects/pg/model.d.ts +47 -2
- package/dist/dialects/pg/morph.d.ts +43 -0
- package/dist/dialects/pg/operator-fit.d.ts +2 -2
- package/dist/dialects/pg/operators.d.ts +14 -7
- package/dist/dialects/pg/ops/bucket.d.ts +65 -0
- package/dist/dialects/pg/ops/inc.d.ts +2 -2
- package/dist/dialects/pg/ops/matches.d.ts +9 -12
- package/dist/dialects/pg/ops/relevance.d.ts +13 -0
- package/dist/dialects/pg/ops/search-query.d.ts +22 -0
- package/dist/dialects/pg/ops/window.d.ts +103 -0
- package/dist/dialects/pg/owner.d.ts +42 -0
- package/dist/dialects/pg/path-endpoint.d.ts +20 -0
- package/dist/dialects/pg/preset.d.ts +1 -1
- package/dist/dialects/pg/relations.d.ts +100 -3
- package/dist/dialects/pg/role/check.d.ts +3 -0
- package/dist/dialects/pg/role/index.d.ts +71 -6
- package/dist/dialects/pg/role/sql.d.ts +11 -0
- package/dist/dialects/pg/schema.d.ts +33 -3
- package/dist/dialects/pg/table.d.ts +25 -3
- package/dist/dialects/pg/tenancy.d.ts +45 -3
- package/dist/dialects/pg/view/client.d.ts +19 -1
- package/dist/dialects/pg/view/index.d.ts +4 -0
- package/dist/dialects/pg/view/index.js +21 -178
- package/dist/dialects/pg/view/refresh.d.ts +24 -0
- package/dist/runtime/aggregate.d.ts +8 -2
- package/dist/runtime/batch.d.ts +1 -1
- package/dist/runtime/bucket-group.d.ts +70 -0
- package/dist/runtime/conflict.d.ts +24 -6
- package/dist/runtime/drift.d.ts +9 -0
- package/dist/runtime/include.d.ts +0 -8
- package/dist/runtime/inflight.d.ts +14 -0
- package/dist/runtime/page.d.ts +4 -1
- package/dist/runtime/pg/bun.js +12 -5
- package/dist/runtime/pg/pg.js +5 -5
- package/dist/runtime/pg/pglite.d.ts +1 -0
- package/dist/runtime/pg/pglite.js +9 -8
- package/dist/runtime/pg/postgresjs.js +5 -5
- package/dist/runtime/plan.d.ts +113 -15
- package/dist/runtime/predicate.d.ts +19 -0
- package/dist/runtime/read-stream.d.ts +13 -16
- package/dist/runtime/result-name.d.ts +17 -0
- package/dist/runtime/safety/index.js +1 -1
- package/dist/runtime/server-check.d.ts +3 -3
- package/dist/runtime/sort-bind.d.ts +21 -0
- package/dist/runtime/sort.d.ts +56 -0
- package/dist/runtime/sync.d.ts +70 -0
- package/dist/runtime/tenancy/composite.d.ts +26 -0
- package/dist/runtime/tenancy/context.d.ts +16 -0
- package/dist/runtime/tenancy/index.d.ts +9 -5
- package/dist/runtime/tenancy/index.js +1511 -38
- package/dist/runtime/tenancy/path.d.ts +87 -0
- package/dist/runtime/tenancy/rls.d.ts +67 -0
- package/dist/runtime/tenancy/via.d.ts +22 -0
- package/dist/runtime/text-search.d.ts +20 -0
- package/dist/runtime/traits/index.d.ts +80 -0
- package/dist/runtime/traits/index.js +187 -17
- package/dist/runtime/tree.d.ts +38 -0
- package/dist/runtime/types.d.ts +231 -23
- package/dist/runtime/validate/index.js +4 -4
- package/dist/runtime/version.d.ts +39 -0
- package/dist/runtime/window.d.ts +21 -0
- package/dist/runtime/write.d.ts +55 -3
- package/dist/shared/{krxx77g0.js → 14vx95q4.js} +12 -18
- package/dist/shared/1est4ezg.js +313 -0
- package/dist/shared/{4az561fn.js → 1qa0qajz.js} +8 -23
- package/dist/shared/1w508jbr.js +1611 -0
- package/dist/shared/2c13q96h.js +18 -0
- package/dist/shared/2d3xq4ps.js +9 -0
- package/dist/shared/2shdbn8q.js +23 -0
- package/dist/shared/{t4tbsy9h.js → 358zsv4r.js} +1 -1
- package/dist/shared/3v7t1yrv.js +208 -0
- package/dist/shared/5e3tf63j.js +220 -0
- package/dist/shared/5fe3kbsh.js +10 -0
- package/dist/shared/5v3xf80k.js +37 -0
- package/dist/shared/{51mvgj8w.js → 63qtkrca.js} +130 -3
- package/dist/shared/{gbtcc2d7.js → 67txcrcw.js} +62 -66
- package/dist/shared/79dt02vc.js +12 -0
- package/dist/shared/{v36c5g6p.js → 7k9grvf6.js} +407 -14
- package/dist/shared/7kms6fvj.js +20 -0
- package/dist/shared/7mnme5tn.js +8 -0
- package/dist/shared/7n7ddwt4.js +6 -0
- package/dist/shared/{87jvvhnt.js → 81ebdx9p.js} +48 -68
- package/dist/shared/{szm0cksa.js → 8skf0cam.js} +34 -6
- package/dist/shared/{gjthds9j.js → 9628a9xt.js} +1 -1
- package/dist/shared/9a4ae4p8.js +31 -0
- package/dist/shared/{8xsbagad.js → 9s0ypp87.js} +88 -7
- package/dist/shared/9y3mmmh1.js +436 -0
- package/dist/shared/ab9gmbwy.js +213 -0
- package/dist/shared/{sycnx8gt.js → ax7qv55k.js} +18 -8
- package/dist/shared/{f5cw5q5r.js → aytqh5y2.js} +6 -4
- package/dist/shared/{fancm5pt.js → b5pftnn2.js} +138 -15
- package/dist/shared/{efmy2gcg.js → b76b8d95.js} +2 -2
- package/dist/shared/bdk4sty6.js +58 -0
- package/dist/shared/{32zqc1dw.js → bg3rym3g.js} +63 -32
- package/dist/shared/{0t22wwh1.js → bm22fvzr.js} +16 -14
- package/dist/shared/bz84tkzm.js +342 -0
- package/dist/shared/{31vm914h.js → cm3w0ywp.js} +15 -16
- package/dist/shared/cn957f8d.js +179 -0
- package/dist/shared/{pf0d8f77.js → cnkky55j.js} +25 -14
- package/dist/shared/{5fqx9yh4.js → dk8v79p3.js} +3 -1
- package/dist/shared/{nkaxvt9q.js → dkxgzaqd.js} +224 -19
- package/dist/shared/dzj09cye.js +10 -0
- package/dist/shared/{4m9fn52z.js → ed0b8k4s.js} +1 -1
- package/dist/shared/{z2rnngj4.js → ek2wt2dz.js} +8 -5
- package/dist/shared/exn3sd90.js +359 -0
- package/dist/shared/g6evj1j3.js +66 -0
- package/dist/shared/ga9j92qj.js +25 -0
- package/dist/shared/{qv2ydck9.js → gs74dbj5.js} +651 -76
- package/dist/shared/gzaveazc.js +285 -0
- package/dist/shared/{8rsy3hxz.js → h15jx9bc.js} +1 -1
- package/dist/shared/{dyj86cmj.js → hyh73qk6.js} +3 -3
- package/dist/shared/je4axnm8.js +22 -0
- package/dist/shared/{ycatkxmq.js → jgqj11w4.js} +1 -1
- package/dist/shared/{6qd27mx0.js → jvd0mqag.js} +5 -5
- package/dist/shared/jznfax0y.js +155 -0
- package/dist/shared/{cgbamx3e.js → kb2sdhfb.js} +7 -4
- package/dist/shared/{ps7a6h14.js → kr0jzbw2.js} +12 -8
- package/dist/shared/{janx09m5.js → ktz42yez.js} +20 -8
- package/dist/shared/{gde73es6.js → m6p12kbr.js} +56 -55
- package/dist/shared/{r6nwkxnt.js → m7n9h2a5.js} +4 -4
- package/dist/shared/{672t5vym.js → mss6ctgv.js} +2 -2
- package/dist/shared/{nxdp2ze3.js → mtaszv5a.js} +144 -12
- package/dist/shared/n816peh1.js +45 -0
- package/dist/shared/nbw1z4yd.js +18 -0
- package/dist/shared/{cctw17hj.js → p6qc5gcp.js} +38 -34
- package/dist/shared/{6rk2gen5.js → pbp1ss85.js} +20 -17
- package/dist/shared/pt94kz7f.js +6 -0
- package/dist/shared/{wq9n6pwr.js → pz6rj8ay.js} +82 -9
- package/dist/shared/q5c6ngn3.js +13 -0
- package/dist/shared/{8bwbwy8h.js → qq3899ht.js} +128 -18
- package/dist/shared/{8ktwd3rh.js → r3j8s5y0.js} +1 -1
- package/dist/shared/rhs3xe4k.js +7 -0
- package/dist/shared/{ntneex2a.js → rpycarcr.js} +6 -6
- package/dist/shared/{sdc7r2ww.js → rs73fca9.js} +8 -8
- package/dist/shared/{tm5ab8we.js → sfz1ksn6.js} +7 -4
- package/dist/shared/{6mnp99hx.js → svncdeh5.js} +16 -12
- package/dist/shared/{hf22e0wt.js → tbrvgw6z.js} +62 -42
- package/dist/shared/te5as7z7.js +622 -0
- package/dist/shared/{ga3sfy93.js → tsvww22q.js} +535 -200
- package/dist/shared/{47x8x9ze.js → ttsqgp4p.js} +20 -13
- package/dist/shared/{x72jb7ad.js → v8g1vgv8.js} +1 -1
- package/dist/shared/vb6qfyve.js +152 -0
- package/dist/shared/{r2sp8hrc.js → vczs8gd4.js} +22 -13
- package/dist/shared/{1g0drakv.js → vqrjpcqn.js} +145 -3
- package/dist/shared/{2pqx26h8.js → w72kgg4q.js} +31 -22
- package/dist/shared/{96qcj21c.js → w79hsckn.js} +16 -51
- package/dist/shared/wa07eas9.js +730 -0
- package/dist/shared/{k8v5v5wj.js → x933k9a3.js} +75 -34
- package/dist/shared/{cr74e96e.js → xhfsfkgk.js} +62 -28
- package/dist/shared/xjk7hnn5.js +272 -0
- package/dist/shared/{5enne4ma.js → xnxsed62.js} +66 -113
- package/dist/shared/xqve9598.js +53 -0
- package/dist/shared/{9x25fxhc.js → y34a8714.js} +1 -1
- package/dist/shared/{k7dwkhvq.js → y6jdds7g.js} +4 -1
- package/dist/shared/y6njgyda.js +249 -0
- package/dist/shared/{c9z5g0fm.js → ywr8hmey.js} +5 -2
- package/dist/shared/{g7ez901n.js → ywspezzx.js} +1 -1
- package/dist/shared/z7s6fpxv.js +62 -0
- package/dist/shared/{n7mcc1gk.js → zchaghkf.js} +4 -3
- package/dist/shared/{9m80mkac.js → ze4hxsmy.js} +1 -1
- package/dist/shared/zm0ptry0.js +40 -0
- package/dist/shared/{nsva2a6b.js → znm0bpp5.js} +3 -0
- package/dist/shared/zp9fmend.js +145 -0
- package/dist/shared/{y005b761.js → zy8r7qvz.js} +6 -2
- package/dist/tooling/cli.js +41 -15
- package/dist/tooling/migrate/apply.d.ts +14 -0
- package/dist/tooling/migrate/check.d.ts +3 -4
- package/dist/tooling/migrate/classify.d.ts +4 -0
- package/dist/tooling/migrate/config.d.ts +3 -2
- package/dist/tooling/migrate/engine.d.ts +3 -2
- package/dist/tooling/migrate/files.d.ts +11 -1
- package/dist/tooling/migrate/index.js +14 -14
- package/dist/tooling/migrate/lint.d.ts +1 -1
- package/dist/tooling/migrate/lost.d.ts +28 -0
- package/dist/tooling/migrate/paths.d.ts +14 -0
- package/dist/tooling/migrate/plan.d.ts +6 -3
- package/dist/tooling/migrate/runner.d.ts +25 -0
- package/dist/tooling/migrate/sandbox.d.ts +57 -0
- package/dist/tooling/migrate/sql-lex.d.ts +20 -3
- package/dist/tooling/migrate/text.d.ts +42 -0
- package/dist/tooling/node-version.d.ts +21 -0
- package/dist/tooling/testing/facts.d.ts +33 -5
- package/dist/tooling/testing/index.d.ts +1 -1
- package/dist/tooling/testing/index.js +3 -3
- package/dist/tooling/testing/isolation.d.ts +11 -5
- package/package.json +8 -3
- package/dist/shared/7m88x3e9.js +0 -45
- package/dist/shared/7zwwyh0v.js +0 -448
- package/dist/shared/aj2qxyhj.js +0 -90
- package/dist/shared/caw8b9d8.js +0 -204
- package/dist/shared/jwtxdj06.js +0 -76
- package/dist/shared/kfjp0gck.js +0 -212
- package/dist/shared/q58y17hy.js +0 -21
- package/dist/shared/qm7cdtvr.js +0 -912
- package/dist/shared/r8x5qhd7.js +0 -86
- package/dist/shared/zqrnhwsq.js +0 -31
|
@@ -6,8 +6,9 @@ import {
|
|
|
6
6
|
compileCall,
|
|
7
7
|
decodeResult,
|
|
8
8
|
logicalIntent,
|
|
9
|
-
appliedRules
|
|
10
|
-
|
|
9
|
+
appliedRules,
|
|
10
|
+
rejectKeys
|
|
11
|
+
} from "./67txcrcw.js";
|
|
11
12
|
import {
|
|
12
13
|
OkmError2,
|
|
13
14
|
safe2,
|
|
@@ -85,7 +86,7 @@ function openClient(session) {
|
|
|
85
86
|
},
|
|
86
87
|
close,
|
|
87
88
|
connected: session.connected,
|
|
88
|
-
tx: (...args) => import("./
|
|
89
|
+
tx: (...args) => import("./vczs8gd4.js").then((mod) => mod.tx(session, args)),
|
|
89
90
|
batch: (ops, options) => batchHandle(session, ops, options),
|
|
90
91
|
...session.tx?.extras
|
|
91
92
|
};
|
|
@@ -120,7 +121,7 @@ function tableApi(session, table, view, uses) {
|
|
|
120
121
|
const api = {
|
|
121
122
|
find(options = {}) {
|
|
122
123
|
if ("lock" in options) {
|
|
123
|
-
return lazyRead(session, () => import("./
|
|
124
|
+
return lazyRead(session, () => import("./sfz1ksn6.js"), table, options, base, view);
|
|
124
125
|
}
|
|
125
126
|
return start(session, "find", table, options, base, view);
|
|
126
127
|
},
|
|
@@ -134,10 +135,10 @@ function tableApi(session, table, view, uses) {
|
|
|
134
135
|
return start(session, "exists", table, options, base, view);
|
|
135
136
|
},
|
|
136
137
|
page(options) {
|
|
137
|
-
return lazyRead(session, () => import("./
|
|
138
|
+
return lazyRead(session, () => import("./pt94kz7f.js"), table, options, base, view);
|
|
138
139
|
},
|
|
139
140
|
aggregate(options = {}) {
|
|
140
|
-
return lazyRead(session, () => import("./
|
|
141
|
+
return lazyRead(session, () => import("./1est4ezg.js"), table, options, base, view);
|
|
141
142
|
},
|
|
142
143
|
insert(data, options = {}) {
|
|
143
144
|
return writeHandle(session, "insert", table, data, options, mods);
|
|
@@ -149,6 +150,10 @@ function tableApi(session, table, view, uses) {
|
|
|
149
150
|
return writeHandle(session, "delete", table, target, options, mods);
|
|
150
151
|
}
|
|
151
152
|
};
|
|
153
|
+
for (const walk of ["descendants", "ancestors"]) {
|
|
154
|
+
api[walk] = (id, options) => lazyRead(session, () => import("./7mnme5tn.js"), table, { id, walk, options }, base, view);
|
|
155
|
+
}
|
|
156
|
+
api.sync = (id, relation, ids, options) => lazyRead(session, () => import("./te5as7z7.js"), table, { id, relation, ids, options }, base, view, true);
|
|
152
157
|
const hooks = session.schema.hooks;
|
|
153
158
|
if (hooks !== undefined) {
|
|
154
159
|
for (const hook of hooks) {
|
|
@@ -167,13 +172,13 @@ function tableApi(session, table, view, uses) {
|
|
|
167
172
|
return api;
|
|
168
173
|
}
|
|
169
174
|
function batchHandle(session, ops, options, replica) {
|
|
170
|
-
return queryHandle(() => import("./
|
|
175
|
+
return queryHandle(() => import("./vb6qfyve.js").then((mod) => mod.batch(session, ops, options, replica)), {
|
|
171
176
|
replica: () => batchHandle(session, ops, options, true)
|
|
172
177
|
});
|
|
173
178
|
}
|
|
174
179
|
var writers;
|
|
175
180
|
function loadWrite() {
|
|
176
|
-
writers ??= import("./
|
|
181
|
+
writers ??= import("./5v3xf80k.js");
|
|
177
182
|
return writers;
|
|
178
183
|
}
|
|
179
184
|
function queryHandle(run, extra) {
|
|
@@ -258,41 +263,53 @@ function start(session, op, table, options, mods, view) {
|
|
|
258
263
|
throw new OkmError2("not_found", `one() on ${table} matched no row.`, withHttp(session.http, { kind: "not_found", table }));
|
|
259
264
|
}
|
|
260
265
|
return value;
|
|
261
|
-
}, (
|
|
266
|
+
}, () => ({
|
|
262
267
|
all(reason) {
|
|
263
268
|
return start(session, op, table, options, { ...mods, all: reason }, view);
|
|
264
269
|
},
|
|
265
270
|
required() {
|
|
266
271
|
return start(session, op, table, options, { ...mods, required: true }, view);
|
|
267
272
|
},
|
|
268
|
-
stream() {
|
|
269
|
-
return streamLazy(session, call,
|
|
273
|
+
stream(batch) {
|
|
274
|
+
return streamLazy(session, call, mods, view, batch);
|
|
270
275
|
}
|
|
271
276
|
}));
|
|
272
277
|
}
|
|
273
|
-
function lazyRead(session, load, table, options, mods, view) {
|
|
278
|
+
function lazyRead(session, load, table, options, mods, view, sync) {
|
|
274
279
|
const read = () => load().then((mod) => ({ it: mod.build(session, table, options, mods, view) }));
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
+
const sql = () => read().then((box) => box.it.sql());
|
|
281
|
+
const extra = { sql };
|
|
282
|
+
if (sync) {
|
|
283
|
+
extra.expect = (count) => lazyRead(session, load, table, options, { ...mods, expect: count }, view, true);
|
|
284
|
+
} else {
|
|
285
|
+
extra.inspect = () => read().then((box) => box.it.inspect());
|
|
286
|
+
extra.all = (reason) => lazyRead(session, load, table, options, { ...mods, all: reason }, view);
|
|
287
|
+
}
|
|
288
|
+
return queryHandle(() => read().then((box) => box.it), extra);
|
|
280
289
|
}
|
|
281
290
|
async function decodeRows(plan, rows, table) {
|
|
282
|
-
return plan.outputs.includes.length === 0 ? decodeResult(plan, rows, table) : (await import("./
|
|
291
|
+
return plan.outputs.includes.length === 0 ? decodeResult(plan, rows, table) : (await import("./dkxgzaqd.js")).decodeIncluded(plan, rows, table);
|
|
283
292
|
}
|
|
284
293
|
function readHandle(session, table, call, mods, decode, extra) {
|
|
285
294
|
let prepared;
|
|
286
295
|
const origin = call;
|
|
296
|
+
const searched = "search" in call;
|
|
287
297
|
const prepare = async () => {
|
|
288
298
|
if (prepared !== undefined)
|
|
289
299
|
return prepared;
|
|
290
300
|
if (mods.uses !== undefined) {
|
|
291
|
-
call = (await import("./
|
|
301
|
+
call = (await import("./m7n9h2a5.js")).refine(session.schema, origin, mods.uses);
|
|
302
|
+
}
|
|
303
|
+
if (searched) {
|
|
304
|
+
call = (await import("./jznfax0y.js")).applyTextSearch(session.schema, call);
|
|
292
305
|
}
|
|
293
|
-
if (readNeedsOperatorSql(session.schema, call))
|
|
294
|
-
await loadOperatorSql();
|
|
295
306
|
const hooks = await hooksFor(call);
|
|
307
|
+
if (readNeedsOperatorSql(session.schema, call) || hooks?.needsOperator(session.schema, call)) {
|
|
308
|
+
await loadOperatorSql();
|
|
309
|
+
}
|
|
310
|
+
if (call.build === undefined && selectHasWindow(call.select)) {
|
|
311
|
+
call = (await import("./gzaveazc.js")).attach(session.schema, call);
|
|
312
|
+
}
|
|
296
313
|
const bound = bindCall(session.schema, call, hooks);
|
|
297
314
|
let plan = session.cache.get(bound.key);
|
|
298
315
|
if (plan === undefined) {
|
|
@@ -307,7 +324,7 @@ function readHandle(session, table, call, mods, decode, extra) {
|
|
|
307
324
|
prepared = { plan, params: bound.params };
|
|
308
325
|
return prepared;
|
|
309
326
|
};
|
|
310
|
-
const sync = () => call.include === undefined && mods.uses === undefined && !readNeedsOperatorSql(session.schema, call);
|
|
327
|
+
const sync = () => !searched && call.include === undefined && mods.uses === undefined && !selectHasWindow(call.select) && !readNeedsOperatorSql(session.schema, call);
|
|
311
328
|
const run = async () => {
|
|
312
329
|
await session.connected;
|
|
313
330
|
const { plan, params } = await prepare();
|
|
@@ -352,10 +369,10 @@ function readHandle(session, table, call, mods, decode, extra) {
|
|
|
352
369
|
...extra?.(prepare)
|
|
353
370
|
});
|
|
354
371
|
}
|
|
355
|
-
function streamLazy(session, call,
|
|
372
|
+
function streamLazy(session, call, mods, view, batch) {
|
|
356
373
|
return async function* () {
|
|
357
|
-
const { streamRows } = await import("./
|
|
358
|
-
yield* streamRows(session, call,
|
|
374
|
+
const { streamRows } = await import("./cn957f8d.js");
|
|
375
|
+
yield* streamRows(session, call, mods, view, batch, (error) => logged(session, error));
|
|
359
376
|
}();
|
|
360
377
|
}
|
|
361
378
|
function archiveRecord(model, view) {
|
|
@@ -368,12 +385,7 @@ function archiveRecord(model, view) {
|
|
|
368
385
|
}
|
|
369
386
|
function readCall(op, table, options, all, scope, model, schema, view) {
|
|
370
387
|
const record = options;
|
|
371
|
-
|
|
372
|
-
for (const key of Object.keys(record)) {
|
|
373
|
-
if (!accepted.includes(key)) {
|
|
374
|
-
throwNamed2("OKM1120", key, accepted, `Option ${key} is not accepted by ${op}. Accepted options: ${accepted.join(", ")}.`);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
388
|
+
rejectKeys(record, readOptionNames(op), op, true);
|
|
377
389
|
return {
|
|
378
390
|
op,
|
|
379
391
|
table,
|
|
@@ -382,6 +394,7 @@ function readCall(op, table, options, all, scope, model, schema, view) {
|
|
|
382
394
|
...record.orderBy !== undefined ? { orderBy: record.orderBy } : {},
|
|
383
395
|
...record.limit !== undefined ? { limit: record.limit } : {},
|
|
384
396
|
...record.include !== undefined ? { include: record.include } : {},
|
|
397
|
+
..."search" in record ? { search: record.search } : {},
|
|
385
398
|
...callOptions(record),
|
|
386
399
|
...all !== undefined ? { all } : {},
|
|
387
400
|
...scope !== undefined ? { scope } : {},
|
|
@@ -391,14 +404,14 @@ function readCall(op, table, options, all, scope, model, schema, view) {
|
|
|
391
404
|
};
|
|
392
405
|
}
|
|
393
406
|
async function checkServer(pool, schema, http, requireMeta, options, source) {
|
|
394
|
-
const server = await import("./
|
|
407
|
+
const server = await import("./ttsqgp4p.js");
|
|
395
408
|
let rows;
|
|
396
409
|
try {
|
|
397
410
|
const result = await pool.execute(server.versionQuery, undefined, options);
|
|
398
411
|
rows = result.rows;
|
|
399
412
|
} catch (error) {
|
|
400
|
-
const { mapPostgresError } = await import("./
|
|
401
|
-
throw mapPostgresError(error, mapOptions(http, false));
|
|
413
|
+
const { mapPostgresError } = await import("./63qtkrca.js");
|
|
414
|
+
throw mapPostgresError(error, mapOptions(http, false, schema));
|
|
402
415
|
}
|
|
403
416
|
await server.acceptServer(pool, schema, rows, http, requireMeta, options, source);
|
|
404
417
|
}
|
|
@@ -406,8 +419,8 @@ async function mapError(session, error) {
|
|
|
406
419
|
if (error instanceof OkmError2) {
|
|
407
420
|
return session.http === undefined ? error : new OkmError2(error.code, error.message, { ...errorFields(error), http: session.http });
|
|
408
421
|
}
|
|
409
|
-
const { mapPostgresError } = await import("./
|
|
410
|
-
return mapPostgresError(error, mapOptions(session.http, session.includeValues));
|
|
422
|
+
const { mapPostgresError } = await import("./63qtkrca.js");
|
|
423
|
+
return mapPostgresError(error, mapOptions(session.http, session.includeValues, session.schema));
|
|
411
424
|
}
|
|
412
425
|
function errorFields(error) {
|
|
413
426
|
return {
|
|
@@ -420,15 +433,18 @@ function errorFields(error) {
|
|
|
420
433
|
var includeHooks;
|
|
421
434
|
var operatorSql;
|
|
422
435
|
function loadOperatorSql() {
|
|
423
|
-
operatorSql ??= import("./
|
|
436
|
+
operatorSql ??= import("./xhfsfkgk.js").then(() => {
|
|
424
437
|
return;
|
|
425
438
|
});
|
|
426
439
|
return operatorSql;
|
|
427
440
|
}
|
|
441
|
+
function selectHasWindow(select) {
|
|
442
|
+
return Array.isArray(select) && select.some((item) => typeof item !== "string");
|
|
443
|
+
}
|
|
428
444
|
function hooksFor(call) {
|
|
429
445
|
if (call.include === undefined)
|
|
430
446
|
return Promise.resolve(undefined);
|
|
431
|
-
includeHooks ??= import("./
|
|
447
|
+
includeHooks ??= import("./dkxgzaqd.js").then((mod) => mod.includeHooks);
|
|
432
448
|
return includeHooks;
|
|
433
449
|
}
|
|
434
450
|
function bindNow(schema, call) {
|
|
@@ -461,18 +477,22 @@ function attachHttp(http, error) {
|
|
|
461
477
|
function callOptions(input, statement) {
|
|
462
478
|
const timeout = input.timeout ?? statement;
|
|
463
479
|
const route = input.route;
|
|
464
|
-
|
|
480
|
+
const pin = input.pin;
|
|
481
|
+
if (input.signal === undefined && timeout === undefined && route === undefined && pin === undefined) {
|
|
465
482
|
return;
|
|
483
|
+
}
|
|
466
484
|
return {
|
|
467
485
|
...input.signal !== undefined ? { signal: input.signal } : {},
|
|
468
486
|
...timeout !== undefined ? { timeout } : {},
|
|
469
|
-
...route !== undefined ? { route } : {}
|
|
487
|
+
...route !== undefined ? { route } : {},
|
|
488
|
+
...pin !== undefined ? { pin } : {}
|
|
470
489
|
};
|
|
471
490
|
}
|
|
472
|
-
function mapOptions(http, includeValues) {
|
|
491
|
+
function mapOptions(http, includeValues, schema) {
|
|
473
492
|
return {
|
|
474
493
|
...http !== undefined ? { http } : {},
|
|
475
|
-
...includeValues ? { includeValues: true } : {}
|
|
494
|
+
...includeValues ? { includeValues: true } : {},
|
|
495
|
+
schema
|
|
476
496
|
};
|
|
477
497
|
}
|
|
478
498
|
async function settleCall(session, error) {
|