okmodel 0.8.0 → 0.9.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.
Files changed (202) hide show
  1. package/README.md +14 -0
  2. package/dist/dialects/pg/ext/btree-gin.d.ts +26 -0
  3. package/dist/dialects/pg/ext/btree-gin.js +20 -0
  4. package/dist/dialects/pg/ext/btree-gist.d.ts +26 -0
  5. package/dist/dialects/pg/ext/btree-gist.js +20 -0
  6. package/dist/dialects/pg/ext/call.d.ts +53 -0
  7. package/dist/dialects/pg/ext/citext.js +1 -1
  8. package/dist/dialects/pg/ext/feature.d.ts +26 -0
  9. package/dist/dialects/pg/ext/fuzzystrmatch.d.ts +34 -0
  10. package/dist/dialects/pg/ext/fuzzystrmatch.js +33 -0
  11. package/dist/dialects/pg/ext/hstore.d.ts +41 -0
  12. package/dist/dialects/pg/ext/hstore.js +29 -0
  13. package/dist/dialects/pg/ext/index.d.ts +56 -0
  14. package/dist/dialects/pg/ext/index.js +1 -1
  15. package/dist/dialects/pg/ext/ltree.d.ts +41 -0
  16. package/dist/dialects/pg/ext/ltree.js +29 -0
  17. package/dist/dialects/pg/ext/pg-trgm.js +4 -13
  18. package/dist/dialects/pg/ext/pgcrypto.d.ts +33 -0
  19. package/dist/dialects/pg/ext/pgcrypto.js +33 -0
  20. package/dist/dialects/pg/ext/unaccent.d.ts +26 -0
  21. package/dist/dialects/pg/ext/unaccent.js +21 -0
  22. package/dist/dialects/pg/ext/using.d.ts +23 -0
  23. package/dist/dialects/pg/ext/versions.d.ts +36 -0
  24. package/dist/dialects/pg/external.d.ts +19 -0
  25. package/dist/dialects/pg/fn/index.js +4 -4
  26. package/dist/dialects/pg/index.d.ts +1 -0
  27. package/dist/dialects/pg/index.js +16 -11
  28. package/dist/dialects/pg/view/index.js +5 -5
  29. package/dist/dialects/pg/view/scratch.d.ts +4 -1
  30. package/dist/runtime/artifact-file.d.ts +22 -0
  31. package/dist/runtime/client.d.ts +10 -0
  32. package/dist/runtime/drift-detail.d.ts +2 -1
  33. package/dist/runtime/drift.d.ts +3 -10
  34. package/dist/runtime/pg/bun.js +4 -4
  35. package/dist/runtime/pg/neon.js +4 -4
  36. package/dist/runtime/pg/pg.js +4 -4
  37. package/dist/runtime/pg/pglite.js +4 -4
  38. package/dist/runtime/pg/postgresjs.js +4 -4
  39. package/dist/runtime/server-check.d.ts +36 -6
  40. package/dist/runtime/traits/index.js +5 -5
  41. package/dist/runtime/validate/index.js +1 -1
  42. package/dist/shared/{4m6hskg8.js → 0j6qe91y.js} +4 -4
  43. package/dist/shared/{14x60fbf.js → 1mxm04fy.js} +5 -5
  44. package/dist/shared/{b6d6p0zc.js → 2szgv6yj.js} +5 -5
  45. package/dist/shared/{f4jy1j7x.js → 2zdxkt7b.js} +909 -100
  46. package/dist/shared/{mnvjvqyp.js → 3456242y.js} +17 -17
  47. package/dist/shared/3t6kw83m.js +1 -1
  48. package/dist/shared/{6m78c8ss.js → 5kyb3tqx.js} +1 -1
  49. package/dist/shared/61bmrmhr.js +35 -0
  50. package/dist/shared/{zbqbmmrp.js → 62b603gr.js} +8 -8
  51. package/dist/shared/{jgqj11w4.js → 6f0z3hzh.js} +4 -0
  52. package/dist/shared/{dpc2r7rb.js → 6nae0spm.js} +150 -89
  53. package/dist/shared/{0wrea3jq.js → 71n0jmhc.js} +1 -1
  54. package/dist/shared/7ba5h6pb.js +17 -0
  55. package/dist/shared/{k86n8vq3.js → 8jesqsrk.js} +1 -1
  56. package/dist/shared/{qd9hhd8f.js → 8n688yjg.js} +1 -1
  57. package/dist/shared/{zgex00fd.js → 8qzkd9f3.js} +5 -5
  58. package/dist/shared/{mkrn359n.js → 90sg0w5a.js} +159 -31
  59. package/dist/shared/{7ghwamrf.js → 99qp9vtg.js} +1 -1
  60. package/dist/shared/{bxas03mq.js → 9dtgn1z2.js} +1 -1
  61. package/dist/shared/{p5nh3r8q.js → aksb89mn.js} +2 -2
  62. package/dist/shared/{wcrheftc.js → bphrgwz9.js} +2 -2
  63. package/dist/shared/{wz2a78mp.js → c3mvnq7a.js} +1 -1
  64. package/dist/shared/{pan0370z.js → ccsmhv9r.js} +24 -6
  65. package/dist/shared/{n0jmpgj1.js → cexb7z6b.js} +1 -1
  66. package/dist/shared/{wvdjznah.js → cf8zdz5p.js} +5 -5
  67. package/dist/shared/{3449rcae.js → ckz05z15.js} +4 -4
  68. package/dist/shared/{35q0n9tz.js → dd5pmnky.js} +7 -7
  69. package/dist/shared/{e8zyaqvj.js → ds229x4r.js} +1 -1
  70. package/dist/{tooling/shared/yw30vnq2.js → shared/e275q7sd.js} +1 -1
  71. package/dist/shared/{mfedzr74.js → ebhz8vh6.js} +4 -4
  72. package/dist/shared/{z581d7ny.js → fdsz3w80.js} +2 -2
  73. package/dist/shared/{sjk86yrx.js → fk9vef30.js} +84 -73
  74. package/dist/shared/{needfe47.js → g89fmz5s.js} +1 -1
  75. package/dist/shared/{m4xff2a6.js → ghqzdp94.js} +2 -2
  76. package/dist/shared/h9811jjm.js +17 -0
  77. package/dist/shared/{kj9d8maq.js → jpybhf98.js} +1 -1
  78. package/dist/shared/kzgrnckd.js +29 -0
  79. package/dist/shared/{agsfb86s.js → mazpbcdj.js} +4 -4
  80. package/dist/shared/{195pzzzz.js → mgaq2sd3.js} +10 -7
  81. package/dist/shared/{5mtf6cj3.js → mvmm3xpb.js} +5 -2
  82. package/dist/shared/{p3xbdcvt.js → myk8fswx.js} +55 -6
  83. package/dist/shared/{njga14v4.js → n306gqkd.js} +8 -8
  84. package/dist/shared/n5whk3mt.js +665 -0
  85. package/dist/shared/{bah9nbg3.js → npdftanb.js} +12 -20
  86. package/dist/shared/{16kvjebh.js → pg4ezgyf.js} +7 -26
  87. package/dist/{tooling/shared/08kemxjd.js → shared/pgsak1yw.js} +1 -1
  88. package/dist/shared/{jp36k7dp.js → qvwwp1mp.js} +61 -40
  89. package/dist/shared/rbxt795q.js +1766 -0
  90. package/dist/shared/{g5yc06ka.js → s7he5e5d.js} +1 -1
  91. package/dist/shared/{hfqmpasr.js → ss2kv2rs.js} +5 -5
  92. package/dist/shared/stfa9xcw.js +450 -0
  93. package/dist/{tooling/shared/rs1jb051.js → shared/tr64w5p0.js} +1 -1
  94. package/dist/shared/{jebgrkeq.js → tw1nvvfj.js} +2 -2
  95. package/dist/shared/{v1wad97q.js → wvtjg5m3.js} +1 -1
  96. package/dist/shared/xqacq37x.js +61 -0
  97. package/dist/shared/{n05z9nwz.js → xtsydxjg.js} +1 -1
  98. package/dist/shared/{jx2m62cs.js → xv8qj97g.js} +5 -5
  99. package/dist/shared/{63f4ksbz.js → xwhdcrm4.js} +1 -1
  100. package/dist/shared/{hm5f8jby.js → yvabyg9k.js} +6 -6
  101. package/dist/shared/yybhre6n.js +136 -0
  102. package/dist/shared/zdqf8k5d.js +8 -0
  103. package/dist/tooling/cli.js +94 -22
  104. package/dist/tooling/driver-run.js +15 -332
  105. package/dist/tooling/github/comment.d.ts +50 -0
  106. package/dist/tooling/github/post-comment.d.ts +17 -0
  107. package/dist/tooling/migrate/commands.d.ts +2 -1
  108. package/dist/tooling/migrate/config.d.ts +13 -0
  109. package/dist/tooling/migrate/export.d.ts +165 -0
  110. package/dist/tooling/migrate/ext-surface.d.ts +80 -0
  111. package/dist/tooling/migrate/ext.d.ts +31 -4
  112. package/dist/tooling/migrate/import-drizzle.d.ts +40 -0
  113. package/dist/tooling/migrate/index.d.ts +3 -0
  114. package/dist/tooling/migrate/index.js +55 -10
  115. package/dist/tooling/migrate/lint-rules.d.ts +18 -1
  116. package/dist/tooling/migrate/lint.d.ts +14 -1
  117. package/dist/tooling/migrate/place.d.ts +18 -0
  118. package/dist/tooling/migrate/plan-json.d.ts +65 -0
  119. package/dist/tooling/migrate/project.d.ts +10 -1
  120. package/dist/tooling/migrate/pull-emit.d.ts +98 -0
  121. package/dist/tooling/migrate/pull-routines.d.ts +126 -0
  122. package/dist/tooling/migrate/pull-verify.d.ts +26 -0
  123. package/dist/tooling/migrate/pull.d.ts +62 -0
  124. package/dist/tooling/migrate/reprint.d.ts +32 -0
  125. package/dist/tooling/migrate/sandbox.d.ts +8 -2
  126. package/dist/tooling/migrate/schema-api.d.ts +43 -0
  127. package/dist/tooling/migrate/sql-lex.d.ts +18 -0
  128. package/dist/tooling/shared/{3m1hkg7z.js → 04svnxxj.js} +4 -4
  129. package/dist/tooling/shared/{ppnnnvj8.js → 0j0jtse1.js} +1 -1
  130. package/dist/tooling/shared/{z8d7ptht.js → 0r05zhyq.js} +5 -5
  131. package/dist/tooling/shared/{a6pp9d12.js → 1800eymw.js} +3 -3
  132. package/dist/tooling/shared/{cmptmb4f.js → 35zemrmf.js} +1 -1
  133. package/dist/tooling/shared/{w7qe8sj1.js → 3rmaz3pq.js} +1 -1
  134. package/dist/{shared/q0cqt2sp.js → tooling/shared/3yn79q5m.js} +1 -1
  135. package/dist/tooling/shared/{2revefqt.js → 57btdkgm.js} +2 -2
  136. package/dist/tooling/shared/{ma2340rx.js → 5bmksndh.js} +2 -2
  137. package/dist/tooling/shared/{9xzm7hjg.js → 5p8km5jb.js} +3 -3
  138. package/dist/tooling/shared/{xhrnjch9.js → 5x3pf400.js} +3 -3
  139. package/dist/tooling/shared/{wwnekq5n.js → 5zrzffnk.js} +1 -1
  140. package/dist/tooling/shared/{p7f08ktn.js → 62fxpc1p.js} +7 -7
  141. package/dist/tooling/shared/{7ae7rjmn.js → 68tf18v4.js} +2 -2
  142. package/dist/tooling/shared/{rf83gr2d.js → 6vk28rjp.js} +7 -3
  143. package/dist/tooling/shared/76pv6qff.js +9 -0
  144. package/dist/tooling/shared/{bz2dqhab.js → 7aews1zg.js} +3 -3
  145. package/dist/tooling/shared/{9kazs5p6.js → 7b3xp9gc.js} +3 -3
  146. package/dist/tooling/shared/{4d2w25vw.js → 7pxncnzs.js} +2 -2
  147. package/dist/tooling/shared/{zvnhh1n0.js → 829fjxyw.js} +2 -2
  148. package/dist/tooling/shared/{dzx85q70.js → 8m5znpdt.js} +1 -1
  149. package/dist/tooling/shared/{g9ad4n80.js → 8yr7ges1.js} +7 -7
  150. package/dist/tooling/shared/{tn8gay14.js → 9qr9rkbh.js} +6 -6
  151. package/dist/tooling/shared/{8sqrsw3s.js → 9sfbtwsk.js} +3 -3
  152. package/dist/{shared/bnby0esn.js → tooling/shared/9wsnsvbf.js} +1 -1
  153. package/dist/tooling/shared/{aftb2mwr.js → a2xe04bm.js} +1 -1
  154. package/dist/tooling/shared/{nf7jmhfa.js → a4pzghha.js} +2 -2
  155. package/dist/tooling/shared/{y5656f0e.js → am04v8na.js} +5 -5
  156. package/dist/tooling/shared/{417zdsk7.js → asgr07mp.js} +5 -5
  157. package/dist/tooling/shared/{pqy21k24.js → c0xevn1h.js} +4 -4
  158. package/dist/tooling/shared/dhatassp.js +134 -0
  159. package/dist/tooling/shared/{spk1jg3r.js → ezqn88nj.js} +8 -8
  160. package/dist/tooling/shared/{6nyfyw70.js → f77nnfqy.js} +2 -2
  161. package/dist/tooling/shared/{wt7j7nf6.js → fh07z1dt.js} +1 -1
  162. package/dist/tooling/shared/{3rrw5w8f.js → gqwevek4.js} +1 -1
  163. package/dist/tooling/shared/{f9mphxej.js → hfq3n3bd.js} +346 -19
  164. package/dist/tooling/shared/{vs0t6qt8.js → j664qjrt.js} +2 -2
  165. package/dist/tooling/shared/{733a1tq3.js → jpgmjsx3.js} +3 -3
  166. package/dist/tooling/shared/{mtrqn2hn.js → jr2nmr81.js} +22 -30
  167. package/dist/{shared/mtw6jz76.js → tooling/shared/jsjjz875.js} +1 -1
  168. package/dist/tooling/shared/{2wtvc7rw.js → kbqnrs1x.js} +2 -2
  169. package/dist/tooling/shared/{gfvtj6d0.js → kz715295.js} +7 -7
  170. package/dist/tooling/shared/{a7q7t4n3.js → m3xt8b1h.js} +2 -2
  171. package/dist/tooling/shared/{dw08f3m8.js → m4hhb8aa.js} +2 -2
  172. package/dist/tooling/shared/{y031jct9.js → mw5npye0.js} +2 -2
  173. package/dist/tooling/shared/{vraj6d74.js → nxq95eb6.js} +3 -3
  174. package/dist/tooling/shared/{fb9k2qwd.js → qartgazh.js} +11 -30
  175. package/dist/tooling/shared/{xjs6zqtc.js → rcywj2w8.js} +9 -9
  176. package/dist/tooling/shared/{dy672fz6.js → s6qha57m.js} +2 -2
  177. package/dist/tooling/shared/{vx86qjv8.js → shjs0379.js} +3 -3
  178. package/dist/tooling/shared/{345tbc2k.js → sjwkt1pg.js} +1 -1
  179. package/dist/tooling/shared/{rq5kk8j6.js → stebqyyd.js} +3 -3
  180. package/dist/tooling/shared/{yk9mp7vb.js → t4xveemq.js} +4 -4
  181. package/dist/tooling/shared/{djydjpqt.js → t6zjeake.js} +5 -5
  182. package/dist/tooling/shared/{zhwnfyb2.js → tcwpjvxe.js} +1 -1
  183. package/dist/tooling/shared/{72fyg4zv.js → tpssp7ac.js} +1 -1
  184. package/dist/tooling/shared/{jne7b93p.js → v6j1ep6w.js} +3 -3
  185. package/dist/tooling/shared/{ec71zqgt.js → vwr2y833.js} +2 -2
  186. package/dist/tooling/shared/{j9t5s12a.js → w17sj05d.js} +2 -2
  187. package/dist/tooling/shared/{3tq8pnb8.js → w5d89rb4.js} +1 -1
  188. package/dist/tooling/shared/{smn6kz1p.js → wbwq1jsa.js} +2 -2
  189. package/dist/tooling/shared/{pwsytxm5.js → wezxf3h8.js} +1 -1
  190. package/dist/tooling/shared/{5bvw2nev.js → yb4kd19s.js} +1 -1
  191. package/dist/tooling/shared/{gmcf9cxf.js → ybdew6j7.js} +2 -2
  192. package/dist/tooling/shared/{ep8zh3bk.js → yfedr1zb.js} +1 -1
  193. package/dist/tooling/shared/{ddjtfgnx.js → yhp829bx.js} +3 -3
  194. package/dist/tooling/shared/{yfr8hzhm.js → ytk1tjs0.js} +1 -1
  195. package/dist/tooling/shared/{03k6res6.js → zs9aymcp.js} +1 -1
  196. package/dist/tooling/shared/zx3v9phv.js +8 -0
  197. package/dist/tooling/testing/index.js +2 -2
  198. package/package.json +38 -9
  199. package/dist/shared/fjpnhqan.js +0 -71
  200. package/dist/shared/n41w4fbz.js +0 -113
  201. package/dist/tooling/shared/pw8fgahx.js +0 -69
  202. /package/dist/shared/{ae4j5f42.js → mfvx6kjx.js} +0 -0
