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
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
open3,
|
|
6
6
|
seal2
|
|
7
|
-
} from "../../shared/
|
|
7
|
+
} from "../../shared/0j6qe91y.js";
|
|
8
8
|
import {
|
|
9
9
|
PGLITE_CAPABILITIES,
|
|
10
10
|
readCapability2,
|
|
11
11
|
hasCapability2
|
|
12
|
-
} from "../../shared/
|
|
12
|
+
} from "../../shared/mfvx6kjx.js";
|
|
13
13
|
import {
|
|
14
14
|
createClient
|
|
15
|
-
} from "../../shared/
|
|
15
|
+
} from "../../shared/xbvz446k.js";
|
|
16
16
|
|
|
17
17
|
// src/runtime/pg/pglite.ts
|
|
18
18
|
async function connect(target, options) {
|
|
19
19
|
if (typeof target === "object" && !isPool(target)) {
|
|
20
|
-
return import("../../shared/
|
|
20
|
+
return import("../../shared/ysdw2fg3.js").then((mod) => mod.default(target, options, open3));
|
|
21
21
|
}
|
|
22
22
|
const pool = isPool(target) ? seal2(target) : await open3({
|
|
23
23
|
...target !== undefined ? { dataDir: target } : {},
|
|
@@ -3,30 +3,30 @@ import {
|
|
|
3
3
|
} from "../../shared/cm3w0ywp.js";
|
|
4
4
|
import {
|
|
5
5
|
open2
|
|
6
|
-
} from "../../shared/
|
|
6
|
+
} from "../../shared/jvxcp1qk.js";
|
|
7
7
|
import {
|
|
8
8
|
POSTGRESJS_CAPABILITIES,
|
|
9
9
|
readCapability2,
|
|
10
10
|
hasCapability2
|
|
11
|
-
} from "../../shared/
|
|
11
|
+
} from "../../shared/mfvx6kjx.js";
|
|
12
12
|
import {
|
|
13
13
|
createClient
|
|
14
|
-
} from "../../shared/
|
|
14
|
+
} from "../../shared/xbvz446k.js";
|
|
15
15
|
|
|
16
16
|
// src/runtime/pg/postgresjs.ts
|
|
17
17
|
function connect(target, options) {
|
|
18
18
|
if (typeof target === "object" && !isPool(target)) {
|
|
19
|
-
return import("../../shared/
|
|
19
|
+
return import("../../shared/ysdw2fg3.js").then((mod) => mod.default(target, options, open2));
|
|
20
20
|
}
|
|
21
21
|
const owned = !isPool(target);
|
|
22
|
-
const pool =
|
|
22
|
+
const pool = owned ? open2({
|
|
23
23
|
url: target,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
24
|
+
max: options.max,
|
|
25
|
+
timeouts: options.timeouts,
|
|
26
|
+
prepared: options.prepared,
|
|
27
|
+
searchPath: options.searchPath,
|
|
28
|
+
ssl: options.ssl
|
|
29
|
+
}) : target;
|
|
30
30
|
return createClient(options.schema, pool, {
|
|
31
31
|
ownsPool: owned,
|
|
32
32
|
http: options.errors?.http,
|
|
@@ -15,20 +15,50 @@ import type { CatalogArtifact } from "./types.js";
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const versionQuery = "select current_setting('server_version_num'), version(), (select (xpath('//catalog_hash/text()', query_to_xml('select catalog_hash from okm_meta where id = ''head''', true, false, '')))[1]::text where to_regclass('okm_meta') is not null)";
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Startup query for the namespace `okm build` recorded.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* `public` returns {@link versionQuery}, the same string as before.
|
|
21
|
+
* Another namespace qualifies `okm_meta`. `to_regclass` still lets a
|
|
22
|
+
* database with no such table plan.
|
|
22
23
|
*
|
|
23
|
-
* @param
|
|
24
|
+
* @param namespace - Catalog schema. `public` is unqualified
|
|
25
|
+
* @returns The version, dialect, and hash query
|
|
26
|
+
*/
|
|
27
|
+
export declare function versionSql(namespace: string): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* History query used when the catalog hashes differ.
|
|
30
|
+
*
|
|
31
|
+
* `public` stays unqualified, so a search path still finds that table.
|
|
32
|
+
*
|
|
33
|
+
* @param namespace - Catalog schema. `public` is unqualified
|
|
34
|
+
* @returns The `okm_history` select
|
|
35
|
+
*/
|
|
36
|
+
export declare function historySql(namespace: string): Promise<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Namespace stored beside the catalog hash.
|
|
39
|
+
*
|
|
40
|
+
* A missing file means `public`. `okm build` writes the file only when
|
|
41
|
+
* `defineConfig({ namespace })` is not `public`.
|
|
42
|
+
*
|
|
43
|
+
* @param catalogDir - Directory `connect` was given, or the default `.okm`
|
|
44
|
+
* @returns The schema name
|
|
45
|
+
*/
|
|
46
|
+
export declare function recordedNamespace(catalogDir: string | undefined): Promise<string>;
|
|
47
|
+
/**
|
|
48
|
+
* Accepts the server row, or throws OKM1801, OKM1520, OKM1802, or OKM1803.
|
|
49
|
+
*
|
|
50
|
+
* The first statement reads `okm_meta` in the catalog namespace. A declared
|
|
51
|
+
* floor is the minimum. With no floor, the minimum is 15. A major below 15
|
|
52
|
+
* is refused when the schema is built.
|
|
53
|
+
*
|
|
54
|
+
* @param pool - Connection that runs the version query
|
|
24
55
|
* @param schema - Schema whose floor is the declared minimum
|
|
25
|
-
* @param rows - `server_version_num`, `version()`, and the `okm_meta` hash
|
|
26
56
|
* @param http - Status overrides from `connect`
|
|
27
57
|
* @param requireMeta - When true, a missing hash is OKM1520
|
|
28
58
|
* @param options - Signal and timeout for the compatibility read
|
|
29
59
|
* @param source - Trusted catalog used when the hash does not match
|
|
30
60
|
*/
|
|
31
|
-
export declare function acceptServer(pool: DriverPool, schema: QuerySchema,
|
|
61
|
+
export declare function acceptServer(pool: DriverPool, schema: QuerySchema, http: ErrorStatuses | undefined, requireMeta: boolean, options: ExecuteOptions | undefined, source: {
|
|
32
62
|
readonly catalog?: CatalogArtifact;
|
|
33
63
|
readonly catalogDir?: string;
|
|
34
64
|
}): Promise<void>;
|
|
@@ -2,6 +2,9 @@ import {
|
|
|
2
2
|
functionObject,
|
|
3
3
|
triggerObject
|
|
4
4
|
} from "../../shared/12z7aznj.js";
|
|
5
|
+
import {
|
|
6
|
+
quoteIdent2
|
|
7
|
+
} from "../../shared/fk9vef30.js";
|
|
5
8
|
import {
|
|
6
9
|
checkPresetNames,
|
|
7
10
|
duplicatePreset
|
|
@@ -21,14 +24,11 @@ import {
|
|
|
21
24
|
} from "../../shared/ecn8mfdq.js";
|
|
22
25
|
import {
|
|
23
26
|
snakeCase
|
|
24
|
-
} from "../../shared/
|
|
27
|
+
} from "../../shared/f9t9g54z.js";
|
|
25
28
|
import {
|
|
26
29
|
ColumnBuilder2,
|
|
27
30
|
retarget
|
|
28
31
|
} from "../../shared/606g0nbf.js";
|
|
29
|
-
import {
|
|
30
|
-
quoteIdent
|
|
31
|
-
} from "../../shared/sjk86yrx.js";
|
|
32
32
|
import {
|
|
33
33
|
definition,
|
|
34
34
|
unavailable
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
queryHandle,
|
|
42
42
|
attachHttp,
|
|
43
43
|
settleCall
|
|
44
|
-
} from "../../shared/
|
|
44
|
+
} from "../../shared/xbvz446k.js";
|
|
45
45
|
import {
|
|
46
46
|
installArchiveInspect,
|
|
47
47
|
indexes,
|
|
@@ -299,7 +299,7 @@ function timestampRecords(built) {
|
|
|
299
299
|
returns: "trigger",
|
|
300
300
|
language: "plpgsql",
|
|
301
301
|
volatility: "volatile",
|
|
302
|
-
body: `begin new.${
|
|
302
|
+
body: `begin new.${quoteIdent2(column)} = now(); return new; end`,
|
|
303
303
|
provenance: { origin: "trait", name: "timestamps" },
|
|
304
304
|
dependencies: []
|
|
305
305
|
}));
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "../../shared/w9ejzaqf.js";
|
|
4
4
|
import {
|
|
5
5
|
addSchemaHook
|
|
6
|
-
} from "../../shared/
|
|
6
|
+
} from "../../shared/qqm3ze6q.js";
|
|
7
7
|
import {
|
|
8
8
|
queryHandle
|
|
9
|
-
} from "../../shared/
|
|
9
|
+
} from "../../shared/xbvz446k.js";
|
|
10
10
|
import {
|
|
11
11
|
OkmError2
|
|
12
12
|
} from "../../shared/52szzakm.js";
|
package/dist/runtime/write.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type PreparedWrite = {
|
|
|
39
39
|
readonly statements: readonly Statement[];
|
|
40
40
|
readonly options: ExecuteOptions | undefined;
|
|
41
41
|
/** Set when `finish` can refuse a statement that already ran. `batch` refuses such a write (D183). */
|
|
42
|
-
readonly checked?: "restore" | "expect" | "parent";
|
|
42
|
+
readonly checked?: "restore" | "expect" | "parent" | "tree";
|
|
43
43
|
finish(results: readonly ExecuteResult[]): unknown;
|
|
44
44
|
/**
|
|
45
45
|
* More statements once the planned ones have run.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
noTimeout
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./tr64w5p0.js";
|
|
4
4
|
import {
|
|
5
5
|
PGLITE_CAPABILITIES,
|
|
6
6
|
driverErrors,
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
runCall,
|
|
12
12
|
EMPTY_NOTICES,
|
|
13
13
|
resultFrom
|
|
14
|
-
} from "./
|
|
14
|
+
} from "./mfvx6kjx.js";
|
|
15
15
|
|
|
16
16
|
// src/adapters/pg/pglite.ts
|
|
17
17
|
import { PGlite } from "@electric-sql/pglite";
|
|
18
18
|
async function open3(config = {}) {
|
|
19
|
-
const wire = await import("./
|
|
19
|
+
const wire = await import("./g89fmz5s.js");
|
|
20
20
|
const db = new PGlite({
|
|
21
21
|
dataDir: config.dataDir ?? "memory://",
|
|
22
22
|
parsers: wire.parsers,
|
|
@@ -67,7 +67,7 @@ async function open3(config = {}) {
|
|
|
67
67
|
return;
|
|
68
68
|
released = true;
|
|
69
69
|
try {
|
|
70
|
-
const { resetQueried } = await import("./
|
|
70
|
+
const { resetQueried } = await import("./pgsak1yw.js");
|
|
71
71
|
await resetQueried(session);
|
|
72
72
|
} finally {
|
|
73
73
|
slot.release();
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./cm3w0ywp.js";
|
|
5
5
|
import {
|
|
6
6
|
PgSession
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./jvxcp1qk.js";
|
|
8
8
|
import {
|
|
9
9
|
isConnectionLost
|
|
10
10
|
} from "./cnkky55j.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
runCall,
|
|
16
16
|
rowsFrom,
|
|
17
17
|
resultFrom
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./mfvx6kjx.js";
|
|
19
19
|
|
|
20
20
|
// src/adapters/pg/postgres-extra.ts
|
|
21
21
|
var RESET_ALL = "RESET ALL";
|
|
@@ -80,18 +80,12 @@ async function checkout2(pool, timeoutMs) {
|
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
async function describe2(sql, text, params) {
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
return {
|
|
86
|
-
columns: described.columns.map((column) => column.name),
|
|
87
|
-
parameterCount: described.types.length
|
|
88
|
-
};
|
|
83
|
+
const d = await sql.unsafe(text, asParams(params), { prepare: true }).describe();
|
|
84
|
+
return { columns: d.columns.map((c) => c.name), parameterCount: d.types.length };
|
|
89
85
|
}
|
|
90
86
|
async function* stream2(sql, text, params) {
|
|
91
|
-
const
|
|
92
|
-
for await (const chunk of pending.cursor(64)) {
|
|
87
|
+
for await (const chunk of sql.unsafe(text, asParams(params)).cursor(64))
|
|
93
88
|
yield rowsFrom(chunk);
|
|
94
|
-
}
|
|
95
89
|
}
|
|
96
90
|
function poolWaits(sql) {
|
|
97
91
|
const options = sql.options;
|
|
@@ -105,14 +99,14 @@ function poolWaits(sql) {
|
|
|
105
99
|
n.add(id);
|
|
106
100
|
if (n.size < options.max) {
|
|
107
101
|
queueMicrotask(() => {
|
|
108
|
-
for (const
|
|
109
|
-
|
|
102
|
+
for (const w of q)
|
|
103
|
+
w.a();
|
|
110
104
|
});
|
|
111
105
|
return;
|
|
112
106
|
}
|
|
113
107
|
n.clear();
|
|
114
|
-
for (const
|
|
115
|
-
|
|
108
|
+
for (const w of q)
|
|
109
|
+
w.s();
|
|
116
110
|
q.clear();
|
|
117
111
|
};
|
|
118
112
|
return options;
|
|
@@ -194,41 +188,40 @@ function reserveConnection(sql, acquireMs, counters, callMs) {
|
|
|
194
188
|
counters.waiting = Math.max(0, counters.waiting - 1);
|
|
195
189
|
};
|
|
196
190
|
return new Promise((resolve, reject) => {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
timer = setTimeout(() => {
|
|
200
|
-
if (settled)
|
|
201
|
-
return;
|
|
202
|
-
settled = true;
|
|
203
|
-
finish();
|
|
204
|
-
driverErrors().then((errors) => {
|
|
205
|
-
reject(errors.acquireTimeout());
|
|
206
|
-
});
|
|
207
|
-
}, acquireMs);
|
|
208
|
-
}
|
|
209
|
-
const ms = callMs !== undefined && callMs > 0 ? callMs : 0;
|
|
210
|
-
deadline(ms, () => sql.reserve(), sql).then((connection) => {
|
|
211
|
-
if (settled) {
|
|
212
|
-
resetConnection(connection, 0).catch(() => {
|
|
213
|
-
return;
|
|
214
|
-
}).finally(() => {
|
|
215
|
-
connection.release();
|
|
216
|
-
});
|
|
191
|
+
const timer = acquireMs === undefined ? undefined : setTimeout(() => {
|
|
192
|
+
if (settled)
|
|
217
193
|
return;
|
|
218
|
-
}
|
|
219
194
|
settled = true;
|
|
220
|
-
if (timer !== undefined)
|
|
221
|
-
clearTimeout(timer);
|
|
222
195
|
finish();
|
|
223
|
-
|
|
224
|
-
|
|
196
|
+
driverErrors().then((errors) => {
|
|
197
|
+
reject(errors.acquireTimeout());
|
|
198
|
+
});
|
|
199
|
+
}, acquireMs);
|
|
200
|
+
const done = (fn) => {
|
|
225
201
|
if (settled)
|
|
226
202
|
return;
|
|
227
203
|
settled = true;
|
|
228
204
|
if (timer !== undefined)
|
|
229
205
|
clearTimeout(timer);
|
|
230
206
|
finish();
|
|
231
|
-
|
|
207
|
+
fn();
|
|
208
|
+
};
|
|
209
|
+
deadline(callMs !== undefined && callMs > 0 ? callMs : 0, () => sql.reserve(), sql).then((connection) => {
|
|
210
|
+
if (settled) {
|
|
211
|
+
resetConnection(connection, 0).catch(() => {
|
|
212
|
+
return;
|
|
213
|
+
}).finally(() => {
|
|
214
|
+
connection.release();
|
|
215
|
+
});
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
done(() => {
|
|
219
|
+
resolve(connection);
|
|
220
|
+
});
|
|
221
|
+
}, (error) => {
|
|
222
|
+
done(() => {
|
|
223
|
+
mapFailure(error).then(reject);
|
|
224
|
+
});
|
|
232
225
|
});
|
|
233
226
|
});
|
|
234
227
|
}
|
|
@@ -237,25 +230,20 @@ async function resetConnection(sql, depth) {
|
|
|
237
230
|
await sql.unsafe("ROLLBACK").catch(() => {
|
|
238
231
|
return;
|
|
239
232
|
});
|
|
240
|
-
|
|
233
|
+
const clear = async () => {
|
|
241
234
|
await sql.unsafe(RESET_ALL);
|
|
242
235
|
await sql.unsafe(UNLOCK);
|
|
236
|
+
};
|
|
237
|
+
try {
|
|
238
|
+
await clear();
|
|
243
239
|
} catch {
|
|
244
240
|
await sql.unsafe("ROLLBACK").catch(() => {
|
|
245
241
|
return;
|
|
246
242
|
});
|
|
247
|
-
await
|
|
248
|
-
await sql.unsafe(UNLOCK);
|
|
243
|
+
await clear();
|
|
249
244
|
}
|
|
250
245
|
}
|
|
251
|
-
|
|
252
|
-
if (params === undefined)
|
|
253
|
-
return [];
|
|
254
|
-
return params;
|
|
255
|
-
}
|
|
256
|
-
function watchReserved2(sql, lost) {
|
|
257
|
-
arm(sql, lost);
|
|
258
|
-
}
|
|
246
|
+
var asParams = (params) => params ?? [];
|
|
259
247
|
function arm(sql, lost) {
|
|
260
248
|
const unsafe = sql.unsafe.bind(sql);
|
|
261
249
|
sql.unsafe = (text, params, options) => unsafe(text, params, {
|
|
@@ -268,19 +256,13 @@ function arm(sql, lost) {
|
|
|
268
256
|
}
|
|
269
257
|
});
|
|
270
258
|
}
|
|
259
|
+
var watchReserved2 = arm;
|
|
271
260
|
async function holdCheckout2(gate, checkout) {
|
|
272
261
|
try {
|
|
273
262
|
const connection = await checkout();
|
|
274
263
|
let released = false;
|
|
275
264
|
const release = connection.release.bind(connection);
|
|
276
|
-
connection.release = () =>
|
|
277
|
-
if (released)
|
|
278
|
-
return Promise.resolve();
|
|
279
|
-
released = true;
|
|
280
|
-
return release().finally(() => {
|
|
281
|
-
gate.leave();
|
|
282
|
-
});
|
|
283
|
-
};
|
|
265
|
+
connection.release = () => released ? Promise.resolve() : (released = true, release().finally(() => gate.leave()));
|
|
284
266
|
return connection;
|
|
285
267
|
} catch (error) {
|
|
286
268
|
gate.leave();
|
|
@@ -295,11 +277,9 @@ async function holdListener2(gate, start) {
|
|
|
295
277
|
if (stopped)
|
|
296
278
|
return;
|
|
297
279
|
stopped = true;
|
|
298
|
-
|
|
299
|
-
await stop();
|
|
300
|
-
} finally {
|
|
280
|
+
await stop().finally(() => {
|
|
301
281
|
gate.leave();
|
|
302
|
-
}
|
|
282
|
+
});
|
|
303
283
|
};
|
|
304
284
|
} catch (error) {
|
|
305
285
|
gate.leave();
|
|
@@ -307,36 +287,35 @@ async function holdListener2(gate, start) {
|
|
|
307
287
|
}
|
|
308
288
|
}
|
|
309
289
|
function watchQuery2(pending, watch, onAbort, ctx) {
|
|
290
|
+
const done = () => {
|
|
291
|
+
ctx.leave();
|
|
292
|
+
ctx.untrack(pending);
|
|
293
|
+
watch.signal.removeEventListener("abort", onAbort);
|
|
294
|
+
};
|
|
310
295
|
return pending.then((value) => {
|
|
311
|
-
|
|
296
|
+
done();
|
|
312
297
|
const why = watch.reason();
|
|
313
298
|
if (why === "timeout" || why === "cancelled")
|
|
314
299
|
return classify(why, watch);
|
|
315
300
|
ctx.note(ctx.text);
|
|
316
301
|
return resultFrom(value, ctx.notices.since(ctx.start));
|
|
317
302
|
}, (error) => {
|
|
318
|
-
|
|
303
|
+
done();
|
|
319
304
|
return classify(error, watch);
|
|
320
305
|
});
|
|
321
306
|
}
|
|
322
|
-
function finishWatch(pending, watch, onAbort, ctx) {
|
|
323
|
-
ctx.leave();
|
|
324
|
-
ctx.untrack(pending);
|
|
325
|
-
watch.signal.removeEventListener("abort", onAbort);
|
|
326
|
-
}
|
|
327
307
|
async function classify(error, watch) {
|
|
328
308
|
const errors = await driverErrors();
|
|
329
309
|
if (error instanceof errors.DriverError)
|
|
330
|
-
|
|
310
|
+
throw error;
|
|
331
311
|
const why = typeof error === "string" ? error : watch.reason();
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
return Promise.reject(errors.cancelled(typeof error === "string" ? undefined : error));
|
|
312
|
+
const cause = typeof error === "string" ? undefined : error;
|
|
313
|
+
if (why === "timeout")
|
|
314
|
+
throw errors.timedOut(cause);
|
|
315
|
+
if (why === "cancelled" || errors.errorField(error, "code") === "57014") {
|
|
316
|
+
throw errors.cancelled(cause);
|
|
338
317
|
}
|
|
339
|
-
|
|
318
|
+
throw errors.mapDriverError(error);
|
|
340
319
|
}
|
|
341
320
|
|
|
342
321
|
export { checkout2, describe2, stream2, runBatch2, watchReserved2, holdCheckout2, holdListener2, watchQuery2 };
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
open2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./jvxcp1qk.js";
|
|
4
4
|
import"./12z7aznj.js";
|
|
5
|
+
import"./fk9vef30.js";
|
|
5
6
|
import"./n442h54c.js";
|
|
6
7
|
import {
|
|
7
8
|
assertRoleHealth
|
|
8
|
-
} from "./
|
|
9
|
-
import"./
|
|
9
|
+
} from "./6xqvesa5.js";
|
|
10
|
+
import"./mz48rs74.js";
|
|
10
11
|
import {
|
|
11
12
|
errorDoc,
|
|
12
13
|
openProject
|
|
13
|
-
} from "./
|
|
14
|
+
} from "./wp7y8q3y.js";
|
|
14
15
|
import {
|
|
16
|
+
driverUrl,
|
|
15
17
|
omitManagedObjects,
|
|
16
18
|
sessionFailure,
|
|
17
19
|
finishQuiet,
|
|
18
20
|
assertTargetPolicy,
|
|
19
21
|
selectTarget
|
|
20
|
-
} from "./
|
|
21
|
-
import"./sjk86yrx.js";
|
|
22
|
+
} from "./bdekbvmt.js";
|
|
22
23
|
import {
|
|
23
24
|
OkmError2
|
|
24
25
|
} from "./52szzakm.js";
|
|
@@ -42,7 +43,7 @@ ${doc.fix}
|
|
|
42
43
|
if (opened.config.roles !== undefined) {
|
|
43
44
|
const target = selectTarget(opened.config, flags?.target);
|
|
44
45
|
assertTargetPolicy(target, "check", flags?.allowProtected ?? false);
|
|
45
|
-
const pool = open2({ url: target.url, max: 1 });
|
|
46
|
+
const pool = open2({ url: driverUrl(target.url), max: 1 });
|
|
46
47
|
try {
|
|
47
48
|
await assertRoleHealth(pool, opened.config.roles, objects);
|
|
48
49
|
} catch (error) {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./typ3vy7t.js";
|
|
9
9
|
import {
|
|
10
10
|
snakeCase
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./f9t9g54z.js";
|
|
12
12
|
import {
|
|
13
13
|
OkmError2
|
|
14
14
|
} from "./52szzakm.js";
|
|
@@ -85,7 +85,7 @@ function viewClient(name, columns, query, tenancy, refresh = "plain") {
|
|
|
85
85
|
}
|
|
86
86
|
function refreshHandle(session, name, mode) {
|
|
87
87
|
const concurrently = mode === "concurrently";
|
|
88
|
-
return () => lazyRefresh(() => import("./
|
|
88
|
+
return () => lazyRefresh(() => import("./ymenf259.js").then((mod) => mod.refreshView(session, name, concurrently)));
|
|
89
89
|
}
|
|
90
90
|
function lazyRefresh(run) {
|
|
91
91
|
let pending;
|