okmodel 0.8.0 → 0.9.1
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 +23 -1
- package/dist/adapters/pg/bunsql-extra.d.ts +5 -5
- package/dist/adapters/pg/bunsql.d.ts +6 -2
- package/dist/adapters/pg/nodepostgres.d.ts +16 -1
- package/dist/adapters/pg/postgres-extra.d.ts +3 -17
- package/dist/adapters/pg/postgresjs.d.ts +2 -1
- package/dist/contracts/driver.d.ts +3 -2
- package/dist/contracts/error.d.ts +1 -1
- package/dist/dialects/pg/errors.d.ts +2 -0
- package/dist/dialects/pg/ext/btree-gin.d.ts +26 -0
- package/dist/dialects/pg/ext/btree-gin.js +20 -0
- package/dist/dialects/pg/ext/btree-gist.d.ts +26 -0
- package/dist/dialects/pg/ext/btree-gist.js +20 -0
- package/dist/dialects/pg/ext/call.d.ts +53 -0
- package/dist/dialects/pg/ext/citext.js +1 -1
- package/dist/dialects/pg/ext/feature.d.ts +26 -0
- package/dist/dialects/pg/ext/fuzzystrmatch.d.ts +34 -0
- package/dist/dialects/pg/ext/fuzzystrmatch.js +33 -0
- package/dist/dialects/pg/ext/hstore.d.ts +41 -0
- package/dist/dialects/pg/ext/hstore.js +29 -0
- package/dist/dialects/pg/ext/index.d.ts +56 -0
- package/dist/dialects/pg/ext/index.js +1 -1
- package/dist/dialects/pg/ext/ltree.d.ts +41 -0
- package/dist/dialects/pg/ext/ltree.js +29 -0
- package/dist/dialects/pg/ext/pg-trgm.js +4 -13
- package/dist/dialects/pg/ext/pgcrypto.d.ts +33 -0
- package/dist/dialects/pg/ext/pgcrypto.js +33 -0
- package/dist/dialects/pg/ext/unaccent.d.ts +26 -0
- package/dist/dialects/pg/ext/unaccent.js +21 -0
- package/dist/dialects/pg/ext/using.d.ts +23 -0
- package/dist/dialects/pg/ext/versions.d.ts +36 -0
- package/dist/dialects/pg/external.d.ts +19 -0
- package/dist/dialects/pg/filters.d.ts +2 -2
- package/dist/dialects/pg/fn/index.js +5 -5
- package/dist/dialects/pg/index.d.ts +1 -0
- package/dist/dialects/pg/index.js +19 -14
- package/dist/dialects/pg/introspect.d.ts +12 -0
- package/dist/dialects/pg/view/index.js +7 -7
- package/dist/dialects/pg/view/scratch.d.ts +4 -1
- package/dist/runtime/artifact-file.d.ts +22 -0
- package/dist/runtime/client.d.ts +10 -0
- package/dist/runtime/drift-detail.d.ts +2 -1
- package/dist/runtime/drift.d.ts +3 -10
- package/dist/runtime/param-limit.d.ts +20 -0
- package/dist/runtime/pg/bun.js +4 -4
- package/dist/runtime/pg/neon.js +4 -4
- package/dist/runtime/pg/pg.js +4 -4
- package/dist/runtime/pg/pglite.js +4 -4
- package/dist/runtime/pg/postgresjs.js +11 -11
- package/dist/runtime/server-check.d.ts +36 -6
- package/dist/runtime/tenancy/index.js +1 -1
- package/dist/runtime/traits/index.js +6 -6
- package/dist/runtime/validate/index.js +2 -2
- package/dist/runtime/write.d.ts +1 -1
- package/dist/shared/{4m6hskg8.js → 0j6qe91y.js} +4 -4
- package/dist/shared/{6m78c8ss.js → 1h5h1rf5.js} +1 -1
- package/dist/shared/{4vbf83xx.js → 2vcnpf0n.js} +1 -1
- package/dist/shared/{qd9hhd8f.js → 3ap5hxvj.js} +2 -1
- package/dist/shared/{v1wad97q.js → 3d7a80fq.js} +1 -1
- package/dist/shared/{wcrheftc.js → 3dr444ny.js} +58 -79
- package/dist/shared/{hm5f8jby.js → 3vvpcphd.js} +8 -7
- package/dist/shared/{760ppr76.js → 4a3mmhhe.js} +2 -2
- package/dist/shared/{mkrn359n.js → 4pkz5nvw.js} +222 -39
- package/dist/shared/{agsfb86s.js → 4te76xc5.js} +4 -4
- package/dist/shared/{63f4ksbz.js → 60y4ahmw.js} +1 -1
- package/dist/shared/61bmrmhr.js +35 -0
- package/dist/shared/{bxas03mq.js → 63qjmhnp.js} +100 -17
- package/dist/shared/{g5yc06ka.js → 67w3kn71.js} +1 -1
- package/dist/shared/{jgqj11w4.js → 6f0z3hzh.js} +4 -0
- package/dist/shared/{njga14v4.js → 6vfvsdkt.js} +10 -8
- package/dist/shared/{kj9d8maq.js → 6xqvesa5.js} +1 -1
- package/dist/shared/8gdbty5v.js +665 -0
- package/dist/shared/{pan0370z.js → 8ma6drzr.js} +211 -30
- package/dist/shared/{mnvjvqyp.js → 8p2bgye0.js} +124 -32
- package/dist/shared/{mfedzr74.js → 8qwqrxed.js} +14 -6
- package/dist/shared/{hfqmpasr.js → 8v7vzpgt.js} +11 -8
- package/dist/shared/{7ghwamrf.js → 99qp9vtg.js} +1 -1
- package/dist/shared/{zgex00fd.js → ak61ye1f.js} +5 -5
- package/dist/shared/{dpc2r7rb.js → bdekbvmt.js} +218 -95
- package/dist/shared/{jebgrkeq.js → bxjq6xqv.js} +2 -2
- package/dist/shared/c7dqd3gk.js +1806 -0
- package/dist/shared/ddh72ym5.js +20 -0
- package/dist/shared/e1c55v04.js +10 -0
- package/dist/shared/{mtw6jz76.js → e275q7sd.js} +1 -1
- package/dist/shared/{k86n8vq3.js → ekhq3ytz.js} +1 -1
- package/dist/shared/esy4dyxe.js +17 -0
- package/dist/shared/{gcefca6p.js → f9t9g54z.js} +22 -9
- package/dist/shared/{sjk86yrx.js → fk9vef30.js} +84 -73
- package/dist/shared/fkjne6gx.js +8 -0
- package/dist/shared/{e8zyaqvj.js → fne90dvz.js} +4 -1
- package/dist/shared/{needfe47.js → g89fmz5s.js} +1 -1
- package/dist/shared/{m4xff2a6.js → ghqzdp94.js} +2 -2
- package/dist/shared/{n0jmpgj1.js → gr9sn4za.js} +1 -1
- package/dist/shared/{5mtf6cj3.js → gzgfsspx.js} +5 -2
- package/dist/shared/h9811jjm.js +17 -0
- package/dist/shared/{z581d7ny.js → hgt69zjf.js} +2 -2
- package/dist/shared/{35q0n9tz.js → jvxcp1qk.js} +71 -87
- package/dist/shared/k73e8n9d.js +136 -0
- package/dist/shared/{195pzzzz.js → kzgrcy8s.js} +12 -8
- package/dist/shared/kzgrnckd.js +29 -0
- package/dist/shared/{p3xbdcvt.js → mz48rs74.js} +68 -8
- package/dist/shared/{zbqbmmrp.js → n6je5b28.js} +13 -26
- package/dist/shared/{b6d6p0zc.js → ns35jqz0.js} +75 -49
- package/dist/shared/{n05z9nwz.js → nstwgzn8.js} +1 -1
- package/dist/{tooling/shared/08kemxjd.js → shared/pgsak1yw.js} +1 -1
- package/dist/shared/py2zrrm6.js +451 -0
- package/dist/shared/{9dr2qnx7.js → qqm3ze6q.js} +1 -1
- package/dist/shared/{wvdjznah.js → rcjm0yn7.js} +31 -38
- package/dist/shared/rged92v6.js +17 -0
- package/dist/shared/{jp36k7dp.js → rw4tpcd0.js} +81 -51
- package/dist/shared/{bsek72fg.js → s5qe47a6.js} +3 -0
- package/dist/shared/{1d9q9cv2.js → smxzjz60.js} +2 -2
- package/dist/shared/{wz2a78mp.js → th5rnaxw.js} +1 -1
- package/dist/{tooling/shared/rs1jb051.js → shared/tr64w5p0.js} +1 -1
- package/dist/shared/{14x60fbf.js → tyqapcgk.js} +73 -10
- package/dist/shared/vsna85qf.js +8 -0
- package/dist/shared/{63qtkrca.js → vy47ryqa.js} +55 -5
- package/dist/shared/{jx2m62cs.js → wbdh9qbg.js} +7 -5
- package/dist/shared/{f4jy1j7x.js → wp7y8q3y.js} +946 -105
- package/dist/shared/{16kvjebh.js → xbd9xs6p.js} +7 -26
- package/dist/shared/{bah9nbg3.js → xbvz446k.js} +18 -23
- package/dist/shared/{p5nh3r8q.js → y6tfjk9q.js} +2 -2
- package/dist/shared/{3bb7wsqt.js → ycnft340.js} +1 -1
- package/dist/shared/{z7s6fpxv.js → ymenf259.js} +1 -1
- package/dist/shared/{0wrea3jq.js → ysdw2fg3.js} +10 -2
- package/dist/shared/zecrwdk9.js +61 -0
- package/dist/shared/{3t6kw83m.js → zm2rzqba.js} +2 -1
- package/dist/tooling/cli.js +200 -50
- package/dist/tooling/driver-run.js +109 -343
- package/dist/tooling/github/comment.d.ts +56 -0
- package/dist/tooling/github/post-comment.d.ts +17 -0
- package/dist/tooling/migrate/apply.d.ts +17 -2
- package/dist/tooling/migrate/commands.d.ts +2 -1
- package/dist/tooling/migrate/config.d.ts +13 -0
- package/dist/tooling/migrate/drift.d.ts +12 -0
- package/dist/tooling/migrate/driver-url.d.ts +17 -0
- package/dist/tooling/migrate/export.d.ts +165 -0
- package/dist/tooling/migrate/ext-surface.d.ts +80 -0
- package/dist/tooling/migrate/ext.d.ts +31 -4
- package/dist/tooling/migrate/import-drizzle.d.ts +40 -0
- package/dist/tooling/migrate/index.d.ts +3 -0
- package/dist/tooling/migrate/index.js +57 -10
- package/dist/tooling/migrate/lint-rules.d.ts +18 -1
- package/dist/tooling/migrate/lint.d.ts +14 -1
- package/dist/tooling/migrate/place.d.ts +18 -0
- package/dist/tooling/migrate/plan-json.d.ts +65 -0
- package/dist/tooling/migrate/policy.d.ts +17 -5
- package/dist/tooling/migrate/pooler-probe.d.ts +23 -0
- package/dist/tooling/migrate/project.d.ts +10 -1
- package/dist/tooling/migrate/pull-emit.d.ts +98 -0
- package/dist/tooling/migrate/pull-routines.d.ts +126 -0
- package/dist/tooling/migrate/pull-verify.d.ts +26 -0
- package/dist/tooling/migrate/pull.d.ts +65 -0
- package/dist/tooling/migrate/reprint.d.ts +32 -0
- package/dist/tooling/migrate/runner.d.ts +24 -1
- package/dist/tooling/migrate/sandbox.d.ts +8 -2
- package/dist/tooling/migrate/schema-api.d.ts +43 -0
- package/dist/tooling/migrate/sql-lex.d.ts +18 -0
- package/dist/tooling/shared/{ppnnnvj8.js → 09a6vsys.js} +1 -1
- package/dist/tooling/shared/{7ae7rjmn.js → 0v9ptnxp.js} +8 -8
- package/dist/tooling/shared/{fb9k2qwd.js → 0wtzps9p.js} +11 -30
- package/dist/tooling/shared/{a6pp9d12.js → 0yhf1db4.js} +6 -6
- package/dist/tooling/shared/{dy672fz6.js → 19msgrsc.js} +2 -2
- package/dist/{shared/q0cqt2sp.js → tooling/shared/1fwfm5m3.js} +1 -1
- package/dist/tooling/shared/{f9mphxej.js → 2jdn09e2.js} +401 -24
- package/dist/tooling/shared/{jne7b93p.js → 2qrte2ct.js} +5 -5
- package/dist/tooling/shared/{5bvw2nev.js → 2v4nwnkb.js} +1 -1
- package/dist/tooling/shared/{spk1jg3r.js → 33z39trp.js} +106 -23
- package/dist/tooling/shared/{z8d7ptht.js → 353vnw9z.js} +5 -5
- package/dist/tooling/shared/{dw08f3m8.js → 390kry9g.js} +2 -2
- package/dist/tooling/shared/{xjs6zqtc.js → 3f6etb9z.js} +18 -31
- package/dist/{shared/bnby0esn.js → tooling/shared/3t2cqmsx.js} +1 -1
- package/dist/tooling/shared/{wwnekq5n.js → 4dzvjtpy.js} +1 -1
- package/dist/tooling/shared/{y5656f0e.js → 4ec0nxvw.js} +10 -10
- package/dist/tooling/shared/{3m1hkg7z.js → 4tg2bn41.js} +59 -78
- package/dist/tooling/shared/{zvnhh1n0.js → 5rah55z0.js} +2 -2
- package/dist/tooling/shared/{pqy21k24.js → 804w1t69.js} +4 -4
- package/dist/tooling/shared/8g0m0rvd.js +134 -0
- package/dist/tooling/shared/8msbtw5s.js +8 -0
- package/dist/tooling/shared/{4d2w25vw.js → 8t22h3h7.js} +2 -2
- package/dist/tooling/shared/{smn6kz1p.js → 91c59b7b.js} +2 -2
- package/dist/tooling/shared/{aftb2mwr.js → adk9k6va.js} +1 -1
- package/dist/tooling/shared/{j9t5s12a.js → ajjd5cwz.js} +2 -2
- package/dist/tooling/shared/{cmptmb4f.js → angjck01.js} +1 -1
- package/dist/tooling/shared/{yw30vnq2.js → asnnc3v5.js} +1 -1
- package/dist/tooling/shared/{ma2340rx.js → bj1kyqc8.js} +2 -2
- package/dist/tooling/shared/{2wtvc7rw.js → bt3tjemb.js} +11 -3
- package/dist/tooling/shared/{ec71zqgt.js → chk2bh4f.js} +2 -2
- package/dist/tooling/shared/{gmcf9cxf.js → ckq4z5ax.js} +5 -2
- package/dist/tooling/shared/{w7qe8sj1.js → d3rhb24q.js} +1 -1
- package/dist/tooling/shared/{y031jct9.js → d8q00vxg.js} +4 -4
- package/dist/tooling/shared/{vs0t6qt8.js → dx188rxs.js} +2 -2
- package/dist/tooling/shared/{g9ad4n80.js → efq6p9df.js} +35 -42
- package/dist/tooling/shared/{ddjtfgnx.js → en6rwzq0.js} +3 -3
- package/dist/tooling/shared/{6nyfyw70.js → f2r5g0fs.js} +2 -2
- package/dist/tooling/shared/{03k6res6.js → f4gep0nk.js} +1 -1
- package/dist/tooling/shared/{gfvtj6d0.js → f8a010fm.js} +13 -11
- package/dist/tooling/shared/{3tq8pnb8.js → fdsek6pa.js} +1 -1
- package/dist/tooling/shared/fvmrxsd1.js +8 -0
- package/dist/tooling/shared/{733a1tq3.js → g3xybeqf.js} +4 -3
- package/dist/tooling/shared/{pwsytxm5.js → gefmpwsa.js} +1 -1
- package/dist/tooling/shared/{mtrqn2hn.js → gjj71hfh.js} +25 -30
- package/dist/tooling/shared/{8sqrsw3s.js → jgzt69pa.js} +5 -5
- package/dist/tooling/shared/{nf7jmhfa.js → jm30k2ca.js} +10 -8
- package/dist/tooling/shared/{vx86qjv8.js → kayqzpbk.js} +6 -3
- package/dist/tooling/shared/{zhwnfyb2.js → kvw1672d.js} +1 -1
- package/dist/tooling/shared/{rq5kk8j6.js → mr1kcgpw.js} +3 -3
- package/dist/tooling/shared/{72fyg4zv.js → mwbdf409.js} +1 -1
- package/dist/tooling/shared/{wt7j7nf6.js → ns9207v3.js} +1 -1
- package/dist/tooling/shared/{9xzm7hjg.js → p6tjv97k.js} +3 -3
- package/dist/tooling/shared/{yfr8hzhm.js → p73evwf0.js} +1 -1
- package/dist/tooling/shared/{dzx85q70.js → phc1nc4g.js} +1 -1
- package/dist/tooling/shared/{417zdsk7.js → ppybjw50.js} +79 -16
- package/dist/tooling/shared/{yk9mp7vb.js → qdrn8ghn.js} +5 -4
- package/dist/tooling/shared/rd8h01ta.js +20 -0
- package/dist/tooling/shared/{bz2dqhab.js → rwg8y90m.js} +3 -3
- package/dist/tooling/shared/{xhrnjch9.js → ry2f3w8p.js} +3 -3
- package/dist/tooling/shared/{a7q7t4n3.js → ryc5sa58.js} +8 -8
- package/dist/tooling/shared/{2revefqt.js → ss87qxwv.js} +2 -2
- package/dist/tooling/shared/{rf83gr2d.js → vg68k11z.js} +7 -3
- package/dist/tooling/shared/{p7f08ktn.js → vms9dta5.js} +73 -89
- package/dist/tooling/shared/{3rrw5w8f.js → xchpnbdv.js} +1 -1
- package/dist/tooling/shared/{djydjpqt.js → xn6p01fh.js} +5 -5
- package/dist/tooling/shared/{9kazs5p6.js → xwr6q618.js} +3 -3
- package/dist/tooling/shared/{ep8zh3bk.js → xx3gmq94.js} +1 -1
- package/dist/tooling/shared/{tn8gay14.js → y2bd7yfx.js} +21 -13
- package/dist/tooling/shared/{vraj6d74.js → y4gq9rbe.js} +11 -11
- package/dist/tooling/shared/y4vwft92.js +9 -0
- package/dist/tooling/shared/{345tbc2k.js → yz68xcmc.js} +1 -1
- package/dist/tooling/testing/factories.d.ts +1 -3
- package/dist/tooling/testing/index.js +2 -2
- package/package.json +39 -9
- package/dist/shared/3449rcae.js +0 -14
- package/dist/shared/fjpnhqan.js +0 -71
- package/dist/shared/n41w4fbz.js +0 -113
- package/dist/tooling/shared/pw8fgahx.js +0 -69
- /package/dist/shared/{ae4j5f42.js → mfvx6kjx.js} +0 -0
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catalogFileText2
|
|
3
3
|
} from "./12z7aznj.js";
|
|
4
|
+
import {
|
|
5
|
+
artifactDir,
|
|
6
|
+
readText
|
|
7
|
+
} from "./k73e8n9d.js";
|
|
4
8
|
import {
|
|
5
9
|
OkmError2
|
|
6
10
|
} from "./52szzakm.js";
|
|
7
11
|
|
|
8
12
|
// src/runtime/drift.ts
|
|
9
|
-
async function assertCompatible(pool, schema, recordedHash, source, options) {
|
|
13
|
+
async function assertCompatible(pool, schema, recordedHash, source, options, namespace = "public") {
|
|
10
14
|
const code = await codeHash(schema, source);
|
|
11
15
|
if (code.hash === recordedHash)
|
|
12
16
|
return;
|
|
@@ -32,8 +36,8 @@ async function assertCompatible(pool, schema, recordedHash, source, options) {
|
|
|
32
36
|
loadTrustedCatalog(text, code.hash);
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
|
-
const { assertDrift } = await import("./
|
|
36
|
-
await assertDrift(pool, code.hash, recordedHash, options);
|
|
39
|
+
const { assertDrift } = await import("./gzgfsspx.js");
|
|
40
|
+
await assertDrift(pool, code.hash, recordedHash, options, namespace);
|
|
37
41
|
}
|
|
38
42
|
async function codeHash(schema, source) {
|
|
39
43
|
if (source.catalog !== undefined) {
|
|
@@ -63,29 +67,6 @@ async function readHashFile(catalogDir) {
|
|
|
63
67
|
const hash = catalogFileText2(text, "catalog.hash").trim();
|
|
64
68
|
return hash.length === 0 ? undefined : hash;
|
|
65
69
|
}
|
|
66
|
-
function artifactDir(catalogDir) {
|
|
67
|
-
if (catalogDir !== undefined)
|
|
68
|
-
return catalogDir.replace(/[/\\]+$/, "");
|
|
69
|
-
const cwd = globalThis.process?.cwd?.() ?? ".";
|
|
70
|
-
return `${cwd}/.okm`;
|
|
71
|
-
}
|
|
72
|
-
async function readText(path) {
|
|
73
|
-
const bun = globalThis.Bun;
|
|
74
|
-
if (bun !== undefined) {
|
|
75
|
-
const file = bun.file(path);
|
|
76
|
-
if (!await file.exists())
|
|
77
|
-
return;
|
|
78
|
-
return file.text();
|
|
79
|
-
}
|
|
80
|
-
const loader = globalThis.process?.getBuiltinModule;
|
|
81
|
-
if (loader === undefined)
|
|
82
|
-
return;
|
|
83
|
-
try {
|
|
84
|
-
return await loader("node:fs/promises").readFile(path, "utf8");
|
|
85
|
-
} catch {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
70
|
export {
|
|
90
71
|
assertCompatible
|
|
91
72
|
};
|
|
@@ -86,7 +86,7 @@ function openClient(session) {
|
|
|
86
86
|
},
|
|
87
87
|
close,
|
|
88
88
|
connected: session.connected,
|
|
89
|
-
tx: (...args) => import("./
|
|
89
|
+
tx: (...args) => import("./3d7a80fq.js").then((mod) => mod.tx(session, args)),
|
|
90
90
|
batch: (ops, options) => batchHandle(session, ops, options),
|
|
91
91
|
...session.tx?.extras
|
|
92
92
|
};
|
|
@@ -121,7 +121,7 @@ function tableApi(session, table, view, uses) {
|
|
|
121
121
|
const api = {
|
|
122
122
|
find(options = {}) {
|
|
123
123
|
if ("lock" in options) {
|
|
124
|
-
return lazyRead(session, () => import("./
|
|
124
|
+
return lazyRead(session, () => import("./ekhq3ytz.js"), table, options, base, view);
|
|
125
125
|
}
|
|
126
126
|
return start(session, "find", table, options, base, view);
|
|
127
127
|
},
|
|
@@ -135,10 +135,10 @@ function tableApi(session, table, view, uses) {
|
|
|
135
135
|
return start(session, "exists", table, options, base, view);
|
|
136
136
|
},
|
|
137
137
|
page(options) {
|
|
138
|
-
return lazyRead(session, () => import("./
|
|
138
|
+
return lazyRead(session, () => import("./1h5h1rf5.js"), table, options, base, view);
|
|
139
139
|
},
|
|
140
140
|
aggregate(options = {}) {
|
|
141
|
-
return lazyRead(session, () => import("./
|
|
141
|
+
return lazyRead(session, () => import("./nstwgzn8.js"), table, options, base, view);
|
|
142
142
|
},
|
|
143
143
|
insert(data, options = {}) {
|
|
144
144
|
return writeHandle(session, "insert", table, data, options, mods);
|
|
@@ -151,9 +151,9 @@ function tableApi(session, table, view, uses) {
|
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
for (const walk of ["descendants", "ancestors"]) {
|
|
154
|
-
api[walk] = (id, options) => lazyRead(session, () => import("./
|
|
154
|
+
api[walk] = (id, options) => lazyRead(session, () => import("./th5rnaxw.js"), table, { id, walk, options }, base, view);
|
|
155
155
|
}
|
|
156
|
-
api.sync = (id, relation, ids, options) => lazyRead(session, () => import("./
|
|
156
|
+
api.sync = (id, relation, ids, options) => lazyRead(session, () => import("./y6tfjk9q.js"), table, { id, relation, ids, options }, base, view, true);
|
|
157
157
|
const hooks = session.schema.hooks;
|
|
158
158
|
if (hooks !== undefined) {
|
|
159
159
|
for (const hook of hooks) {
|
|
@@ -173,13 +173,13 @@ function tableApi(session, table, view, uses) {
|
|
|
173
173
|
return api;
|
|
174
174
|
}
|
|
175
175
|
function batchHandle(session, ops, options, replica) {
|
|
176
|
-
return queryHandle(() => import("./
|
|
176
|
+
return queryHandle(() => import("./fne90dvz.js").then((mod) => mod.batch(session, ops, options, replica)), {
|
|
177
177
|
replica: () => batchHandle(session, ops, options, true)
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
var writers;
|
|
181
181
|
function loadWrite() {
|
|
182
|
-
writers ??= import("./
|
|
182
|
+
writers ??= import("./3ap5hxvj.js");
|
|
183
183
|
return writers;
|
|
184
184
|
}
|
|
185
185
|
function queryHandle(run, extra) {
|
|
@@ -309,7 +309,7 @@ function readHandle(session, table, call, mods, decode, extra) {
|
|
|
309
309
|
await loadOperatorSql();
|
|
310
310
|
}
|
|
311
311
|
if (call.build === undefined && selectHasWindow(call.select)) {
|
|
312
|
-
call = (await import("./
|
|
312
|
+
call = (await import("./smxzjz60.js")).attach(session.schema, call);
|
|
313
313
|
}
|
|
314
314
|
const bound = bindCall(session.schema, call, hooks);
|
|
315
315
|
let plan = session.cache.get(bound.key);
|
|
@@ -329,6 +329,9 @@ function readHandle(session, table, call, mods, decode, extra) {
|
|
|
329
329
|
const run = async () => {
|
|
330
330
|
await session.connected;
|
|
331
331
|
const { plan, params } = await prepare();
|
|
332
|
+
if (params.length > 65535) {
|
|
333
|
+
(await import("./fkjne6gx.js")).refuseParamLimit(params.length);
|
|
334
|
+
}
|
|
332
335
|
try {
|
|
333
336
|
const result = await session.pool.execute(plan.text, params, callOptions(call, session.timeouts?.statement));
|
|
334
337
|
if (session.hookm && result.notices.length) {
|
|
@@ -372,7 +375,7 @@ function readHandle(session, table, call, mods, decode, extra) {
|
|
|
372
375
|
}
|
|
373
376
|
function streamLazy(session, call, mods, view, batch) {
|
|
374
377
|
return async function* () {
|
|
375
|
-
const { streamRows } = await import("./
|
|
378
|
+
const { streamRows } = await import("./bxjq6xqv.js");
|
|
376
379
|
yield* streamRows(session, call, mods, view, batch, (error) => logged(session, error));
|
|
377
380
|
}();
|
|
378
381
|
}
|
|
@@ -405,22 +408,14 @@ function readCall(op, table, options, all, scope, model, schema, view) {
|
|
|
405
408
|
};
|
|
406
409
|
}
|
|
407
410
|
async function checkServer(pool, schema, http, requireMeta, options, source) {
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
try {
|
|
411
|
-
const result = await pool.execute(server.versionQuery, undefined, options);
|
|
412
|
-
rows = result.rows;
|
|
413
|
-
} catch (error) {
|
|
414
|
-
const { mapPostgresError } = await import("./63qtkrca.js");
|
|
415
|
-
throw mapPostgresError(error, mapOptions(http, false, schema));
|
|
416
|
-
}
|
|
417
|
-
await server.acceptServer(pool, schema, rows, http, requireMeta, options, source);
|
|
411
|
+
const { acceptServer } = await import("./vsna85qf.js");
|
|
412
|
+
await acceptServer(pool, schema, http, requireMeta, options, source);
|
|
418
413
|
}
|
|
419
414
|
async function mapError(session, error) {
|
|
420
415
|
if (error instanceof OkmError2) {
|
|
421
416
|
return session.http === undefined ? error : new OkmError2(error.code, error.message, { ...errorFields(error), http: session.http });
|
|
422
417
|
}
|
|
423
|
-
const { mapPostgresError } = await import("./
|
|
418
|
+
const { mapPostgresError } = await import("./vy47ryqa.js");
|
|
424
419
|
return mapPostgresError(error, mapOptions(session.http, session.includeValues, session.schema));
|
|
425
420
|
}
|
|
426
421
|
function errorFields(error) {
|
|
@@ -434,7 +429,7 @@ function errorFields(error) {
|
|
|
434
429
|
var includeHooks;
|
|
435
430
|
var operatorSql;
|
|
436
431
|
function loadOperatorSql() {
|
|
437
|
-
operatorSql ??= import("./
|
|
432
|
+
operatorSql ??= import("./2vcnpf0n.js").then(() => {
|
|
438
433
|
return;
|
|
439
434
|
});
|
|
440
435
|
return operatorSql;
|
|
@@ -504,4 +499,4 @@ function logged(session, error) {
|
|
|
504
499
|
return error;
|
|
505
500
|
}
|
|
506
501
|
|
|
507
|
-
export { createClient, openClient, queryHandle, decodeRows, readHandle, readCall, withHttp, attachHttp, settleCall };
|
|
502
|
+
export { createClient, openClient, queryHandle, decodeRows, readHandle, readCall, withHttp, attachHttp, mapOptions, settleCall };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
identityColumn2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./67w3kn71.js";
|
|
4
4
|
import {
|
|
5
5
|
runWrite
|
|
6
6
|
} from "./n4jqhpqz.js";
|
|
7
7
|
import {
|
|
8
8
|
queryHandle,
|
|
9
9
|
settleCall
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./xbvz446k.js";
|
|
11
11
|
import {
|
|
12
12
|
withRowFilters,
|
|
13
13
|
archiveRules,
|
|
@@ -39,7 +39,7 @@ async function refreshView(session, name, concurrently) {
|
|
|
39
39
|
throw error;
|
|
40
40
|
}
|
|
41
41
|
} catch (error) {
|
|
42
|
-
const { mapPostgresError } = await import("./
|
|
42
|
+
const { mapPostgresError } = await import("./vy47ryqa.js");
|
|
43
43
|
const mapped = mapPostgresError(error, {
|
|
44
44
|
...host.http !== undefined ? { http: host.http } : {},
|
|
45
45
|
...host.includeValues === true ? { includeValues: true } : {},
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./cnkky55j.js";
|
|
5
5
|
import {
|
|
6
6
|
createClient
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./xbvz446k.js";
|
|
8
8
|
import {
|
|
9
9
|
OkmError2
|
|
10
10
|
} from "./52szzakm.js";
|
|
@@ -1168,7 +1168,15 @@ function fromSelect(handle, select, candidates) {
|
|
|
1168
1168
|
lag: byteLagNumber(handle, endpoint)
|
|
1169
1169
|
});
|
|
1170
1170
|
}
|
|
1171
|
-
|
|
1171
|
+
let returned;
|
|
1172
|
+
try {
|
|
1173
|
+
returned = select(offered, { op: "read" });
|
|
1174
|
+
} catch (error) {
|
|
1175
|
+
if (error instanceof OkmError2)
|
|
1176
|
+
throw error;
|
|
1177
|
+
const message = error instanceof Error ? error.message : "routing.select threw.";
|
|
1178
|
+
throw new OkmError2("invalid", message, { kind: "invalid", cause: error });
|
|
1179
|
+
}
|
|
1172
1180
|
if (typeof returned === "string") {
|
|
1173
1181
|
const endpoint = endpoints.find((item) => item.name === returned);
|
|
1174
1182
|
if (endpoint !== undefined)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
quotedIdent
|
|
3
|
+
} from "./h9811jjm.js";
|
|
4
|
+
import {
|
|
5
|
+
sqlExpression
|
|
6
|
+
} from "./s5qe47a6.js";
|
|
7
|
+
import {
|
|
8
|
+
OkmError2
|
|
9
|
+
} from "./52szzakm.js";
|
|
10
|
+
|
|
11
|
+
// src/dialects/pg/ext/call.ts
|
|
12
|
+
function fnEqualsArg(schema, name, value) {
|
|
13
|
+
const fn = `${quotedIdent(schema)}.${quotedIdent(name)}`;
|
|
14
|
+
return sqlExpression([
|
|
15
|
+
{ k: "t", s: `${fn}(` },
|
|
16
|
+
{ k: "c" },
|
|
17
|
+
{ k: "t", s: `) = ${fn}(` },
|
|
18
|
+
{ k: "p", v: value },
|
|
19
|
+
{ k: "t", s: ")" }
|
|
20
|
+
], true);
|
|
21
|
+
}
|
|
22
|
+
function fnDistance(schema, name, value, distance) {
|
|
23
|
+
if (!Number.isInteger(distance)) {
|
|
24
|
+
throw new OkmError2("OKM1120", `${name} distance must be an integer.`, {
|
|
25
|
+
fix: { summary: "Pass a whole number of edits." }
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const fn = `${quotedIdent(schema)}.${quotedIdent(name)}`;
|
|
29
|
+
return sqlExpression([
|
|
30
|
+
{ k: "t", s: `${fn}(` },
|
|
31
|
+
{ k: "c" },
|
|
32
|
+
{ k: "t", s: ", " },
|
|
33
|
+
{ k: "p", v: value },
|
|
34
|
+
{ k: "t", s: ") = " },
|
|
35
|
+
{ k: "p", v: String(distance) },
|
|
36
|
+
{ k: "t", s: "::integer" }
|
|
37
|
+
], true);
|
|
38
|
+
}
|
|
39
|
+
function opArg(op, value, cast) {
|
|
40
|
+
const parts = [{ k: "c" }, { k: "t", s: ` ${op} ` }, { k: "p", v: value }];
|
|
41
|
+
if (cast !== undefined)
|
|
42
|
+
parts.push({ k: "t", s: `::${cast}` });
|
|
43
|
+
return sqlExpression(parts, true);
|
|
44
|
+
}
|
|
45
|
+
function bareCall(schema, name) {
|
|
46
|
+
const fn = `${quotedIdent(schema)}.${quotedIdent(name)}`;
|
|
47
|
+
return sqlExpression([{ k: "t", s: `${fn}()` }], true);
|
|
48
|
+
}
|
|
49
|
+
function digestEquals(schema, algorithm, hex) {
|
|
50
|
+
const fn = `${quotedIdent(schema)}.${quotedIdent("digest")}`;
|
|
51
|
+
return sqlExpression([
|
|
52
|
+
{ k: "t", s: `encode(${fn}(` },
|
|
53
|
+
{ k: "c" },
|
|
54
|
+
{ k: "t", s: ", " },
|
|
55
|
+
{ k: "p", v: algorithm },
|
|
56
|
+
{ k: "t", s: "), 'hex') = " },
|
|
57
|
+
{ k: "p", v: hex }
|
|
58
|
+
], true);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { fnEqualsArg, fnDistance, opArg, bareCall, digestEquals };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
stack2
|
|
3
3
|
} from "./mss6ctgv.js";
|
|
4
|
+
import"./ddh72ym5.js";
|
|
4
5
|
import {
|
|
5
6
|
updateSliceBody2,
|
|
6
7
|
rejectDuplicateTargets2,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
expectOf2,
|
|
16
17
|
allowSet2,
|
|
17
18
|
noteGuarded2
|
|
18
|
-
} from "./
|
|
19
|
+
} from "./63qjmhnp.js";
|
|
19
20
|
import {
|
|
20
21
|
emitWhere,
|
|
21
22
|
projectExpr,
|