@@ -3,25 +3,25 @@ import {
3
3
  renameColumn2,
4
4
  renameTable2
5
5
  } from "./12z7aznj.js";
6
+ import {
7
+ quoteIdent2,
8
+ uniqueBeforeForeignKey2,
9
+ ownedByView2,
10
+ dropObjectSql2,
11
+ createObjectSql2,
12
+ functionSql2,
13
+ viewSql2,
14
+ policyCreatePlan2,
15
+ policyDropPlan2,
16
+ refreshMaterializedViewSql2,
17
+ alterColumnSql2,
18
+ identitySequence2,
19
+ createTableSql2,
20
+ qualify2
21
+ } from "./fk9vef30.js";
6
22
  import {
7
23
  isConnectionLost
8
24
  } from "./cnkky55j.js";
9
- import {
10
- quoteIdent,
11
- uniqueBeforeForeignKey,
12
- ownedByView,
13
- dropObjectSql,
14
- createObjectSql,
15
- functionSql,
16
- viewSql,
17
- policyCreatePlan,
18
- policyDropPlan,
19
- refreshMaterializedViewSql,
20
- alterColumnSql,
21
- identitySequence,
22
- createTableSql,
23
- qualify
24
- } from "./sjk86yrx.js";
25
25
  import {
26
26
  isDomain,
27
27
  sameEnumLabels
@@ -366,6 +366,67 @@ function isEscapeString(sql, index) {
366
366
  return false;
367
367
  return true;
368
368
  }
369
+ function sqlIdentifiers(sql) {
370
+ const names = [];
371
+ let index = 0;
372
+ while (index < sql.length) {
373
+ if (sql.startsWith("--", index)) {
374
+ index = lineCommentEnd(sql, index + 2);
375
+ continue;
376
+ }
377
+ if (sql.startsWith("/*", index)) {
378
+ const block = blockComment(sql, index + 2);
379
+ index = block.index;
380
+ if (block.open)
381
+ break;
382
+ continue;
383
+ }
384
+ const dollar = dollarAt(sql, index);
385
+ if (dollar !== undefined) {
386
+ const closed = takeDollar(sql, dollar);
387
+ index = closed.index;
388
+ if (closed.open)
389
+ break;
390
+ continue;
391
+ }
392
+ if (isEscapeString(sql, index)) {
393
+ const quote = takeQuoted(sql, index + 2, true);
394
+ index = quote.index;
395
+ if (quote.open)
396
+ break;
397
+ continue;
398
+ }
399
+ const char = sql[index];
400
+ if (char === "'") {
401
+ const quote = takeQuoted(sql, index + 1, false);
402
+ index = quote.index;
403
+ if (quote.open)
404
+ break;
405
+ continue;
406
+ }
407
+ if (char === '"') {
408
+ const quote = takeIdent(sql, index + 1);
409
+ if (!quote.open) {
410
+ names.push({ text: unescapeIdent(sql.slice(index + 1, quote.index - 1)), quoted: true });
411
+ }
412
+ index = quote.index;
413
+ if (quote.open)
414
+ break;
415
+ continue;
416
+ }
417
+ if (isIdentStart(sql.charCodeAt(index))) {
418
+ const word = readWord(sql, index);
419
+ names.push({ text: word, quoted: false });
420
+ index += word.length;
421
+ continue;
422
+ }
423
+ index += 1;
424
+ }
425
+ return names;
426
+ }
427
+ function unescapeIdent(text) {
428
+ return text.replaceAll('""', '"');
429
+ }
369
430
  function isIdentStart(code) {
370
431
  return code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 95;
371
432
  }
@@ -522,10 +583,10 @@ function index(objects) {
522
583
  return by;
523
584
  }
524
585
  function createRoleSql(object) {
525
- return `create role ${quoteIdent(object.identity.name)} with nosuperuser nocreatedb nocreaterole ${inherit(object)} ${login(object)}`;
586
+ return `create role ${quoteIdent2(object.identity.name)} with nosuperuser nocreatedb nocreaterole ${inherit(object)} ${login(object)}`;
526
587
  }
527
588
  function alterRoleSql(object) {
528
- return `alter role ${quoteIdent(object.identity.name)} with ${inherit(object)} ${login(object)}`;
589
+ return `alter role ${quoteIdent2(object.identity.name)} with ${inherit(object)} ${login(object)}`;
529
590
  }
530
591
  function login(object) {
531
592
  return object.definition.login ? "login" : "nologin";
@@ -541,7 +602,7 @@ function tightenColumnSelect(object, after, schema) {
541
602
  if (covered)
542
603
  return;
543
604
  return {
544
- sql: `revoke select on ${grantTarget(target, schema)} from ${quoteIdent(object.identity.role)}`,
605
+ sql: `revoke select on ${grantTarget(target, schema)} from ${quoteIdent2(object.identity.role)}`,
545
606
  kind: "revoke"
546
607
  };
547
608
  }
@@ -555,7 +616,7 @@ function revokeMatviewWrites(object, after, schema) {
555
616
  if (!inheritsWrites)
556
617
  return;
557
618
  return {
558
- sql: `revoke insert, update, delete on ${grantTarget(target, schema)} from ${quoteIdent(object.identity.role)}`,
619
+ sql: `revoke insert, update, delete on ${grantTarget(target, schema)} from ${quoteIdent2(object.identity.role)}`,
559
620
  kind: "revoke"
560
621
  };
561
622
  }
@@ -565,11 +626,11 @@ function grantStatement(object, schema, revoke) {
565
626
  const verb = revoke ? "revoke" : "grant";
566
627
  const direction = revoke ? "from" : "to";
567
628
  const target = grantTarget(object.identity.object, schema);
568
- const role = quoteIdent(object.identity.role);
629
+ const role = quoteIdent2(object.identity.role);
569
630
  const listed = column?.[2];
570
631
  const base = column?.[1];
571
632
  if (listed !== undefined && base !== undefined) {
572
- const names = listed.split(",").filter((name) => name.length > 0).map((name) => quoteIdent(name)).join(", ");
633
+ const names = listed.split(",").filter((name) => name.length > 0).map((name) => quoteIdent2(name)).join(", ");
573
634
  return `${verb} ${base.toLowerCase()} (${names}) on ${target} ${direction} ${role}`;
574
635
  }
575
636
  const keyword = privilege.toLowerCase();
@@ -581,7 +642,7 @@ function defaultStatement(object, schema, revoke) {
581
642
  assertPrivilege(privilege);
582
643
  const verb = revoke ? "revoke" : "grant";
583
644
  const direction = revoke ? "from" : "to";
584
- return `alter default privileges for role ${quoteIdent(object.identity.forRole)} in schema ${quoteIdent(schema)} ${verb} ${privilege} on ${objectKindSql(object.identity.objectKind)} ${direction} ${quoteIdent(object.identity.grantee)}`;
645
+ return `alter default privileges for role ${quoteIdent2(object.identity.forRole)} in schema ${quoteIdent2(schema)} ${verb} ${privilege} on ${objectKindSql(object.identity.objectKind)} ${direction} ${quoteIdent2(object.identity.grantee)}`;
585
646
  }
586
647
  function grantTargetKey(object) {
587
648
  if (object.kind === "table" || object.kind === "view" || object.kind === "materializedView" || object.kind === "sequence") {
@@ -603,20 +664,20 @@ function grantTargetKey(object) {
603
664
  }
604
665
  function grantTarget(object, schema) {
605
666
  if (object.kind === "sequence")
606
- return `sequence ${qualify(schema, object.name)}`;
667
+ return `sequence ${qualify2(schema, object.name)}`;
607
668
  if (object.kind === "function")
608
669
  return functionTarget(object.name, schema);
609
670
  if (object.kind === "namespace")
610
- return `schema ${quoteIdent(schema)}`;
611
- return `table ${qualify(schema, object.name)}`;
671
+ return `schema ${quoteIdent2(schema)}`;
672
+ return `table ${qualify2(schema, object.name)}`;
612
673
  }
613
674
  function functionTarget(name, schema) {
614
675
  const open = name.lastIndexOf("(");
615
676
  if (open < 0 || !name.endsWith(")"))
616
- return `function ${qualify(schema, name)}()`;
677
+ return `function ${qualify2(schema, name)}()`;
617
678
  const fn = name.slice(0, open);
618
679
  const args = name.slice(open + 1, -1);
619
- return `function ${qualify(schema, fn)}(${args})`;
680
+ return `function ${qualify2(schema, fn)}(${args})`;
620
681
  }
621
682
  function objectKindSql(kind) {
622
683
  if (kind === "function")
@@ -713,7 +774,7 @@ function keyOn(source, table) {
713
774
  if (column === undefined || column.kind !== "column") {
714
775
  throw new OkmError2("OKM1546", `Table ${table} primary key column ${name} is not in the catalog.`, { fix: { summary: "Keep the primary key columns on the table." } });
715
776
  }
716
- columns.push({ quoted: quoteIdent(name), dataType: column.definition.dataType });
777
+ columns.push({ quoted: quoteIdent2(name), dataType: column.definition.dataType });
717
778
  }
718
779
  if (columns.length === 0)
719
780
  return;
@@ -777,7 +838,7 @@ function splitKey(text) {
777
838
  }
778
839
  if (!closed)
779
840
  return [];
780
- names.push(quoteIdent(value));
841
+ names.push(quoteIdent2(value));
781
842
  if (text[index] === ",")
782
843
  index += 1;
783
844
  continue;
@@ -787,7 +848,7 @@ function splitKey(text) {
787
848
  const raw = text.slice(index, end);
788
849
  if (raw.length === 0)
789
850
  return [];
790
- names.push(quoteIdent(raw));
851
+ names.push(quoteIdent2(raw));
791
852
  index = comma === -1 ? text.length : comma + 1;
792
853
  }
793
854
  return names;
@@ -961,7 +1022,7 @@ function refuseDrops(beforeBy, afterBy, dropKeys) {
961
1022
  }
962
1023
  function alterExtension(before, after) {
963
1024
  const steps = [];
964
- const name = quoteIdent(after.identity.name);
1025
+ const name = quoteIdent2(after.identity.name);
965
1026
  if (before.definition.schema !== after.definition.schema) {
966
1027
  if (!after.definition.relocatable) {
967
1028
  throw new OkmError2("OKM1814", `Extension ${after.identity.name} is not relocatable, so it cannot move to ${after.definition.schema}.`, {
@@ -970,7 +1031,7 @@ function alterExtension(before, after) {
970
1031
  }
971
1032
  });
972
1033
  }
973
- steps.push(extensionStep(`alter extension ${name} set schema ${quoteIdent(after.definition.schema)}`, "move-extension"));
1034
+ steps.push(extensionStep(`alter extension ${name} set schema ${quoteIdent2(after.definition.schema)}`, "move-extension"));
974
1035
  }
975
1036
  const previous = before.definition.version;
976
1037
  const next = after.definition.version;
@@ -1151,9 +1212,9 @@ function stepsForExistingTable(object, schema, catalogs, batchSize) {
1151
1212
  function notNullSteps(column, schema, setKind, catalogs) {
1152
1213
  const tableName = column.identity.parent.name;
1153
1214
  const columnName = column.identity.name;
1154
- const table = qualify(schema, tableName);
1155
- const quotedColumn = quoteIdent(columnName);
1156
- const constraint = quoteIdent(notNullConstraintName(tableName, columnName, catalogs));
1215
+ const table = qualify2(schema, tableName);
1216
+ const quotedColumn = quoteIdent2(columnName);
1217
+ const constraint = quoteIdent2(notNullConstraintName(tableName, columnName, catalogs));
1157
1218
  return [
1158
1219
  {
1159
1220
  sql: `alter table ${table} add constraint ${constraint} check (${quotedColumn} is not null) not valid`,
@@ -1216,7 +1277,7 @@ function volatileDefault(expression, catalogs) {
1216
1277
  return false;
1217
1278
  }
1218
1279
  function concurrentIndexStep(object, schema) {
1219
- const plain = createObjectSql(object, schema) ?? "";
1280
+ const plain = createObjectSql2(object, schema) ?? "";
1220
1281
  return {
1221
1282
  sql: concurrentIndexSql(plain),
1222
1283
  kind: "create-index",
@@ -1232,13 +1293,13 @@ function constraintSteps(object, schema) {
1232
1293
  return notValidSteps(object, schema);
1233
1294
  }
1234
1295
  function notValidSteps(object, schema) {
1235
- const plain = createObjectSql(object, schema);
1296
+ const plain = createObjectSql2(object, schema);
1236
1297
  if (plain === undefined)
1237
1298
  return [];
1238
- const table = qualify(schema, object.identity.parent.name);
1239
- const name = quoteIdent(object.identity.name);
1299
+ const table = qualify2(schema, object.identity.parent.name);
1300
+ const name = quoteIdent2(object.identity.name);
1240
1301
  const referenced = object.definition.references;
1241
- const referencedLock = referenced === undefined ? undefined : qualify(schema, referenced.parent.name);
1302
+ const referencedLock = referenced === undefined ? undefined : qualify2(schema, referenced.parent.name);
1242
1303
  return [
1243
1304
  {
1244
1305
  sql: `${plain} not valid`,
@@ -1257,9 +1318,9 @@ function notValidSteps(object, schema) {
1257
1318
  ];
1258
1319
  }
1259
1320
  function usingIndexSteps(object, schema) {
1260
- const table = qualify(schema, object.identity.parent.name);
1261
- const name = quoteIdent(object.identity.name);
1262
- const columns = object.definition.columns.map((column) => quoteIdent(column)).join(", ");
1321
+ const table = qualify2(schema, object.identity.parent.name);
1322
+ const name = quoteIdent2(object.identity.name);
1323
+ const columns = object.definition.columns.map((column) => quoteIdent2(column)).join(", ");
1263
1324
  const nulls = object.definition.nullsNotDistinct ? " nulls not distinct" : "";
1264
1325
  const verb = object.definition.constraintKind === "primaryKey" ? "primary key" : "unique";
1265
1326
  const defer = object.definition.deferrable ? ` deferrable initially ${object.definition.initially}` : "";
@@ -1282,9 +1343,9 @@ function usingIndexSteps(object, schema) {
1282
1343
  }
1283
1344
  function volatileColumnSteps(column, schema, catalogs, batchSize) {
1284
1345
  const tableName = column.identity.parent.name;
1285
- const table = qualify(schema, tableName);
1286
- const name = quoteIdent(column.identity.name);
1287
- const collate = column.definition.collation === undefined ? "" : ` collate ${quoteIdent(column.definition.collation)}`;
1346
+ const table = qualify2(schema, tableName);
1347
+ const name = quoteIdent2(column.identity.name);
1348
+ const collate = column.definition.collation === undefined ? "" : ` collate ${quoteIdent2(column.definition.collation)}`;
1288
1349
  const expression = column.definition.defaultExpression ?? "";
1289
1350
  const key = primaryKeyColumns(catalogs, tableName);
1290
1351
  const backfill = {
@@ -1539,12 +1600,12 @@ function planMigration(input) {
1539
1600
  const deferred = new Set(picklists.map((change) => identityKey2(change.before.identity)));
1540
1601
  const typeDrops = [];
1541
1602
  const extensionDrops = [];
1542
- const reverse = [...uniqueBeforeForeignKey(creationOrder2(renamed))].reverse();
1603
+ const reverse = [...uniqueBeforeForeignKey2(creationOrder2(renamed))].reverse();
1543
1604
  const emitDrop = (object) => {
1544
1605
  const key = identityKey2(object.identity);
1545
1606
  if (!dropKeys.has(key) || deferred.has(key) || covered(object, droppedTables))
1546
1607
  return;
1547
- const sql = dropObjectSql(object, schema);
1608
+ const sql = dropObjectSql2(object, schema);
1548
1609
  const kind = dropKind(object);
1549
1610
  if (sql === undefined || kind === undefined)
1550
1611
  return;
@@ -1566,7 +1627,7 @@ function planMigration(input) {
1566
1627
  if (object.kind === "function")
1567
1628
  emitDrop(object);
1568
1629
  for (const object of reverse)
1569
- if (ownedByView(object))
1630
+ if (ownedByView2(object))
1570
1631
  emitDrop(object);
1571
1632
  for (const object of reverse) {
1572
1633
  if (object.kind === "view" || object.kind === "materializedView")
@@ -1578,12 +1639,12 @@ function planMigration(input) {
1578
1639
  const key = identityKey2(object.identity);
1579
1640
  if (!dropKeys.has(key) || deferred.has(key))
1580
1641
  continue;
1581
- for (const item of policyDropPlan(object, schema)) {
1642
+ for (const item of policyDropPlan2(object, schema)) {
1582
1643
  steps.push(step(item.sql, item.kind, "ddl", ACCESS2, true, [object.identity.parent.name]));
1583
1644
  }
1584
1645
  }
1585
1646
  for (const object of reverse) {
1586
- if (object.kind === "trigger" || object.kind === "function" || object.kind === "view" || object.kind === "materializedView" || object.kind === "policy" || ownedByView(object)) {
1647
+ if (object.kind === "trigger" || object.kind === "function" || object.kind === "view" || object.kind === "materializedView" || object.kind === "policy" || ownedByView2(object)) {
1587
1648
  continue;
1588
1649
  }
1589
1650
  const key = identityKey2(object.identity);
@@ -1606,7 +1667,7 @@ function planMigration(input) {
1606
1667
  steps.push(...extensionAlterSteps(beforeBy, afterBy, dropKeys));
1607
1668
  for (const change of alters) {
1608
1669
  const aligned = alignedColumnType(change.before, change.after);
1609
- const statements = alterColumnSql(aligned, change.after, schema);
1670
+ const statements = alterColumnSql2(aligned, change.after, schema);
1610
1671
  const kinds = columnAlterKinds(aligned, change.after);
1611
1672
  for (let index = 0;index < statements.length; index += 1) {
1612
1673
  const sql = statements[index];
@@ -1636,7 +1697,7 @@ function planMigration(input) {
1636
1697
  if (!createKeys.has(key) || emitted.has(key))
1637
1698
  continue;
1638
1699
  emitted.add(key);
1639
- const sql = createObjectSql(object, schema);
1700
+ const sql = createObjectSql2(object, schema);
1640
1701
  const kind = createKind(object, false);
1641
1702
  if (sql === undefined || kind === undefined)
1642
1703
  continue;
@@ -1649,14 +1710,14 @@ function planMigration(input) {
1649
1710
  if (!createKeys.has(key) || emitted.has(key))
1650
1711
  continue;
1651
1712
  emitted.add(key);
1652
- const sql = createObjectSql(object, schema);
1713
+ const sql = createObjectSql2(object, schema);
1653
1714
  const kind = createKind(object, false);
1654
1715
  if (sql === undefined || kind === undefined)
1655
1716
  continue;
1656
1717
  steps.push(step(sql, kind, "ddl", ACCESS2));
1657
1718
  }
1658
- for (const object of uniqueBeforeForeignKey(creationOrder2(request.after))) {
1659
- if (object.kind === "type" || object.kind === "extension" || object.kind === "function" || object.kind === "trigger" || object.kind === "view" || object.kind === "materializedView" || object.kind === "policy" || ownedByView(object)) {
1719
+ for (const object of uniqueBeforeForeignKey2(creationOrder2(request.after))) {
1720
+ if (object.kind === "type" || object.kind === "extension" || object.kind === "function" || object.kind === "trigger" || object.kind === "view" || object.kind === "materializedView" || object.kind === "policy" || ownedByView2(object)) {
1660
1721
  continue;
1661
1722
  }
1662
1723
  const key = identityKey2(object.identity);
@@ -1671,10 +1732,10 @@ function planMigration(input) {
1671
1732
  continue;
1672
1733
  emitted.add(key);
1673
1734
  if (object.kind === "table") {
1674
- steps.push(step(createTableSql(object, request.after, schema), "create-table", "ddl", ACCESS2));
1735
+ steps.push(step(createTableSql2(object, request.after, schema), "create-table", "ddl", ACCESS2));
1675
1736
  continue;
1676
1737
  }
1677
- const sql = createObjectSql(object, schema);
1738
+ const sql = createObjectSql2(object, schema);
1678
1739
  const kind = createKind(object, tableIsNew);
1679
1740
  if (sql === undefined || kind === undefined)
1680
1741
  continue;
@@ -1694,7 +1755,7 @@ function planMigration(input) {
1694
1755
  if (!createKeys.has(key) || emitted.has(key))
1695
1756
  continue;
1696
1757
  emitted.add(key);
1697
- for (const item of policyCreatePlan(object, schema)) {
1758
+ for (const item of policyCreatePlan2(object, schema)) {
1698
1759
  steps.push(step(item.sql, item.kind, "ddl", ACCESS2, true, [object.identity.parent.name]));
1699
1760
  }
1700
1761
  }
@@ -1704,7 +1765,7 @@ function planMigration(input) {
1704
1765
  const key = identityKey2(change.after.identity);
1705
1766
  if (dropKeys.has(key) && createKeys.has(key))
1706
1767
  continue;
1707
- const sql = change.kind === "function" ? functionSql(change.after, schema, true) : viewSql(change.after, schema, true);
1768
+ const sql = change.kind === "function" ? functionSql2(change.after, schema, true) : viewSql2(change.after, schema, true);
1708
1769
  const kind = change.kind === "function" ? "replace-function" : "replace-view";
1709
1770
  steps.push({
1710
1771
  sql,
@@ -1724,7 +1785,7 @@ function planMigration(input) {
1724
1785
  if (!createKeys.has(key) || emitted.has(key))
1725
1786
  continue;
1726
1787
  emitted.add(key);
1727
- const sql = createObjectSql(object, schema);
1788
+ const sql = createObjectSql2(object, schema);
1728
1789
  const created = createKind(object, false);
1729
1790
  if (sql === undefined || created === undefined)
1730
1791
  continue;
@@ -1732,13 +1793,13 @@ function planMigration(input) {
1732
1793
  }
1733
1794
  }
1734
1795
  for (const object of creationOrder2(request.after)) {
1735
- if (!ownedByView(object))
1796
+ if (!ownedByView2(object))
1736
1797
  continue;
1737
1798
  const key = identityKey2(object.identity);
1738
1799
  if (!createKeys.has(key) || emitted.has(key))
1739
1800
  continue;
1740
1801
  emitted.add(key);
1741
- const sql = createObjectSql(object, schema);
1802
+ const sql = createObjectSql2(object, schema);
1742
1803
  const kind = createKind(object, false);
1743
1804
  if (sql === undefined || kind === undefined)
1744
1805
  continue;
@@ -1751,7 +1812,7 @@ function planMigration(input) {
1751
1812
  if (!createKeys.has(key))
1752
1813
  continue;
1753
1814
  assertConcurrentRefresh(object, request.after);
1754
- steps.push(step(refreshMaterializedViewSql(object, schema, false), "refresh-matview", "backfill", ACCESS2));
1815
+ steps.push(step(refreshMaterializedViewSql2(object, schema, false), "refresh-matview", "backfill", ACCESS2));
1755
1816
  }
1756
1817
  for (const item of privileges.grant)
1757
1818
  steps.push(step(item.sql, item.kind, "ddl", ACCESS2));
@@ -1942,7 +2003,7 @@ function renameSteps(source, renames, schema) {
1942
2003
  if (rename.kind !== "table" || !hasTable(source, rename.from))
1943
2004
  continue;
1944
2005
  tables.set(rename.to, rename.from);
1945
- steps.push(step(`alter table ${qualify(schema, rename.from)} rename to ${quoteIdent(rename.to)}`, "rename-table", "ddl", ACCESS2));
2006
+ steps.push(step(`alter table ${qualify2(schema, rename.from)} rename to ${quoteIdent2(rename.to)}`, "rename-table", "ddl", ACCESS2));
1946
2007
  steps.push(...sequenceRenames(source, rename, schema));
1947
2008
  }
1948
2009
  for (const rename of renames) {
@@ -1951,7 +2012,7 @@ function renameSteps(source, renames, schema) {
1951
2012
  const previousTable = tables.get(rename.table) ?? rename.table;
1952
2013
  if (!hasColumn(source, previousTable, rename.from))
1953
2014
  continue;
1954
- steps.push(step(`alter table ${qualify(schema, rename.table)} rename column ${quoteIdent(rename.from)} to ${quoteIdent(rename.to)}`, "rename-column", "ddl", ACCESS2));
2015
+ steps.push(step(`alter table ${qualify2(schema, rename.table)} rename column ${quoteIdent2(rename.from)} to ${quoteIdent2(rename.to)}`, "rename-column", "ddl", ACCESS2));
1955
2016
  }
1956
2017
  return steps;
1957
2018
  }
@@ -1969,7 +2030,7 @@ function sequenceRenames(source, rename, schema) {
1969
2030
  const owned = source.objects.some((item) => item.kind === "sequence" && item.identity.name === fromName);
1970
2031
  if (!owned)
1971
2032
  continue;
1972
- steps.push(step(`alter sequence ${qualify(schema, fromName)} rename to ${quoteIdent(toName)}`, "rename-sequence", "ddl", ACCESS2));
2033
+ steps.push(step(`alter sequence ${qualify2(schema, fromName)} rename to ${quoteIdent2(toName)}`, "rename-sequence", "ddl", ACCESS2));
1973
2034
  }
1974
2035
  return steps;
1975
2036
  }
@@ -2018,14 +2079,14 @@ function withoutNameKey(value) {
2018
2079
  }
2019
2080
  function renameShapeStep(pair, schema) {
2020
2081
  if (pair.from.kind === "index" && pair.to.kind === "index") {
2021
- return step(`alter index ${qualify(schema, pair.from.identity.name)} rename to ${quoteIdent(pair.to.identity.name)}`, "rename-index", "ddl", SHARE_UPDATE2);
2082
+ return step(`alter index ${qualify2(schema, pair.from.identity.name)} rename to ${quoteIdent2(pair.to.identity.name)}`, "rename-index", "ddl", SHARE_UPDATE2);
2022
2083
  }
2023
2084
  if (pair.from.kind !== "constraint" || pair.to.kind !== "constraint") {
2024
2085
  throw new OkmError2("invalid", "A same-shape rename is an index or a constraint.", {
2025
2086
  fix: { summary: "The planner only renames an index or a constraint in place." }
2026
2087
  });
2027
2088
  }
2028
- return step(`alter table ${qualify(schema, pair.from.identity.parent.name)} rename constraint ${quoteIdent(pair.from.identity.name)} to ${quoteIdent(pair.to.identity.name)}`, "rename-constraint", "ddl", ACCESS2);
2089
+ return step(`alter table ${qualify2(schema, pair.from.identity.parent.name)} rename constraint ${quoteIdent2(pair.from.identity.name)} to ${quoteIdent2(pair.to.identity.name)}`, "rename-constraint", "ddl", ACCESS2);
2029
2090
  }
2030
2091
  function assertUnambiguous(beforeBy, afterBy) {
2031
2092
  const dropped = new Map;
@@ -2211,8 +2272,8 @@ function contractSwaps(picklists, enums, replacements, schema, catalogs, batchSi
2211
2272
  const steps = [];
2212
2273
  steps.push(...dataSteps(picklists, enums, replacements, schema, catalogs, batchSize, "contract"));
2213
2274
  for (const change of picklists) {
2214
- const table = qualify(schema, change.after.identity.parent.name);
2215
- const name = quoteIdent(change.after.identity.name);
2275
+ const table = qualify2(schema, change.after.identity.parent.name);
2276
+ const name = quoteIdent2(change.after.identity.name);
2216
2277
  const kind = change.removed.length > 0 ? "narrow-check" : "widen-check";
2217
2278
  steps.push(step(`alter table ${table} drop constraint ${name}`, kind, "ddl", ACCESS2));
2218
2279
  const expression = change.after.definition.expression ?? "true";
@@ -2222,17 +2283,17 @@ function contractSwaps(picklists, enums, replacements, schema, catalogs, batchSi
2222
2283
  for (const change of enums) {
2223
2284
  if (change.kind !== "replace")
2224
2285
  continue;
2225
- const type = qualify(schema, change.name);
2226
- const old = quoteIdent(`${change.name}_old`);
2286
+ const type = qualify2(schema, change.name);
2287
+ const old = quoteIdent2(`${change.name}_old`);
2227
2288
  const labels = change.labels.map((label) => quoteLiteral(label)).join(", ");
2228
2289
  steps.push(step(`alter type ${type} rename to ${old}`, "rename-enum", "ddl", ACCESS2));
2229
2290
  steps.push(step(`create type ${type} as enum (${labels})`, "recreate-enum", "ddl", ACCESS2));
2230
2291
  for (const column of change.columns) {
2231
- const table = qualify(schema, column.table);
2232
- const name = quoteIdent(column.column);
2292
+ const table = qualify2(schema, column.table);
2293
+ const name = quoteIdent2(column.column);
2233
2294
  steps.push(step(`alter table ${table} alter column ${name} type ${type} using ${name}::text::${type}`, "set-enum-column", "ddl", ACCESS2));
2234
2295
  }
2235
- steps.push(step(`drop type ${qualify(schema, `${change.name}_old`)}`, "drop-enum", "ddl", ACCESS2));
2296
+ steps.push(step(`drop type ${qualify2(schema, `${change.name}_old`)}`, "drop-enum", "ddl", ACCESS2));
2236
2297
  }
2237
2298
  return steps;
2238
2299
  }
@@ -2376,9 +2437,9 @@ function domainCheckSteps(beforeBy, afterBy, schema) {
2376
2437
  if (previous.definition.check === next.definition.check)
2377
2438
  continue;
2378
2439
  const name = next.identity.name;
2379
- const type = qualify(schema, name);
2380
- const current = quoteIdent(fitIdentifier2(`${name}_check`));
2381
- const upcoming = quoteIdent(fitIdentifier2(`${name}_check_next`));
2440
+ const type = qualify2(schema, name);
2441
+ const current = quoteIdent2(fitIdentifier2(`${name}_check`));
2442
+ const upcoming = quoteIdent2(fitIdentifier2(`${name}_check_next`));
2382
2443
  const expression = next.definition.check;
2383
2444
  steps.push(step(`alter domain ${type} add constraint ${upcoming} check (${expression}) not valid`, "add-domain-check", "ddl", ACCESS2));
2384
2445
  steps.push(step(`alter domain ${type} validate constraint ${upcoming}`, "validate-domain-check", "ddl", ACCESS2));
@@ -2454,7 +2515,7 @@ function labelSubsequence(before, after) {
2454
2515
  function addValueStatements(schema, name, before, after) {
2455
2516
  const present = new Set(before);
2456
2517
  const statements = [];
2457
- const type = qualify(schema, name);
2518
+ const type = qualify2(schema, name);
2458
2519
  for (let index = 0;index < after.length; index += 1) {
2459
2520
  const label = after[index];
2460
2521
  if (label === undefined || present.has(label))
@@ -2538,8 +2599,8 @@ function columnAlterable(before, after) {
2538
2599
  function identityChangeSql(before, after, schema) {
2539
2600
  if (stable(before.definition.identity) === stable(after.definition.identity))
2540
2601
  return;
2541
- const table = qualify(schema, after.identity.parent.name);
2542
- const name = quoteIdent(after.identity.name);
2602
+ const table = qualify2(schema, after.identity.parent.name);
2603
+ const name = quoteIdent2(after.identity.name);
2543
2604
  const next = after.definition.identity;
2544
2605
  const previous = before.definition.identity;
2545
2606
  if (next === undefined)
@@ -2683,7 +2744,7 @@ function folded(object, source) {
2683
2744
  return true;
2684
2745
  if (object.kind !== "sequence")
2685
2746
  return false;
2686
- if (identitySequence(object, source))
2747
+ if (identitySequence2(object, source))
2687
2748
  return true;
2688
2749
  const name = object.identity.name;
2689
2750
  return source.objects.some((column) => {
@@ -2703,9 +2764,9 @@ function overall(steps) {
2703
2764
  }
2704
2765
  function updateSql(schema, table, column, from, to, catalogs, batchSize, cast = false) {
2705
2766
  const key = primaryKeyColumns(catalogs, table);
2706
- const qualified = qualify(schema, table);
2767
+ const qualified = qualify2(schema, table);
2707
2768
  const value = to === null ? "null" : quoteLiteral(to);
2708
- const compare = cast ? `${quoteIdent(column)}::text` : quoteIdent(column);
2769
+ const compare = cast ? `${quoteIdent2(column)}::text` : quoteIdent2(column);
2709
2770
  const where = `${compare} = ${quoteLiteral(from)}`;
2710
2771
  const backfill = {
2711
2772
  table: qualified,
@@ -2713,7 +2774,7 @@ function updateSql(schema, table, column, from, to, catalogs, batchSize, cast =
2713
2774
  batch: batchSize
2714
2775
  };
2715
2776
  return {
2716
- sql: `update ${qualified} set ${quoteIdent(column)} = ${value} where ${where} and ${keyRangePredicate(key)}`,
2777
+ sql: `update ${qualified} set ${quoteIdent2(column)} = ${value} where ${where} and ${keyRangePredicate(key)}`,
2717
2778
  backfill
2718
2779
  };
2719
2780
  }
@@ -2804,7 +2865,7 @@ function readIdent(text, start) {
2804
2865
  return;
2805
2866
  }
2806
2867
  function pushDrop(steps, object, schema) {
2807
- const sql = dropObjectSql(object, schema);
2868
+ const sql = dropObjectSql2(object, schema);
2808
2869
  const kind = dropKind(object);
2809
2870
  if (sql === undefined || kind === undefined)
2810
2871
  return;
@@ -3118,4 +3179,4 @@ function endpointOf(url) {
3118
3179
  };
3119
3180
  }
3120
3181
 
3121
- export { sqlStatements, transactionControl, canonicalTypeName, prepareMigrationText, assertMigrationSteps, columnPrivilege, createdRoleName, createRoleOnce, changesRole, DEFAULT_BACKFILL_PAUSE_MS, DEFAULT_BACKFILL_STATEMENT_TIMEOUT_MS, batchSizeField, aboutBatchCount, boundaryQuery, checkedCast, classOf, strictestClass, assertExtensionsAvailable, omitManagedObjects, parseReplace, planMigration, formatPlan, parsePlan, staleRenames, sessionFailure, finishQuiet, assertTargetPolicy, assertTargetAlias, assertDirectConnection, assertStableBackend, listTargets, selectTarget };
3182
+ export { sqlStatements, transactionControl, sqlIdentifiers, canonicalTypeName, prepareMigrationText, assertMigrationSteps, columnPrivilege, createdRoleName, createRoleOnce, changesRole, DEFAULT_BACKFILL_PAUSE_MS, DEFAULT_BACKFILL_STATEMENT_TIMEOUT_MS, batchSizeField, aboutBatchCount, boundaryQuery, checkedCast, classOf, strictestClass, assertExtensionsAvailable, omitManagedObjects, parseReplace, planMigration, formatPlan, parsePlan, staleRenames, sessionFailure, finishQuiet, assertTargetPolicy, assertTargetAlias, assertDirectConnection, assertStableBackend, listTargets, selectTarget };
@@ -4,7 +4,7 @@ import {
4
4
  } from "./cnkky55j.js";
5
5
  import {
6
6
  createClient
7
- } from "./bah9nbg3.js";
7
+ } from "./npdftanb.js";
8
8
  import {
9
9
  OkmError2
10
10
  } from "./52szzakm.js";
@@ -0,0 +1,17 @@
1
+ import {
2
+ pullProject2,
3
+ pullLayout2,
4
+ commitPullFiles2
5
+ } from "./rbxt795q.js";
6
+ import"./myk8fswx.js";
7
+ import"./2zdxkt7b.js";
8
+ import"./6nae0spm.js";
9
+ import"./n442h54c.js";
10
+ import"./fk9vef30.js";
11
+ import"./12z7aznj.js";
12
+ import"./dd5pmnky.js";
13
+ export {
14
+ commitPullFiles2 as commitPullFiles,
15
+ pullLayout2 as pullLayout,
16
+ pullProject2 as pullProject
17
+ };
@@ -3,7 +3,7 @@ import {
3
3
  readHandle,
4
4
  readCall,
5
5
  attachHttp
6
- } from "./bah9nbg3.js";
6
+ } from "./npdftanb.js";
7
7
  import {
8
8
  fail2
9
9
  } from "./kgwp4jdd.js";
@@ -15,7 +15,7 @@ import {
15
15
  expectOf2,
16
16
  allowSet2,
17
17
  noteGuarded2
18
- } from "./bxas03mq.js";
18
+ } from "./9dtgn1z2.js";
19
19
  import"./mss6ctgv.js";
20
20
  export {
21
21
  Sql2 as Sql,
@@ -1,14 +1,14 @@
1
1
  import"./12z7aznj.js";
2
2
  import"./n442h54c.js";
3
- import"./35q0n9tz.js";
3
+ import"./fk9vef30.js";
4
+ import"./dd5pmnky.js";
4
5
  import {
5
6
  projectPath,
6
7
  loadConfig
7
- } from "./f4jy1j7x.js";
8
+ } from "./2zdxkt7b.js";
8
9
  import {
9
10
  listTargets
10
- } from "./dpc2r7rb.js";
11
- import"./sjk86yrx.js";
11
+ } from "./6nae0spm.js";
12
12
 
13
13
  // src/tooling/migrate/dev.ts
14
14
  import { mkdirSync } from "node:fs";
@@ -20,7 +20,7 @@ async function devProject(cwd) {
20
20
  `;
21
21
  const directory = projectPath(cwd, config.out ?? ".okm", "dev-db");
22
22
  mkdirSync(directory, { recursive: true });
23
- const { open } = await import("./m4xff2a6.js");
23
+ const { open } = await import("./ghqzdp94.js");
24
24
  const pool = await open({ dataDir: directory });
25
25
  try {
26
26
  await pool.execute("select 1");