@rebasepro/server-postgres 0.30.0 → 0.31.0-canary.g59cd6fd

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 (248) hide show
  1. package/README.md +11 -8
  2. package/dist/{BranchService-CrXvcES2.js → BranchService-USp1AvZB.js} +3 -3
  3. package/dist/{BranchService-CrXvcES2.js.map → BranchService-USp1AvZB.js.map} +1 -1
  4. package/dist/PostgresBackendDriver.d.ts +99 -54
  5. package/dist/PostgresBootstrapper.d.ts +12 -27
  6. package/dist/auth/ensure-tables.d.ts +16 -5
  7. package/dist/auth/schema-version.d.ts +2 -2
  8. package/dist/auth/services.d.ts +2 -3
  9. package/dist/{auth-users-columns-C72EMoDJ.js → auth-users-columns-BpfgbkxZ.js} +2 -16
  10. package/dist/auth-users-columns-BpfgbkxZ.js.map +1 -0
  11. package/dist/{backup-cli-CTKCOLpX.js → backup-cli-DbKyEj6c.js} +4 -4
  12. package/dist/{backup-cli-CTKCOLpX.js.map → backup-cli-DbKyEj6c.js.map} +1 -1
  13. package/dist/{boot-ddl-CqGIwSYx.js → boot-ddl-5H2bL_80.js} +2 -2
  14. package/dist/{boot-ddl-CqGIwSYx.js.map → boot-ddl-5H2bL_80.js.map} +1 -1
  15. package/dist/{cli-console-DBPw-oAz.js → cli-console-DsRgGSBR.js} +65 -39
  16. package/dist/cli-console-DsRgGSBR.js.map +1 -0
  17. package/dist/cli-console.d.ts +16 -13
  18. package/dist/cli-flags.d.ts +8 -9
  19. package/dist/cli-helpers.d.ts +15 -11
  20. package/dist/{cli-errors-DYTxnLbW.js → cli-schema-dir-CiN0ephV.js} +184 -70
  21. package/dist/cli-schema-dir-CiN0ephV.js.map +1 -0
  22. package/dist/cli-schema-dir.d.ts +64 -0
  23. package/dist/cli.js +192 -257
  24. package/dist/cli.js.map +1 -1
  25. package/dist/data-transformer.d.ts +50 -19
  26. package/dist/{database-preflight-iBpT7-vv.js → database-preflight-bfnIBnjM.js} +5 -5
  27. package/dist/database-preflight-bfnIBnjM.js.map +1 -0
  28. package/dist/{deferred-index-build-BCU9RoHK.js → deferred-index-build-CcSDA7wE.js} +69 -13
  29. package/dist/deferred-index-build-CcSDA7wE.js.map +1 -0
  30. package/dist/{ensure-collection-policies-Bo-_fDAy.js → ensure-policies-rRmXb5bt.js} +31 -31
  31. package/dist/ensure-policies-rRmXb5bt.js.map +1 -0
  32. package/dist/{ensure-collection-tables-DCJINkT_.js → ensure-tables-Bvm-F2wW.js} +44 -37
  33. package/dist/ensure-tables-Bvm-F2wW.js.map +1 -0
  34. package/dist/{ensure-tables-BPGaGh0y.js → ensure-tables-CC8p_AK3.js} +34 -29
  35. package/dist/ensure-tables-CC8p_AK3.js.map +1 -0
  36. package/dist/{enum-labels-kept-YAgOZS4I.js → enum-labels-kept-FlX9SHdf.js} +8 -8
  37. package/dist/enum-labels-kept-FlX9SHdf.js.map +1 -0
  38. package/dist/{generate-drizzle-schema-DcrFr7YX.js → generate-drizzle-schema-SJMXxzPI.js} +12 -12
  39. package/dist/generate-drizzle-schema-SJMXxzPI.js.map +1 -0
  40. package/dist/{generate-drizzle-schema-logic-LTLZvt6r.js → generate-drizzle-schema-logic-DL7R1rAF.js} +15 -8
  41. package/dist/generate-drizzle-schema-logic-DL7R1rAF.js.map +1 -0
  42. package/dist/{generate-files-CsaVzatS.js → generate-files-tlJ9_lGI.js} +23 -30
  43. package/dist/generate-files-tlJ9_lGI.js.map +1 -0
  44. package/dist/{generate-next-step-DgK5BlBn.js → generate-next-step-CO09dovd.js} +3 -3
  45. package/dist/generate-next-step-CO09dovd.js.map +1 -0
  46. package/dist/{generate-postgres-ddl-logic-Dg0bcENZ.js → generate-postgres-ddl-logic-B8huc03c.js} +51 -21
  47. package/dist/generate-postgres-ddl-logic-B8huc03c.js.map +1 -0
  48. package/dist/{generated-schema-diff-By4dxyTH.js → generated-schema-diff-DoT2dYDe.js} +297 -279
  49. package/dist/generated-schema-diff-DoT2dYDe.js.map +1 -0
  50. package/dist/{generated-schema-staleness-BvNF3i-s.js → generated-schema-staleness-YBVq2kTn.js} +21 -29
  51. package/dist/generated-schema-staleness-YBVq2kTn.js.map +1 -0
  52. package/dist/history/ensure-history-table.d.ts +22 -0
  53. package/dist/index.d.ts +8 -2
  54. package/dist/index.es.js +201 -25
  55. package/dist/index.es.js.map +1 -1
  56. package/dist/interfaces.d.ts +3 -4
  57. package/dist/{introspect-db-queries-DevUrzll.js → introspect-db-queries-BgiRQqtR.js} +7 -2
  58. package/dist/introspect-db-queries-BgiRQqtR.js.map +1 -0
  59. package/dist/introspect-tables-Cw_A-kk4.js +2086 -0
  60. package/dist/introspect-tables-Cw_A-kk4.js.map +1 -0
  61. package/dist/load-tables-B1Re74ng.js +92 -0
  62. package/dist/load-tables-B1Re74ng.js.map +1 -0
  63. package/dist/{migrate-baseline-CmWXL7qx.js → migrate-baseline-DZmekgpD.js} +19 -32
  64. package/dist/migrate-baseline-DZmekgpD.js.map +1 -0
  65. package/dist/{migrate-policy-stamps-BN_Qad6c.js → migrate-policy-stamps-B_acrUQB.js} +18 -19
  66. package/dist/migrate-policy-stamps-B_acrUQB.js.map +1 -0
  67. package/dist/model/PostgresTableRegistry.d.ts +159 -0
  68. package/dist/model/build-registry.d.ts +25 -0
  69. package/dist/model/refresh-relational-schema.d.ts +24 -0
  70. package/dist/model/runtime-table.d.ts +53 -0
  71. package/dist/{collections → model}/validate-relations.d.ts +15 -21
  72. package/dist/{open-rebase-40paQfVW.js → open-rebase-4kisUF_k.js} +3946 -3870
  73. package/dist/open-rebase-4kisUF_k.js.map +1 -0
  74. package/dist/open-rebase.d.ts +16 -15
  75. package/dist/{pg-error-utils-DJHjCF7-.js → pg-error-utils-BT5NzGFZ.js} +17 -20
  76. package/dist/pg-error-utils-BT5NzGFZ.js.map +1 -0
  77. package/dist/plan-schema-Hbtjhge3.js +1633 -0
  78. package/dist/plan-schema-Hbtjhge3.js.map +1 -0
  79. package/dist/{policy-drift-C-m0uWHH.js → policy-drift-BVMyqHSa.js} +29 -29
  80. package/dist/policy-drift-BVMyqHSa.js.map +1 -0
  81. package/dist/{push-index-adoption-Cp7oZxSl.js → push-index-adoption-hpHTyXMR.js} +7 -7
  82. package/dist/push-index-adoption-hpHTyXMR.js.map +1 -0
  83. package/dist/{push-index-prebuild-DbwKGtQT.js → push-index-prebuild-Bty9F7bD.js} +6 -6
  84. package/dist/push-index-prebuild-Bty9F7bD.js.map +1 -0
  85. package/dist/{push-kept-defaults-CLcgsEPt.js → push-kept-defaults-Bst4MDup.js} +13 -16
  86. package/dist/push-kept-defaults-Bst4MDup.js.map +1 -0
  87. package/dist/{push-legacy-renames-BthD0E9W.js → push-legacy-renames-bB4bM6br.js} +6 -6
  88. package/dist/push-legacy-renames-bB4bM6br.js.map +1 -0
  89. package/dist/{push-policy-plan-BgcrroxQ.js → push-policy-plan-BI8U4BOD.js} +11 -11
  90. package/dist/push-policy-plan-BI8U4BOD.js.map +1 -0
  91. package/dist/{render-ddl-Ci3S_SoI.js → render-ddl-D4n86NHz.js} +14 -7
  92. package/dist/render-ddl-D4n86NHz.js.map +1 -0
  93. package/dist/{request-role-cli-Dy1EgJU9.js → request-role-cli-BdRzdE87.js} +11 -11
  94. package/dist/{request-role-cli-Dy1EgJU9.js.map → request-role-cli-BdRzdE87.js.map} +1 -1
  95. package/dist/{request-role-migration-GHTJnPMV.js → request-role-migration-C8aq_TO3.js} +2 -2
  96. package/dist/{request-role-migration-GHTJnPMV.js.map → request-role-migration-C8aq_TO3.js.map} +1 -1
  97. package/dist/{rls-enforcement-Cc_UhOxb.js → rls-enforcement-DB5HHj96.js} +19 -19
  98. package/dist/rls-enforcement-DB5HHj96.js.map +1 -0
  99. package/dist/{rls-settings-BCGMIig3.js → rls-settings-CmGK2U0a.js} +2 -2
  100. package/dist/rls-settings-CmGK2U0a.js.map +1 -0
  101. package/dist/schema/auth-users-columns.d.ts +1 -11
  102. package/dist/schema/catalogue-schema.d.ts +33 -29
  103. package/dist/schema/classify-change.d.ts +23 -16
  104. package/dist/schema/column-type-drift.d.ts +16 -0
  105. package/dist/schema/config-relations.d.ts +10 -9
  106. package/dist/schema/deferred-index-build.d.ts +1 -1
  107. package/dist/schema/doctor-cli.js +1544 -66
  108. package/dist/schema/doctor-cli.js.map +1 -1
  109. package/dist/schema/doctor-database.d.ts +7 -7
  110. package/dist/schema/doctor-policy-checks.d.ts +4 -4
  111. package/dist/schema/doctor-search-scale.d.ts +14 -14
  112. package/dist/schema/doctor.d.ts +27 -27
  113. package/dist/schema/dynamic-tables.d.ts +6 -5
  114. package/dist/schema/{ensure-collection-policies.d.ts → ensure-policies.d.ts} +20 -20
  115. package/dist/schema/{ensure-collection-tables.d.ts → ensure-tables.d.ts} +11 -11
  116. package/dist/schema/enum-labels-kept.d.ts +6 -6
  117. package/dist/schema/generate-drizzle-schema-logic.d.ts +3 -3
  118. package/dist/schema/generate-drizzle-schema.js +1 -1
  119. package/dist/schema/generate-files.d.ts +6 -6
  120. package/dist/schema/generate-postgres-ddl-logic.d.ts +23 -20
  121. package/dist/schema/generate-postgres-ddl.js +11 -11
  122. package/dist/schema/generate-postgres-ddl.js.map +1 -1
  123. package/dist/schema/generate-schema-commit.d.ts +13 -8
  124. package/dist/schema/generated-schema-diff.d.ts +16 -16
  125. package/dist/schema/generated-schema-staleness.d.ts +11 -11
  126. package/dist/schema/index-adoption.d.ts +4 -4
  127. package/dist/schema/introspect-db-customization.d.ts +47 -0
  128. package/dist/schema/introspect-db-inference.d.ts +30 -9
  129. package/dist/schema/introspect-db-logic.d.ts +79 -110
  130. package/dist/schema/introspect-db-project.d.ts +15 -18
  131. package/dist/schema/introspect-db-queries.d.ts +1 -1
  132. package/dist/schema/introspect-db-search.d.ts +25 -4
  133. package/dist/schema/introspect-db-storage.d.ts +4 -74
  134. package/dist/schema/introspect-db.js +102 -90
  135. package/dist/schema/introspect-db.js.map +1 -1
  136. package/dist/schema/introspect-runtime.d.ts +47 -36
  137. package/dist/schema/introspect-tables.d.ts +182 -0
  138. package/dist/schema/load-tables.d.ts +55 -0
  139. package/dist/schema/migrate-policy-stamps.d.ts +4 -4
  140. package/dist/schema/migration-freshness.d.ts +13 -13
  141. package/dist/schema/plan/column-order.d.ts +82 -0
  142. package/dist/schema/plan/diff-plan.d.ts +9 -3
  143. package/dist/schema/plan/plan-schema.d.ts +55 -52
  144. package/dist/schema/plan/render-drizzle.d.ts +1 -1
  145. package/dist/schema/plan/types.d.ts +24 -15
  146. package/dist/schema/push-index-adoption.d.ts +3 -3
  147. package/dist/schema/push-index-prebuild.d.ts +3 -3
  148. package/dist/schema/push-kept-defaults.d.ts +7 -7
  149. package/dist/schema/push-legacy-renames.d.ts +3 -3
  150. package/dist/schema/push-policy-plan.d.ts +5 -5
  151. package/dist/schema/reconcile-schema.d.ts +5 -5
  152. package/dist/schema/relation-names.d.ts +15 -20
  153. package/dist/schema/render-outputs.d.ts +76 -0
  154. package/dist/schema/search-column.d.ts +11 -43
  155. package/dist/schema/{collection-index.d.ts → table-index.d.ts} +21 -42
  156. package/dist/schema/{collections-schema-version.d.ts → tables-schema-version.d.ts} +8 -2
  157. package/dist/schema/vector-index.d.ts +24 -28
  158. package/dist/{search-column-BM-GV6vH.js → search-column-BO-WND-B.js} +86 -149
  159. package/dist/search-column-BO-WND-B.js.map +1 -0
  160. package/dist/security/caller-sql-columns.d.ts +9 -6
  161. package/dist/security/policy-drift.d.ts +14 -14
  162. package/dist/security/rls-enforcement.d.ts +19 -25
  163. package/dist/security/rls-settings.d.ts +2 -2
  164. package/dist/security/served-table-protection.d.ts +125 -0
  165. package/dist/services/FetchService.d.ts +22 -133
  166. package/dist/services/PersistService.d.ts +6 -17
  167. package/dist/services/RelationService.d.ts +57 -106
  168. package/dist/services/RelationWriteService.d.ts +59 -66
  169. package/dist/services/cdc/identity-columns.d.ts +7 -5
  170. package/dist/services/cdc/junction-tables.d.ts +14 -14
  171. package/dist/services/collection-helpers.d.ts +52 -95
  172. package/dist/services/dataService.d.ts +15 -12
  173. package/dist/services/field-op-sql.d.ts +11 -9
  174. package/dist/services/field-viewer.d.ts +12 -11
  175. package/dist/services/hidden-columns.d.ts +30 -0
  176. package/dist/services/index.d.ts +1 -1
  177. package/dist/services/junction-writes.d.ts +37 -18
  178. package/dist/services/nested-path.d.ts +18 -18
  179. package/dist/services/read-field-access.d.ts +23 -7
  180. package/dist/services/read-scope.d.ts +10 -9
  181. package/dist/services/realtimeService.d.ts +25 -10
  182. package/dist/services/relation-tables.d.ts +97 -0
  183. package/dist/services/row-pipeline.d.ts +50 -69
  184. package/dist/services/soft-delete.d.ts +25 -24
  185. package/dist/services/table-hooks.d.ts +146 -0
  186. package/dist/services/view-access.d.ts +7 -7
  187. package/dist/services/write-transaction-scope.d.ts +1 -1
  188. package/dist/{source-fZb92pN8.js → source-VxbrQojV.js} +111 -79
  189. package/dist/source-VxbrQojV.js.map +1 -0
  190. package/dist/{collections-schema-version-D7bDI0PJ.js → tables-schema-version-YvZIBlOP.js} +12 -6
  191. package/dist/tables-schema-version-YvZIBlOP.js.map +1 -0
  192. package/dist/utils/drizzle-conditions.d.ts +70 -84
  193. package/dist/utils/pg-array-null-patch.d.ts +27 -10
  194. package/dist/utils/pg-error-utils.d.ts +4 -4
  195. package/dist/{vector-index-DsQ3V2d2.js → vector-index-VSh3ufTd.js} +62 -54
  196. package/dist/vector-index-VSh3ufTd.js.map +1 -0
  197. package/dist/{websocket-B7ex6AQM.js → websocket-BevXvwfo.js} +51 -40
  198. package/dist/websocket-BevXvwfo.js.map +1 -0
  199. package/dist/websocket.d.ts +2 -2
  200. package/package.json +7 -7
  201. package/dist/auth-users-columns-C72EMoDJ.js.map +0 -1
  202. package/dist/cli-collections-path.d.ts +0 -31
  203. package/dist/cli-console-DBPw-oAz.js.map +0 -1
  204. package/dist/cli-errors-DYTxnLbW.js.map +0 -1
  205. package/dist/collections/PostgresCollectionRegistry.d.ts +0 -47
  206. package/dist/collections/buildRegistry.d.ts +0 -27
  207. package/dist/collections-schema-version-D7bDI0PJ.js.map +0 -1
  208. package/dist/column-plan-helpers-BeSztMor.js +0 -161
  209. package/dist/column-plan-helpers-BeSztMor.js.map +0 -1
  210. package/dist/database-preflight-iBpT7-vv.js.map +0 -1
  211. package/dist/deferred-index-build-BCU9RoHK.js.map +0 -1
  212. package/dist/doctor-Kg1oUK0Q.js +0 -1458
  213. package/dist/doctor-Kg1oUK0Q.js.map +0 -1
  214. package/dist/ensure-collection-policies-Bo-_fDAy.js.map +0 -1
  215. package/dist/ensure-collection-tables-DCJINkT_.js.map +0 -1
  216. package/dist/ensure-tables-BPGaGh0y.js.map +0 -1
  217. package/dist/enum-labels-kept-YAgOZS4I.js.map +0 -1
  218. package/dist/generate-drizzle-schema-DcrFr7YX.js.map +0 -1
  219. package/dist/generate-drizzle-schema-logic-LTLZvt6r.js.map +0 -1
  220. package/dist/generate-files-CsaVzatS.js.map +0 -1
  221. package/dist/generate-next-step-DgK5BlBn.js.map +0 -1
  222. package/dist/generate-postgres-ddl-logic-Dg0bcENZ.js.map +0 -1
  223. package/dist/generated-schema-diff-By4dxyTH.js.map +0 -1
  224. package/dist/generated-schema-staleness-BvNF3i-s.js.map +0 -1
  225. package/dist/introspect-db-logic-DWqAEURB.js +0 -2047
  226. package/dist/introspect-db-logic-DWqAEURB.js.map +0 -1
  227. package/dist/introspect-db-queries-DevUrzll.js.map +0 -1
  228. package/dist/migrate-baseline-CmWXL7qx.js.map +0 -1
  229. package/dist/migrate-policy-stamps-BN_Qad6c.js.map +0 -1
  230. package/dist/open-rebase-40paQfVW.js.map +0 -1
  231. package/dist/pg-error-utils-DJHjCF7-.js.map +0 -1
  232. package/dist/plan-schema-vJd3UEmT.js +0 -1604
  233. package/dist/plan-schema-vJd3UEmT.js.map +0 -1
  234. package/dist/policy-drift-C-m0uWHH.js.map +0 -1
  235. package/dist/push-index-adoption-Cp7oZxSl.js.map +0 -1
  236. package/dist/push-index-prebuild-DbwKGtQT.js.map +0 -1
  237. package/dist/push-kept-defaults-CLcgsEPt.js.map +0 -1
  238. package/dist/push-legacy-renames-BthD0E9W.js.map +0 -1
  239. package/dist/push-policy-plan-BgcrroxQ.js.map +0 -1
  240. package/dist/render-ddl-Ci3S_SoI.js.map +0 -1
  241. package/dist/rls-enforcement-Cc_UhOxb.js.map +0 -1
  242. package/dist/rls-settings-BCGMIig3.js.map +0 -1
  243. package/dist/schema/column-plan-helpers.d.ts +0 -161
  244. package/dist/schema/introspect-db-naming.d.ts +0 -10
  245. package/dist/search-column-BM-GV6vH.js.map +0 -1
  246. package/dist/source-fZb92pN8.js.map +0 -1
  247. package/dist/vector-index-DsQ3V2d2.js.map +0 -1
  248. package/dist/websocket-B7ex6AQM.js.map +0 -1
@@ -0,0 +1,146 @@
1
+ /**
2
+ * How the Postgres driver runs a table's hooks: the global ones, the table's
3
+ * own (`defineTable({ hooks })`, or `setTableHooks`), and its columns'
4
+ * field-level `.transform()`s — native `TableHooks`, read off the compiled
5
+ * table the registry holds, with their real props (`table` is the descriptor).
6
+ *
7
+ * The order, everywhere: **global, then the table's, then its columns'**. A
8
+ * column transform has only `beforeSave` and `afterRead`, so the other five
9
+ * hooks run global then table.
10
+ *
11
+ * `afterRead` masks what a caller must not see, so every path a row leaves
12
+ * the server by runs it exactly once, through {@link afterReadOnRows}: the
13
+ * driver's fetches, the REST/SDK fetch service, the realtime initial fetch and
14
+ * refetches, a write's own response. That one function also masks a row's
15
+ * embedded relations — at every level an `include` loaded — with each TARGET
16
+ * table's hooks, so `comment.post.author.email` is the authors table's to
17
+ * mask, never served raw.
18
+ *
19
+ * @module
20
+ */
21
+ import { type ColumnTransform, type EntityStatus, type RebaseCallContext, type TableDescriptor, type TableHooks, type TableRow, type TransformNode } from "@rebasepro/types";
22
+ import type { PostgresTableRegistry } from "../model/PostgresTableRegistry.js";
23
+ import type { RuntimeTable } from "../model/runtime-table.js";
24
+ /**
25
+ * The hooks that apply to one table, resolved once per operation.
26
+ *
27
+ * `table` is `undefined` when the path names no table this driver serves;
28
+ * then only global hooks can be present, and running one is refused (see
29
+ * {@link requireHookTable}) — a hook with no table to be told about cannot run,
30
+ * and one that does not run on a masked read is a leak.
31
+ */
32
+ export interface TableHookSet {
33
+ /** The table the hooks run for. */
34
+ readonly table: RuntimeTable | undefined;
35
+ /** The global hooks, which run for every table (`initializeRebaseBackend({ hooks })`, `openRebase({ hooks })`). */
36
+ readonly global: TableHooks | undefined;
37
+ /** The table's own hooks. */
38
+ readonly own: TableHooks | undefined;
39
+ /** The table's field-level hooks, one tree per column key. */
40
+ readonly transforms: Record<string, TransformNode> | undefined;
41
+ }
42
+ /** A hook set with nothing in it. */
43
+ export declare const NO_HOOKS: TableHookSet;
44
+ /**
45
+ * The hooks for the table a path addresses.
46
+ *
47
+ * The path is resolved through the registry (`registry.tableAt`: a slug, or a
48
+ * nested path such as `posts/1/comments`, which addresses `comments`). A path
49
+ * that names no table has only the global hooks.
50
+ */
51
+ export declare function resolveTableHooks(registry: PostgresTableRegistry | undefined, path: string): TableHookSet;
52
+ /** The hooks of a runtime table already in hand (a relation's target). */
53
+ export declare function hookSetOf(registry: PostgresTableRegistry | undefined, table: RuntimeTable | undefined): TableHookSet;
54
+ /** Whether any column of the set declares the field-level `hook`. */
55
+ export declare function transformsDeclare(set: TableHookSet, hook: keyof ColumnTransform): boolean;
56
+ /** Whether `afterRead` runs for this table, on any tier. */
57
+ export declare function hasAfterRead(set: TableHookSet): boolean;
58
+ /** Whether `beforeSave` runs for this table, on any tier. */
59
+ export declare function hasBeforeSave(set: TableHookSet): boolean;
60
+ /** Whether `beforeQuery` runs for this table (global or the table's: a column has none). */
61
+ export declare function hasBeforeQueryHook(set: TableHookSet): boolean;
62
+ /** Whether a hook of this name runs for this table, global or the table's. */
63
+ export declare function hasRowHook(set: TableHookSet, hook: keyof TableHooks): boolean;
64
+ /** Whether any application code at all runs for this table: a hook on any tier, or a transform. */
65
+ export declare function declaresAnyHook(set: TableHookSet): boolean;
66
+ /**
67
+ * The descriptor every hook of the set is told about. Throws a 404 naming the
68
+ * path when there is no table — only a global hook can bring a call here
69
+ * without one, and it cannot be run for a table that is not there.
70
+ */
71
+ export declare function requireHookTable(set: TableHookSet, path: string): TableDescriptor;
72
+ /**
73
+ * `afterRead` on one row of the set's table: global, then the table's, then
74
+ * its columns' transforms. Each tier sees the row the previous one returned;
75
+ * a tier that returns nothing leaves it as it was.
76
+ */
77
+ export declare function afterReadOnRow(set: TableHookSet, row: TableRow, path: string, context: RebaseCallContext): Promise<TableRow>;
78
+ /**
79
+ * Whether {@link afterReadOnRows} would run anything for rows of this table:
80
+ * its own `afterRead` on any tier, or that of any table an `include` reaches
81
+ * from it, at any depth.
82
+ */
83
+ export declare function afterReadApplies(registry: PostgresTableRegistry | undefined, set: TableHookSet): boolean;
84
+ /**
85
+ * `afterRead` on rows leaving the server — THE read chain, for every path.
86
+ *
87
+ * Runs {@link afterReadOnRow} on each row, then walks the row's embedded
88
+ * relations — whatever an `include` attached under a relation's name, a row
89
+ * or a list, to-one, to-many, many-to-many and `via` alike — and runs each
90
+ * TARGET table's chain on them, then theirs, down to the last level the
91
+ * include tree loaded. The walk follows the rows, so it is bounded by the
92
+ * include that produced them, never by a fixed depth; a self-referencing
93
+ * include (`parent.parent`) is walked level by level like any other. A
94
+ * many-to-many row's `_pivot` rides on the target row, so the target's
95
+ * hooks (global included) see it; a pivot column has no field hooks of its
96
+ * own (the compiler refuses `.transform()` there).
97
+ *
98
+ * An embedded row is handed to the hooks as a copy: a related row the
99
+ * loader shares between two parents is not masked twice, nor masked for one
100
+ * parent by a hook another level ran. An object that contains itself is
101
+ * refused (it could not be served anyway).
102
+ *
103
+ * `context` is asked for only when a hook will run, so a table without hooks
104
+ * (and none reachable) costs a map lookup per relation. `onHookRun` is called
105
+ * once, before the first hook runs: the driver notes application code on the
106
+ * write scope there.
107
+ */
108
+ export declare function afterReadOnRows(registry: PostgresTableRegistry | undefined, set: TableHookSet, rows: TableRow[], path: string, context: () => RebaseCallContext, onHookRun?: () => void): Promise<TableRow[]>;
109
+ /** What a write's hooks are told about it. */
110
+ export interface WriteHookCall {
111
+ path: string;
112
+ id: string | number | undefined;
113
+ previousValues: TableRow | undefined;
114
+ status: EntityStatus;
115
+ context: RebaseCallContext;
116
+ }
117
+ /**
118
+ * `beforeSave`: global, then the table's, then its columns' transforms. A
119
+ * tier's returned object is shallow-merged over the values; a tier that
120
+ * returns nothing changes nothing. A throw propagates (the driver answers it
121
+ * as `CALLBACK_REJECTED`).
122
+ */
123
+ export declare function beforeSave<V extends TableRow>(set: TableHookSet, values: V, call: WriteHookCall): Promise<V>;
124
+ /** `afterSave`: global, then the table's, each awaited. */
125
+ export declare function afterSave(set: TableHookSet, savedId: string | number, values: TableRow, call: WriteHookCall): Promise<void>;
126
+ /**
127
+ * `afterSaveError`: global, then the table's — each on its own, guarded: a
128
+ * hook that throws is handed to `onThrow` and the next still runs, so it can
129
+ * never replace the failure the caller is owed.
130
+ */
131
+ export declare function afterSaveError(set: TableHookSet, values: TableRow, error: unknown, call: WriteHookCall, onThrow: (tier: "global" | "table", hookError: unknown) => void): Promise<void>;
132
+ /** What a delete's hooks are told about it. */
133
+ export interface DeleteHookCall {
134
+ path: string;
135
+ id: string | number;
136
+ /** The row being deleted, as stored. */
137
+ values: TableRow;
138
+ context: RebaseCallContext;
139
+ }
140
+ /**
141
+ * `beforeDelete`: global, then the table's. Every tier runs; `true` back when
142
+ * any returned `false` (a veto). A throw propagates.
143
+ */
144
+ export declare function beforeDeleteVetoes(set: TableHookSet, call: DeleteHookCall): Promise<boolean>;
145
+ /** `afterDelete`: global, then the table's, each awaited. */
146
+ export declare function afterDelete(set: TableHookSet, call: DeleteHookCall): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * What a collection that serves a SQL view (`PostgresCollectionConfig.view`)
2
+ * What a table that serves a SQL view (`defineView`, `descriptor.kind === "view"`)
3
3
  * allows: reads, and for a materialized view only by the roles it names.
4
4
  *
5
5
  * A plain view runs as the caller (`security_invoker`), so the policies of the
@@ -10,12 +10,12 @@
10
10
  * `beforeQueryConditions`) — and not of the server's own work, which reads
11
11
  * with no viewer at all.
12
12
  */
13
- import { type CollectionConfig } from "@rebasepro/types";
13
+ import type { TableDescriptor } from "@rebasepro/types";
14
14
  import { DEFAULT_VIEW_ROLES } from "../schema/plan/view-names.js";
15
15
  export { DEFAULT_VIEW_ROLES };
16
- /** Whether a collection serves a view rather than a table. */
17
- export declare function isViewCollection(collection: CollectionConfig | undefined): boolean;
16
+ /** Whether a table serves a view rather than a stored table. */
17
+ export declare function isViewTable(table: TableDescriptor | undefined): boolean;
18
18
  /** Refuse a caller who holds none of a materialized view's roles. A no-op for anything else. */
19
- export declare function assertViewReadable(collection: CollectionConfig | undefined): void;
20
- /** Refuse a write to a collection that serves a view. */
21
- export declare function assertCollectionWritable(collection: CollectionConfig | undefined, path: string): void;
19
+ export declare function assertViewReadable(table: TableDescriptor | undefined): void;
20
+ /** Refuse a write to a table that serves a view. */
21
+ export declare function assertTableWritable(table: TableDescriptor | undefined, path: string): void;
@@ -77,7 +77,7 @@ export declare class WriteTransactionScope implements AmbientTransaction {
77
77
  */
78
78
  assertCommittable(): Promise<void>;
79
79
  /**
80
- * Application code — a collection, global or property hook, a
80
+ * Application code — a global or table hook, a column `.transform()`, a
81
81
  * `beforeQuery` — is about to run on this transaction, so it may catch a
82
82
  * failed statement and leave the transaction aborted: the commit then has
83
83
  * to ask ({@link assertCommittable}).
@@ -1,29 +1,27 @@
1
1
  import { createRequire as __createRequire } from "module";
2
2
  __createRequire(import.meta.url);
3
3
  import { i as __exportAll } from "./cli-prompt-DXG0yk-h.js";
4
- import { isPostgresCollectionConfig, parseEnvBoolean } from "@rebasepro/types";
5
- import { getTableName, resolveCollectionRelations } from "@rebasepro/common";
4
+ import { parseEnvBoolean } from "@rebasepro/types";
5
+ import { columnByKey, columnNameOf } from "@rebasepro/common";
6
6
  import { sha1Hex, truncateToBytes } from "@rebasepro/utils";
7
7
  import process$1 from "node:process";
8
8
  import os from "node:os";
9
9
  import tty from "node:tty";
10
- //#region src/schema/collection-index.ts
11
- var collection_index_exports = /* @__PURE__ */ __exportAll({
12
- CollectionIndexConfigError: () => CollectionIndexConfigError,
10
+ //#region src/schema/table-index.ts
11
+ var table_index_exports = /* @__PURE__ */ __exportAll({
13
12
  FOREIGN_KEY_INDEX_REASON: () => FOREIGN_KEY_INDEX_REASON,
14
13
  MAX_INDEX_KEYS: () => 5,
15
- buildCollectionIndexPlan: () => buildCollectionIndexPlan,
16
- buildCollectionIndexSpecs: () => buildCollectionIndexSpecs,
17
- collectionIndexStatement: () => collectionIndexStatement,
18
- collectionIndexStatements: () => collectionIndexStatements,
14
+ TableIndexConfigError: () => TableIndexConfigError,
15
+ buildTableIndexSpecs: () => buildTableIndexSpecs,
19
16
  deriveIndexName: () => deriveIndexName,
20
17
  foreignKeyIndexSpec: () => foreignKeyIndexSpec,
21
18
  indexFingerprint: () => indexFingerprint,
22
19
  isRebaseIndexName: () => isRebaseIndexName,
23
20
  leadsWithColumn: () => leadsWithColumn,
24
21
  renderPredicate: () => renderPredicate,
25
- resolveIndexableColumn: () => resolveIndexableColumn,
26
- sortIndexSpecs: () => sortIndexSpecs
22
+ sortIndexSpecs: () => sortIndexSpecs,
23
+ tableIndexStatement: () => tableIndexStatement,
24
+ tableIndexStatements: () => tableIndexStatements
27
25
  });
28
26
  /**
29
27
  * A declaration that cannot become an index.
@@ -32,12 +30,12 @@ var collection_index_exports = /* @__PURE__ */ __exportAll({
32
30
  * the alternative is a `CREATE INDEX` that fails during a push with a Postgres
33
31
  * error mentioning a column the author never wrote.
34
32
  */
35
- var CollectionIndexConfigError = class extends Error {
33
+ var TableIndexConfigError = class extends Error {
36
34
  collectionSlug;
37
35
  position;
38
36
  constructor(collectionSlug, position, message) {
39
37
  super(`${collectionSlug}.indexes[${position}]: ${message}`);
40
- this.name = "CollectionIndexConfigError";
38
+ this.name = "TableIndexConfigError";
41
39
  this.collectionSlug = collectionSlug;
42
40
  this.position = position;
43
41
  }
@@ -133,7 +131,7 @@ var renderPredicate = (predicate) => {
133
131
  * nothing for a UNIQUE index — the rendered text is `CREATE UNIQUE INDEX …`
134
132
  * and the pattern never matches.
135
133
  */
136
- var collectionIndexStatement = (spec, options = {}) => {
134
+ var tableIndexStatement = (spec, options = {}) => {
137
135
  const unique = spec.unique ? "UNIQUE " : "";
138
136
  const concurrently = options.concurrently ? "CONCURRENTLY " : "";
139
137
  const ifNotExists = options.ifNotExists ? "IF NOT EXISTS " : "";
@@ -149,33 +147,82 @@ var collectionIndexStatement = (spec, options = {}) => {
149
147
  const where = spec.predicate ? ` WHERE ${renderPredicate(spec.predicate)}` : "";
150
148
  return `CREATE ${unique}INDEX ${concurrently}${ifNotExists}"${spec.indexName}" ON "${spec.schema}"."${spec.table}"${using} (${keys})${include}${where};`;
151
149
  };
152
- var collectionIndexStatements = (specs, options = {}) => specs.map((spec) => collectionIndexStatement(spec, options));
153
- var relationOf = (collection, propKey) => resolveCollectionRelations(collection)[propKey];
150
+ var tableIndexStatements = (specs, options = {}) => specs.map((spec) => tableIndexStatement(spec, options));
151
+ var tableIndexKey = (entry) => typeof entry === "string" ? { key: entry } : {
152
+ key: entry.column,
153
+ ...entry.direction !== void 0 ? { direction: entry.direction } : {},
154
+ ...entry.nulls !== void 0 ? { nulls: entry.nulls } : {}
155
+ };
156
+ var tablePredicate = (predicate) => {
157
+ if ("and" in predicate) return { and: predicate.and.map(tablePredicate) };
158
+ switch (predicate.op) {
159
+ case "is null":
160
+ case "is not null": return {
161
+ key: predicate.column,
162
+ op: predicate.op
163
+ };
164
+ case "in": return {
165
+ key: predicate.column,
166
+ op: "in",
167
+ value: predicate.value
168
+ };
169
+ default: return {
170
+ key: predicate.column,
171
+ op: predicate.op,
172
+ value: predicate.value
173
+ };
174
+ }
175
+ };
176
+ var tableIndexSource = (index) => ({
177
+ on: index.columns.map(tableIndexKey),
178
+ ...index.using !== void 0 ? { using: index.using } : {},
179
+ ...index.unique !== void 0 ? { unique: index.unique } : {},
180
+ ...index.include !== void 0 ? { include: index.include } : {},
181
+ ...index.where !== void 0 ? { where: tablePredicate(index.where) } : {},
182
+ ...index.reason !== void 0 ? { reason: index.reason } : {}
183
+ });
154
184
  /**
155
- * The column a property key indexes.
156
- *
157
- * A `belongsTo` resolves to its `localKey` — `primaryCategory` becomes
158
- * `primary_category_id` — which is the case an index is most often wanted for
159
- * and the case where the property key and the column differ. Everything else
160
- * goes through `resolveColumnName`.
185
+ * The SQL column an index key names on a table: a column key, or a
186
+ * `belongsTo` relation (its foreign-key column). Another relation kind has no
187
+ * column here — its foreign key is on the target, or in a junction.
188
+ */
189
+ var tableIndexColumn = (table, key, fail) => {
190
+ const column = columnByKey(table, key);
191
+ if (column) return column.column;
192
+ const relation = table.relations.find((candidate) => candidate.name === key);
193
+ if (relation?.kind === "belongsTo") return relation.localKey;
194
+ if (relation) return fail(`"${key}" is a ${relation.kind} relation, which has no column on this table — the foreign key lives on "${relation.target}". Declare the index there.`);
195
+ return fail(`"${key}" is no column key or \`belongsTo\` relation of this table.`);
196
+ };
197
+ /**
198
+ * Every index one table declares (`indexes`), resolved and named, read from
199
+ * its descriptor — what the planner calls, for a table and for a
200
+ * materialized view's stored rows alike.
161
201
  *
162
- * The other relation kinds have no local column at all: the foreign key lives
163
- * on the target's table, or in a junction. Indexing them here is refused
164
- * rather than resolved to a column that does not exist.
202
+ * Throws {@link TableIndexConfigError} rather than dropping a bad entry.
165
203
  */
166
- var resolveIndexableColumn = (collection, propKey, resolveColumnName, fail) => {
167
- const relation = relationOf(collection, propKey);
168
- if (relation) {
169
- if (relation.kind === "belongsTo") return relation.localKey;
170
- fail(`"${propKey}" is a ${relation.kind} relation, which has no column on this table — the foreign key lives on "${relation.targetSlug}". Declare the index there.`);
171
- }
172
- const property = collection.properties?.[propKey];
173
- if (!property) fail(`"${propKey}" is not a property of this collection.`);
174
- return resolveColumnName(propKey, property);
204
+ var buildTableIndexSpecs = (table) => {
205
+ const declared = table.indexes;
206
+ if (!declared || declared.length === 0) return [];
207
+ return indexSpecsFrom({
208
+ slug: table.slug,
209
+ schema: table.schema,
210
+ table: table.table,
211
+ primaryKey: table.primaryKey.map((key) => columnNameOf(table, key) ?? key),
212
+ indexes: declared.map(tableIndexSource),
213
+ column: (key, fail) => tableIndexColumn(table, key, fail),
214
+ declaresUnique: (key) => {
215
+ const column = columnByKey(table, key);
216
+ if (column) return column.unique === true;
217
+ const relation = table.relations.find((candidate) => candidate.name === key);
218
+ if (relation?.kind !== "belongsTo") return false;
219
+ return table.columns.some((candidate) => candidate.column === relation.localKey && candidate.unique === true);
220
+ }
221
+ });
175
222
  };
176
- var resolvePredicate = (collection, predicate, resolveColumnName, fail) => {
177
- if ("and" in predicate) return { and: predicate.and.map((p) => resolvePredicate(collection, p, resolveColumnName, fail)) };
178
- const column = resolveIndexableColumn(collection, predicate.prop, resolveColumnName, fail);
223
+ var resolveSourcePredicate = (source, predicate, fail) => {
224
+ if ("and" in predicate) return { and: predicate.and.map((p) => resolveSourcePredicate(source, p, fail)) };
225
+ const column = source.column(predicate.key, fail);
179
226
  switch (predicate.op) {
180
227
  case "is null":
181
228
  case "is not null": return {
@@ -183,7 +230,7 @@ var resolvePredicate = (collection, predicate, resolveColumnName, fail) => {
183
230
  op: predicate.op
184
231
  };
185
232
  case "in":
186
- if (new Set(predicate.value).size !== predicate.value.length) fail(`the \`in\` list for "${predicate.prop}" repeats a value, which changes nothing.`);
233
+ if (new Set(predicate.value).size !== predicate.value.length) fail(`the \`in\` list for "${predicate.key}" repeats a value, which changes nothing.`);
187
234
  return {
188
235
  column,
189
236
  op: "in",
@@ -196,57 +243,43 @@ var resolvePredicate = (collection, predicate, resolveColumnName, fail) => {
196
243
  };
197
244
  }
198
245
  };
199
- /** The primary key columns of a collection, for the "you already have this" refusal. */
200
- var primaryKeyColumns = (collection, resolveColumnName) => Object.entries(collection.properties ?? {}).filter(([, prop]) => prop && typeof prop === "object" && "isId" in prop && Boolean(prop.isId)).map(([key, prop]) => resolveColumnName(key, prop));
201
- /**
202
- * Every index one collection declares, resolved and named.
203
- *
204
- * Throws {@link CollectionIndexConfigError} rather than dropping a bad entry:
205
- * an index that silently does not exist is the failure mode this whole feature
206
- * is here to remove.
207
- */
208
- var buildCollectionIndexSpecs = (collection, resolveColumnName) => {
209
- if (!isPostgresCollectionConfig(collection)) return [];
210
- const declared = collection.indexes;
211
- if (!declared || declared.length === 0) return [];
212
- const slug = collection.slug ?? getTableName(collection);
213
- const schema = collection.schema ?? "public";
214
- const table = getTableName(collection);
215
- const pk = primaryKeyColumns(collection, resolveColumnName).sort().join(",");
246
+ var indexSpecsFrom = (source) => {
247
+ const { slug, schema, table } = source;
248
+ const pk = [...source.primaryKey].sort().join(",");
216
249
  const specs = [];
217
250
  const byName = /* @__PURE__ */ new Map();
218
- declared.forEach((index, position) => {
251
+ source.indexes.forEach((index, position) => {
219
252
  const fail = (message) => {
220
- throw new CollectionIndexConfigError(slug, position, message);
253
+ throw new TableIndexConfigError(slug, position, message);
221
254
  };
222
- if (typeof index.reason !== "string" || index.reason.trim() === "") fail("`reason` is required — see the doc comment. An index nobody can justify is one nobody can delete.");
223
- if (!Array.isArray(index.on) || index.on.length === 0) fail("`on` must name at least one property.");
255
+ if (index.on.length === 0) fail("`on` must name at least one column.");
224
256
  if (index.on.length > 5) fail(`\`on\` has ${index.on.length} keys; the limit is 5. Payload columns belong in \`include\`.`);
225
257
  const method = index.using ?? "btree";
226
258
  const unique = method === "btree" && Boolean(index.unique);
227
259
  if (!isOrderedMethod(method)) {
228
- for (const key of index.on) if (typeof key !== "string" && ("direction" in key || "nulls" in key)) fail(`access method "${method}" does not support ASC/DESC or NULLS options.`);
260
+ for (const key of index.on) if (key.direction !== void 0 || key.nulls !== void 0) fail(`access method "${method}" does not support ASC/DESC or NULLS options.`);
229
261
  }
230
262
  const keys = index.on.map((key) => {
231
- const column = resolveIndexableColumn(collection, typeof key === "string" ? key : key.prop, resolveColumnName, fail);
232
- const direction = (typeof key === "string" ? void 0 : key.direction) ?? "asc";
263
+ const column = source.column(key.key, fail);
264
+ const direction = key.direction ?? "asc";
233
265
  return {
234
266
  column,
235
267
  direction,
236
- nulls: (typeof key === "string" ? void 0 : key.nulls) ?? (direction === "desc" ? "first" : "last")
268
+ nulls: key.nulls ?? (direction === "desc" ? "first" : "last")
237
269
  };
238
270
  });
239
271
  const duplicateKey = keys.map((k) => k.column).find((c, i, all) => all.indexOf(c) !== i);
240
272
  if (duplicateKey) fail(`"${duplicateKey}" appears twice in \`on\`.`);
241
273
  if (keys.map((k) => k.column).sort().join(",") === pk && pk !== "") fail(`this is the primary key — "${table}_pkey" already indexes exactly these columns.`);
242
- const include = (index.include ?? []).map((propKey) => resolveIndexableColumn(collection, propKey, resolveColumnName, fail));
274
+ const include = (index.include ?? []).map((key) => source.column(key, fail));
243
275
  const overlap = include.find((c) => keys.some((k) => k.column === c));
244
276
  if (overlap) fail(`"${overlap}" is in both \`on\` and \`include\`; Postgres rejects the overlap.`);
245
277
  if (unique && keys.length === 1) {
246
- const propKey = typeof index.on[0] === "string" ? index.on[0] : index.on[0].prop;
247
- if ((collection.properties?.[propKey])?.validation?.unique) fail(`"${propKey}" already declares \`validation.unique\`, which compiles to an inline UNIQUE. Two declarations of one guarantee — remove one.`);
278
+ const key = index.on[0].key;
279
+ if (source.declaresUnique(key)) fail(`"${key}" already declares a single-column UNIQUE (\`.unique()\`, legacy \`validation.unique\`). Two declarations of one guarantee — remove one.`);
248
280
  }
249
- const predicate = index.where ? resolvePredicate(collection, index.where, resolveColumnName, fail) : null;
281
+ const predicate = index.where ? resolveSourcePredicate(source, index.where, fail) : null;
282
+ const reason = index.reason === void 0 || index.reason.trim() === "" ? {} : { reason: index.reason };
250
283
  const withoutName = {
251
284
  schema,
252
285
  table,
@@ -255,7 +288,7 @@ var buildCollectionIndexSpecs = (collection, resolveColumnName) => {
255
288
  keys,
256
289
  include,
257
290
  predicate,
258
- reason: index.reason
291
+ ...reason
259
292
  };
260
293
  const indexName = deriveIndexName(withoutName);
261
294
  const clash = byName.get(indexName);
@@ -269,15 +302,6 @@ var buildCollectionIndexSpecs = (collection, resolveColumnName) => {
269
302
  return specs;
270
303
  };
271
304
  /**
272
- * Every declared index across a set of collections, in a stable order.
273
- *
274
- * Sorted because the result reaches `schema.sql`, which `doctor` string-
275
- * compares against a regenerated copy — `generatePostgresDdl` does not sort its
276
- * collections, so leaving this in declaration order would make the artifact
277
- * depend on the order files happened to load in.
278
- */
279
- var buildCollectionIndexPlan = (collections, resolveColumnName) => sortIndexSpecs(collections.flatMap((collection) => buildCollectionIndexSpecs(collection, resolveColumnName)));
280
- /**
281
305
  * The stable order every consumer of a set of index specs uses.
282
306
  *
283
307
  * Exported because the boot-time diff reads the specs off the schema plan
@@ -462,6 +486,7 @@ var wantsStack = () => parseEnvBoolean(process.env.REBASE_DEBUG) === true;
462
486
  */
463
487
  var describeFailure = (error) => {
464
488
  if (!(error instanceof Error)) return String(error);
489
+ if (isSchemaDefinitionRefusal(error) && !wantsStack()) return error.message;
465
490
  const failedQuery = describeFailedQuery(error);
466
491
  const lead = failedQuery?.reason ? `${failedQuery.reason}\n ` : "";
467
492
  if (wantsStack() && error.stack) {
@@ -474,6 +499,13 @@ var describeFailure = (error) => {
474
499
  return `${error.message}\n Re-run with --debug for the stack trace.`;
475
500
  };
476
501
  /**
502
+ * Whether an error is `SchemaDefinitionError` (`@rebasepro/common`), told by
503
+ * its code so this module does not import the package.
504
+ */
505
+ function isSchemaDefinitionRefusal(error) {
506
+ return "code" in error && error.code === "SCHEMA_DEFINITION_INVALID";
507
+ }
508
+ /**
477
509
  * A failed query as a reader needs it: why it failed — Postgres' own reason
478
510
  * with its SQLSTATE (`relation "nope_table" does not exist (42P01)`), or the
479
511
  * driver's when Postgres never answered — and the query without the values it
@@ -911,6 +943,6 @@ Object.defineProperties(createChalk.prototype, styles);
911
943
  var chalk = createChalk();
912
944
  createChalk({ level: stderrColor ? stderrColor.level : 0 });
913
945
  //#endregion
914
- export { sortIndexSpecs as _, outWarn as a, buildCollectionIndexSpecs as c, collection_index_exports as d, deriveIndexName as f, renderPredicate as g, leadsWithColumn as h, outError as i, collectionIndexStatement as l, isRebaseIndexName as m, describeFailure as n, atlasExcludePattern as o, foreignKeyIndexSpec as p, out as r, excludePatternParts as s, chalk as t, collectionIndexStatements as u };
946
+ export { table_index_exports as _, outWarn as a, buildTableIndexSpecs as c, isRebaseIndexName as d, leadsWithColumn as f, tableIndexStatements as g, tableIndexStatement as h, outError as i, deriveIndexName as l, sortIndexSpecs as m, describeFailure as n, atlasExcludePattern as o, renderPredicate as p, out as r, excludePatternParts as s, chalk as t, foreignKeyIndexSpec as u };
915
947
 
916
- //# sourceMappingURL=source-fZb92pN8.js.map
948
+ //# sourceMappingURL=source-VxbrQojV.js.map