@rebasepro/server-postgres 0.30.1 → 0.31.0-canary.g902a0ce
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 +11 -8
- package/dist/{BranchService-CrXvcES2.js → BranchService-USp1AvZB.js} +3 -3
- package/dist/{BranchService-CrXvcES2.js.map → BranchService-USp1AvZB.js.map} +1 -1
- package/dist/PostgresBackendDriver.d.ts +99 -54
- package/dist/PostgresBootstrapper.d.ts +12 -27
- package/dist/auth/ensure-tables.d.ts +16 -5
- package/dist/auth/schema-version.d.ts +2 -2
- package/dist/auth/services.d.ts +2 -3
- package/dist/{auth-users-columns-C72EMoDJ.js → auth-users-columns-BpfgbkxZ.js} +2 -16
- package/dist/auth-users-columns-BpfgbkxZ.js.map +1 -0
- package/dist/{backup-cli-CTKCOLpX.js → backup-cli-DbKyEj6c.js} +4 -4
- package/dist/{backup-cli-CTKCOLpX.js.map → backup-cli-DbKyEj6c.js.map} +1 -1
- package/dist/{boot-ddl-CqGIwSYx.js → boot-ddl-5H2bL_80.js} +2 -2
- package/dist/{boot-ddl-CqGIwSYx.js.map → boot-ddl-5H2bL_80.js.map} +1 -1
- package/dist/{cli-console-DBPw-oAz.js → cli-console-DsRgGSBR.js} +65 -39
- package/dist/cli-console-DsRgGSBR.js.map +1 -0
- package/dist/cli-console.d.ts +16 -13
- package/dist/cli-flags.d.ts +8 -9
- package/dist/cli-helpers.d.ts +15 -11
- package/dist/{cli-errors-DYTxnLbW.js → cli-schema-dir-CiN0ephV.js} +184 -70
- package/dist/cli-schema-dir-CiN0ephV.js.map +1 -0
- package/dist/cli-schema-dir.d.ts +64 -0
- package/dist/cli.js +192 -257
- package/dist/cli.js.map +1 -1
- package/dist/data-transformer.d.ts +50 -19
- package/dist/{database-preflight-iBpT7-vv.js → database-preflight-bfnIBnjM.js} +5 -5
- package/dist/database-preflight-bfnIBnjM.js.map +1 -0
- package/dist/{deferred-index-build-BCU9RoHK.js → deferred-index-build-CcSDA7wE.js} +69 -13
- package/dist/deferred-index-build-CcSDA7wE.js.map +1 -0
- package/dist/{ensure-collection-policies-Bo-_fDAy.js → ensure-policies-rRmXb5bt.js} +31 -31
- package/dist/ensure-policies-rRmXb5bt.js.map +1 -0
- package/dist/{ensure-collection-tables-DCJINkT_.js → ensure-tables-Bvm-F2wW.js} +44 -37
- package/dist/ensure-tables-Bvm-F2wW.js.map +1 -0
- package/dist/{ensure-tables-BPGaGh0y.js → ensure-tables-CC8p_AK3.js} +34 -29
- package/dist/ensure-tables-CC8p_AK3.js.map +1 -0
- package/dist/{enum-labels-kept-YAgOZS4I.js → enum-labels-kept-FlX9SHdf.js} +8 -8
- package/dist/enum-labels-kept-FlX9SHdf.js.map +1 -0
- package/dist/{generate-drizzle-schema-DcrFr7YX.js → generate-drizzle-schema-SJMXxzPI.js} +12 -12
- package/dist/generate-drizzle-schema-SJMXxzPI.js.map +1 -0
- package/dist/{generate-drizzle-schema-logic-LTLZvt6r.js → generate-drizzle-schema-logic-DL7R1rAF.js} +15 -8
- package/dist/generate-drizzle-schema-logic-DL7R1rAF.js.map +1 -0
- package/dist/{generate-files-CsaVzatS.js → generate-files-tlJ9_lGI.js} +23 -30
- package/dist/generate-files-tlJ9_lGI.js.map +1 -0
- package/dist/{generate-next-step-DgK5BlBn.js → generate-next-step-CO09dovd.js} +3 -3
- package/dist/generate-next-step-CO09dovd.js.map +1 -0
- package/dist/{generate-postgres-ddl-logic-Dg0bcENZ.js → generate-postgres-ddl-logic-B8huc03c.js} +51 -21
- package/dist/generate-postgres-ddl-logic-B8huc03c.js.map +1 -0
- package/dist/{generated-schema-diff-By4dxyTH.js → generated-schema-diff-DoT2dYDe.js} +297 -279
- package/dist/generated-schema-diff-DoT2dYDe.js.map +1 -0
- package/dist/{generated-schema-staleness-BvNF3i-s.js → generated-schema-staleness-YBVq2kTn.js} +21 -29
- package/dist/generated-schema-staleness-YBVq2kTn.js.map +1 -0
- package/dist/history/ensure-history-table.d.ts +22 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.es.js +201 -25
- package/dist/index.es.js.map +1 -1
- package/dist/interfaces.d.ts +3 -4
- package/dist/{introspect-db-queries-DevUrzll.js → introspect-db-queries-BgiRQqtR.js} +7 -2
- package/dist/introspect-db-queries-BgiRQqtR.js.map +1 -0
- package/dist/introspect-tables-Cw_A-kk4.js +2086 -0
- package/dist/introspect-tables-Cw_A-kk4.js.map +1 -0
- package/dist/load-tables-B1Re74ng.js +92 -0
- package/dist/load-tables-B1Re74ng.js.map +1 -0
- package/dist/{migrate-baseline-CmWXL7qx.js → migrate-baseline-DZmekgpD.js} +19 -32
- package/dist/migrate-baseline-DZmekgpD.js.map +1 -0
- package/dist/{migrate-policy-stamps-BN_Qad6c.js → migrate-policy-stamps-B_acrUQB.js} +18 -19
- package/dist/migrate-policy-stamps-B_acrUQB.js.map +1 -0
- package/dist/model/PostgresTableRegistry.d.ts +159 -0
- package/dist/model/build-registry.d.ts +25 -0
- package/dist/model/refresh-relational-schema.d.ts +24 -0
- package/dist/model/runtime-table.d.ts +53 -0
- package/dist/{collections → model}/validate-relations.d.ts +15 -21
- package/dist/{open-rebase-40paQfVW.js → open-rebase-4kisUF_k.js} +3946 -3870
- package/dist/open-rebase-4kisUF_k.js.map +1 -0
- package/dist/open-rebase.d.ts +16 -15
- package/dist/{pg-error-utils-DJHjCF7-.js → pg-error-utils-BT5NzGFZ.js} +17 -20
- package/dist/pg-error-utils-BT5NzGFZ.js.map +1 -0
- package/dist/plan-schema-Hbtjhge3.js +1633 -0
- package/dist/plan-schema-Hbtjhge3.js.map +1 -0
- package/dist/{policy-drift-C-m0uWHH.js → policy-drift-BVMyqHSa.js} +29 -29
- package/dist/policy-drift-BVMyqHSa.js.map +1 -0
- package/dist/{push-index-adoption-Cp7oZxSl.js → push-index-adoption-hpHTyXMR.js} +7 -7
- package/dist/push-index-adoption-hpHTyXMR.js.map +1 -0
- package/dist/{push-index-prebuild-DbwKGtQT.js → push-index-prebuild-Bty9F7bD.js} +6 -6
- package/dist/push-index-prebuild-Bty9F7bD.js.map +1 -0
- package/dist/{push-kept-defaults-CLcgsEPt.js → push-kept-defaults-Bst4MDup.js} +13 -16
- package/dist/push-kept-defaults-Bst4MDup.js.map +1 -0
- package/dist/{push-legacy-renames-BthD0E9W.js → push-legacy-renames-bB4bM6br.js} +6 -6
- package/dist/push-legacy-renames-bB4bM6br.js.map +1 -0
- package/dist/{push-policy-plan-BgcrroxQ.js → push-policy-plan-BI8U4BOD.js} +11 -11
- package/dist/push-policy-plan-BI8U4BOD.js.map +1 -0
- package/dist/{render-ddl-Ci3S_SoI.js → render-ddl-D4n86NHz.js} +14 -7
- package/dist/render-ddl-D4n86NHz.js.map +1 -0
- package/dist/{request-role-cli-Dy1EgJU9.js → request-role-cli-BdRzdE87.js} +11 -11
- package/dist/{request-role-cli-Dy1EgJU9.js.map → request-role-cli-BdRzdE87.js.map} +1 -1
- package/dist/{request-role-migration-GHTJnPMV.js → request-role-migration-C8aq_TO3.js} +2 -2
- package/dist/{request-role-migration-GHTJnPMV.js.map → request-role-migration-C8aq_TO3.js.map} +1 -1
- package/dist/{rls-enforcement-Cc_UhOxb.js → rls-enforcement-DB5HHj96.js} +19 -19
- package/dist/rls-enforcement-DB5HHj96.js.map +1 -0
- package/dist/{rls-settings-BCGMIig3.js → rls-settings-CmGK2U0a.js} +2 -2
- package/dist/rls-settings-CmGK2U0a.js.map +1 -0
- package/dist/schema/auth-users-columns.d.ts +1 -11
- package/dist/schema/catalogue-schema.d.ts +33 -29
- package/dist/schema/classify-change.d.ts +23 -16
- package/dist/schema/column-type-drift.d.ts +16 -0
- package/dist/schema/config-relations.d.ts +10 -9
- package/dist/schema/deferred-index-build.d.ts +1 -1
- package/dist/schema/doctor-cli.js +1544 -66
- package/dist/schema/doctor-cli.js.map +1 -1
- package/dist/schema/doctor-database.d.ts +7 -7
- package/dist/schema/doctor-policy-checks.d.ts +4 -4
- package/dist/schema/doctor-search-scale.d.ts +14 -14
- package/dist/schema/doctor.d.ts +27 -27
- package/dist/schema/dynamic-tables.d.ts +6 -5
- package/dist/schema/{ensure-collection-policies.d.ts → ensure-policies.d.ts} +20 -20
- package/dist/schema/{ensure-collection-tables.d.ts → ensure-tables.d.ts} +11 -11
- package/dist/schema/enum-labels-kept.d.ts +6 -6
- package/dist/schema/generate-drizzle-schema-logic.d.ts +3 -3
- package/dist/schema/generate-drizzle-schema.js +1 -1
- package/dist/schema/generate-files.d.ts +6 -6
- package/dist/schema/generate-postgres-ddl-logic.d.ts +23 -20
- package/dist/schema/generate-postgres-ddl.js +11 -11
- package/dist/schema/generate-postgres-ddl.js.map +1 -1
- package/dist/schema/generate-schema-commit.d.ts +13 -8
- package/dist/schema/generated-schema-diff.d.ts +16 -16
- package/dist/schema/generated-schema-staleness.d.ts +11 -11
- package/dist/schema/index-adoption.d.ts +4 -4
- package/dist/schema/introspect-db-customization.d.ts +47 -0
- package/dist/schema/introspect-db-inference.d.ts +30 -9
- package/dist/schema/introspect-db-logic.d.ts +79 -110
- package/dist/schema/introspect-db-project.d.ts +15 -18
- package/dist/schema/introspect-db-queries.d.ts +1 -1
- package/dist/schema/introspect-db-search.d.ts +25 -4
- package/dist/schema/introspect-db-storage.d.ts +4 -74
- package/dist/schema/introspect-db.js +102 -90
- package/dist/schema/introspect-db.js.map +1 -1
- package/dist/schema/introspect-runtime.d.ts +47 -36
- package/dist/schema/introspect-tables.d.ts +182 -0
- package/dist/schema/load-tables.d.ts +55 -0
- package/dist/schema/migrate-policy-stamps.d.ts +4 -4
- package/dist/schema/migration-freshness.d.ts +13 -13
- package/dist/schema/plan/column-order.d.ts +82 -0
- package/dist/schema/plan/diff-plan.d.ts +9 -3
- package/dist/schema/plan/plan-schema.d.ts +55 -52
- package/dist/schema/plan/render-drizzle.d.ts +1 -1
- package/dist/schema/plan/types.d.ts +24 -15
- package/dist/schema/push-index-adoption.d.ts +3 -3
- package/dist/schema/push-index-prebuild.d.ts +3 -3
- package/dist/schema/push-kept-defaults.d.ts +7 -7
- package/dist/schema/push-legacy-renames.d.ts +3 -3
- package/dist/schema/push-policy-plan.d.ts +5 -5
- package/dist/schema/reconcile-schema.d.ts +5 -5
- package/dist/schema/relation-names.d.ts +15 -20
- package/dist/schema/render-outputs.d.ts +76 -0
- package/dist/schema/search-column.d.ts +11 -43
- package/dist/schema/{collection-index.d.ts → table-index.d.ts} +21 -42
- package/dist/schema/{collections-schema-version.d.ts → tables-schema-version.d.ts} +8 -2
- package/dist/schema/vector-index.d.ts +24 -28
- package/dist/{search-column-BM-GV6vH.js → search-column-BO-WND-B.js} +86 -149
- package/dist/search-column-BO-WND-B.js.map +1 -0
- package/dist/security/caller-sql-columns.d.ts +9 -6
- package/dist/security/policy-drift.d.ts +14 -14
- package/dist/security/rls-enforcement.d.ts +19 -25
- package/dist/security/rls-settings.d.ts +2 -2
- package/dist/security/served-table-protection.d.ts +125 -0
- package/dist/services/FetchService.d.ts +22 -133
- package/dist/services/PersistService.d.ts +6 -17
- package/dist/services/RelationService.d.ts +57 -106
- package/dist/services/RelationWriteService.d.ts +59 -66
- package/dist/services/cdc/identity-columns.d.ts +7 -5
- package/dist/services/cdc/junction-tables.d.ts +14 -14
- package/dist/services/collection-helpers.d.ts +52 -95
- package/dist/services/dataService.d.ts +15 -12
- package/dist/services/field-op-sql.d.ts +11 -9
- package/dist/services/field-viewer.d.ts +12 -11
- package/dist/services/hidden-columns.d.ts +30 -0
- package/dist/services/index.d.ts +1 -1
- package/dist/services/junction-writes.d.ts +37 -18
- package/dist/services/nested-path.d.ts +18 -18
- package/dist/services/read-field-access.d.ts +23 -7
- package/dist/services/read-scope.d.ts +10 -9
- package/dist/services/realtimeService.d.ts +25 -10
- package/dist/services/relation-tables.d.ts +97 -0
- package/dist/services/row-pipeline.d.ts +50 -69
- package/dist/services/soft-delete.d.ts +25 -24
- package/dist/services/table-hooks.d.ts +146 -0
- package/dist/services/view-access.d.ts +7 -7
- package/dist/services/write-transaction-scope.d.ts +1 -1
- package/dist/{source-fZb92pN8.js → source-VxbrQojV.js} +111 -79
- package/dist/source-VxbrQojV.js.map +1 -0
- package/dist/{collections-schema-version-D7bDI0PJ.js → tables-schema-version-YvZIBlOP.js} +12 -6
- package/dist/tables-schema-version-YvZIBlOP.js.map +1 -0
- package/dist/utils/drizzle-conditions.d.ts +70 -84
- package/dist/utils/pg-array-null-patch.d.ts +27 -10
- package/dist/utils/pg-error-utils.d.ts +4 -4
- package/dist/{vector-index-DsQ3V2d2.js → vector-index-VSh3ufTd.js} +62 -54
- package/dist/vector-index-VSh3ufTd.js.map +1 -0
- package/dist/{websocket-B7ex6AQM.js → websocket-BevXvwfo.js} +51 -40
- package/dist/websocket-BevXvwfo.js.map +1 -0
- package/dist/websocket.d.ts +2 -2
- package/package.json +7 -7
- package/dist/auth-users-columns-C72EMoDJ.js.map +0 -1
- package/dist/cli-collections-path.d.ts +0 -31
- package/dist/cli-console-DBPw-oAz.js.map +0 -1
- package/dist/cli-errors-DYTxnLbW.js.map +0 -1
- package/dist/collections/PostgresCollectionRegistry.d.ts +0 -47
- package/dist/collections/buildRegistry.d.ts +0 -27
- package/dist/collections-schema-version-D7bDI0PJ.js.map +0 -1
- package/dist/column-plan-helpers-BeSztMor.js +0 -161
- package/dist/column-plan-helpers-BeSztMor.js.map +0 -1
- package/dist/database-preflight-iBpT7-vv.js.map +0 -1
- package/dist/deferred-index-build-BCU9RoHK.js.map +0 -1
- package/dist/doctor-Kg1oUK0Q.js +0 -1458
- package/dist/doctor-Kg1oUK0Q.js.map +0 -1
- package/dist/ensure-collection-policies-Bo-_fDAy.js.map +0 -1
- package/dist/ensure-collection-tables-DCJINkT_.js.map +0 -1
- package/dist/ensure-tables-BPGaGh0y.js.map +0 -1
- package/dist/enum-labels-kept-YAgOZS4I.js.map +0 -1
- package/dist/generate-drizzle-schema-DcrFr7YX.js.map +0 -1
- package/dist/generate-drizzle-schema-logic-LTLZvt6r.js.map +0 -1
- package/dist/generate-files-CsaVzatS.js.map +0 -1
- package/dist/generate-next-step-DgK5BlBn.js.map +0 -1
- package/dist/generate-postgres-ddl-logic-Dg0bcENZ.js.map +0 -1
- package/dist/generated-schema-diff-By4dxyTH.js.map +0 -1
- package/dist/generated-schema-staleness-BvNF3i-s.js.map +0 -1
- package/dist/introspect-db-logic-DWqAEURB.js +0 -2047
- package/dist/introspect-db-logic-DWqAEURB.js.map +0 -1
- package/dist/introspect-db-queries-DevUrzll.js.map +0 -1
- package/dist/migrate-baseline-CmWXL7qx.js.map +0 -1
- package/dist/migrate-policy-stamps-BN_Qad6c.js.map +0 -1
- package/dist/open-rebase-40paQfVW.js.map +0 -1
- package/dist/pg-error-utils-DJHjCF7-.js.map +0 -1
- package/dist/plan-schema-vJd3UEmT.js +0 -1604
- package/dist/plan-schema-vJd3UEmT.js.map +0 -1
- package/dist/policy-drift-C-m0uWHH.js.map +0 -1
- package/dist/push-index-adoption-Cp7oZxSl.js.map +0 -1
- package/dist/push-index-prebuild-DbwKGtQT.js.map +0 -1
- package/dist/push-kept-defaults-CLcgsEPt.js.map +0 -1
- package/dist/push-legacy-renames-BthD0E9W.js.map +0 -1
- package/dist/push-policy-plan-BgcrroxQ.js.map +0 -1
- package/dist/render-ddl-Ci3S_SoI.js.map +0 -1
- package/dist/rls-enforcement-Cc_UhOxb.js.map +0 -1
- package/dist/rls-settings-BCGMIig3.js.map +0 -1
- package/dist/schema/column-plan-helpers.d.ts +0 -161
- package/dist/schema/introspect-db-naming.d.ts +0 -10
- package/dist/search-column-BM-GV6vH.js.map +0 -1
- package/dist/source-fZb92pN8.js.map +0 -1
- package/dist/vector-index-DsQ3V2d2.js.map +0 -1
- package/dist/websocket-B7ex6AQM.js.map +0 -1
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RelationDescriptor, TableDescriptor } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* The key a SQL column is served under on a table: its column's key, or — for
|
|
4
|
+
* a column the table does not describe — the camelCase of its name, which is
|
|
5
|
+
* the key a foreign key derived from it would get.
|
|
6
|
+
*/
|
|
7
|
+
export declare const servedKeyOf: (descriptor: TableDescriptor, sqlColumn: string) => string;
|
|
2
8
|
/**
|
|
3
9
|
* The `relationName` both sides of a link must agree on.
|
|
4
10
|
*
|
|
5
11
|
* Drizzle pairs an owning `one()` with its inverse `many()` by this string and
|
|
6
12
|
* by nothing else, and the two sides are computed by different callers holding
|
|
7
|
-
* different
|
|
8
|
-
*
|
|
9
|
-
* key
|
|
10
|
-
*
|
|
11
|
-
* owning (belongsTo) → `{thisTable}_{fieldKey(localKey)}`
|
|
12
|
-
* inverse (hasMany/hasOne) → `{targetTable}_{fieldKey(foreignKeyOnTarget)}`
|
|
13
|
-
*
|
|
14
|
-
* Both spellings of `jobs.company` produce `jobs_companyId`. A many-to-many is
|
|
15
|
-
* named through its junction wiring and a `via` chain is not a Drizzle relation
|
|
16
|
-
* at all, so both keep the local name.
|
|
13
|
+
* different tables — so the rule has to be derivable from either end. It is:
|
|
14
|
+
* name the link after the table that carries the foreign key and the key that
|
|
15
|
+
* column is served under (the key, not the column: the Drizzle object is keyed
|
|
16
|
+
* by the wire name, {@link servedKeyOf}).
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* the column would differ between a collection that declares `columnName` and
|
|
21
|
-
* one that does not, for the same link.
|
|
18
|
+
* owning (belongsTo) → `{thisTable}_{key(localKey)}`
|
|
19
|
+
* inverse (hasMany/hasOne) → `{targetTable}_{key(foreignKey)}`
|
|
22
20
|
*
|
|
23
|
-
*
|
|
24
|
-
* private copy (`computeSharedRelationName`) that this was lifted from verbatim;
|
|
25
|
-
* the generator should import this instead, so the file it writes and the
|
|
26
|
-
* relations the runtime builds from the live catalogue cannot drift apart.
|
|
21
|
+
* A many-to-many and a `via` chain keep the relation's own name.
|
|
27
22
|
*/
|
|
28
|
-
export declare function
|
|
23
|
+
export declare function tableRelationName(relation: RelationDescriptor, source: TableDescriptor, targetOf: (slug: string) => TableDescriptor): string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the schema pipeline emits for a set of collections, rendered as
|
|
3
|
+
* text, so two sets can be compared byte for byte.
|
|
4
|
+
*
|
|
5
|
+
* The plan-golden corpus freezes these outputs for every collection set the
|
|
6
|
+
* planner is held to, and the collections-to-tables codemod (`rebase migrate
|
|
7
|
+
* collections-to-tables`) uses the same renderer to prove a migration
|
|
8
|
+
* lossless: the legacy collections and the migrated tables, lowered, must
|
|
9
|
+
* render identically — DDL, policies, search, vector, triggers, views, the
|
|
10
|
+
* Drizzle schema and the boot plans. One renderer, so the proof and the
|
|
11
|
+
* corpus can never disagree about what "the same schema" means.
|
|
12
|
+
*/
|
|
13
|
+
import { type CompiledTable } from "@rebasepro/types";
|
|
14
|
+
/**
|
|
15
|
+
* Process state the planner reads besides its arguments.
|
|
16
|
+
*
|
|
17
|
+
* `declaredRlsPolicyShape` reads these three variables and the global database
|
|
18
|
+
* registry, so the same collections plan differently on a host that exports
|
|
19
|
+
* one. Every render runs with all three unset and the registry empty.
|
|
20
|
+
*
|
|
21
|
+
* @group Schema
|
|
22
|
+
*/
|
|
23
|
+
export declare const PLANNER_ENV_VARIABLES: readonly ["REBASE_RLS_POLICY_TARGET", "REBASE_RLS_ADMIN_POLICIES", "REBASE_RLS_DEFAULT_POLICIES"];
|
|
24
|
+
/**
|
|
25
|
+
* Run `render` with the planner's ambient inputs pinned, restoring the
|
|
26
|
+
* environment after.
|
|
27
|
+
*
|
|
28
|
+
* @group Schema
|
|
29
|
+
*/
|
|
30
|
+
export declare function withPinnedPlannerWorld<T>(render: () => T): T;
|
|
31
|
+
/**
|
|
32
|
+
* A plan or a planned object as stable JSON text.
|
|
33
|
+
*
|
|
34
|
+
* Functions are dropped (a relation's `target` thunk is not data), `Map`s become
|
|
35
|
+
* entry arrays and `Set`s arrays, in insertion order — which is the planner's
|
|
36
|
+
* own order, and is part of what is being compared. A cycle is written as
|
|
37
|
+
* `"[circular]"` rather than thrown on.
|
|
38
|
+
*
|
|
39
|
+
* @group Schema
|
|
40
|
+
*/
|
|
41
|
+
export declare function toStableJson(value: unknown, omitTopLevelKeys?: readonly string[]): string;
|
|
42
|
+
/**
|
|
43
|
+
* What {@link renderSchemaOutputs} is planned with — the inputs besides the
|
|
44
|
+
* tables.
|
|
45
|
+
*
|
|
46
|
+
* @group Schema
|
|
47
|
+
*/
|
|
48
|
+
export interface RenderSchemaOutputsOptions {
|
|
49
|
+
/**
|
|
50
|
+
* `declaredDatabaseExtensions()` for the boot plan and `plan.json`.
|
|
51
|
+
* `vector.sql` is rendered with and without the extension either way.
|
|
52
|
+
*/
|
|
53
|
+
databaseExtensions?: readonly string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Everything the schema pipeline emits for one set of tables, by file name.
|
|
57
|
+
*
|
|
58
|
+
* - `schema*.sql`: `generatePostgresDdl` under all eight `DdlRenderOptions`
|
|
59
|
+
* combinations (`schema.sql` is the one `db generate` writes: all three off).
|
|
60
|
+
* - `policies.sql`, `search.sql`, `vector.sql`, `vector+extension.sql`,
|
|
61
|
+
* `triggers.sql`, `views.sql`: the files written beside it.
|
|
62
|
+
* - `schema.generated.ts` / `schema.generated.no-policies.ts`: the Drizzle schema.
|
|
63
|
+
* - `atlas-excludes.json`: the patterns that keep Atlas off the carved-out objects.
|
|
64
|
+
* - `boot-ensure.json`: `planTableSchemaEnsure` against an empty database.
|
|
65
|
+
* - `boot-policies.adminRole-*.adminRequestRole-*.json`: `planTablePolicies`
|
|
66
|
+
* for the four role-availability combinations.
|
|
67
|
+
* - `relational-columns.json`, `junction-tables.json`: the legacy-column slices.
|
|
68
|
+
* - `plan.json`: `planSchema` itself, functions stripped.
|
|
69
|
+
*
|
|
70
|
+
* Planned in slug order, with the planner's environment pinned. An output that
|
|
71
|
+
* throws is recorded as `THROWS: <message>` in its own file, so a refusal is
|
|
72
|
+
* compared like any other output.
|
|
73
|
+
*
|
|
74
|
+
* @group Schema
|
|
75
|
+
*/
|
|
76
|
+
export declare function renderSchemaOutputs(tables: readonly CompiledTable[], options?: RenderSchemaOutputsOptions): Record<string, string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The one place a
|
|
2
|
+
* The one place a table's `search` block becomes SQL.
|
|
3
3
|
*
|
|
4
4
|
* Four things describe a Postgres table in this codebase — the DDL generator,
|
|
5
5
|
* the Drizzle schema generator, the runtime table builder for BaaS mode, and
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* `auditor` and `auditoria` to `auditori` — *different lexemes* — so a query
|
|
44
44
|
* typed without accents misses every row that carries them.
|
|
45
45
|
*/
|
|
46
|
-
import {
|
|
46
|
+
import { SearchMode, SearchWeight, type TableDescriptor } from "@rebasepro/types";
|
|
47
47
|
/**
|
|
48
48
|
* Names of the helper functions. Frozen: they are recorded in the stored
|
|
49
49
|
* generation expression of every search column ever created, so renaming one
|
|
@@ -113,28 +113,14 @@ export interface SearchColumnSpec {
|
|
|
113
113
|
export declare class SearchConfigError extends Error {
|
|
114
114
|
constructor(message: string);
|
|
115
115
|
}
|
|
116
|
-
/** The `search` block of a collection, or undefined when it has none. */
|
|
117
|
-
export declare const getSearchConfig: (collection: CollectionConfig) => SearchConfig | undefined;
|
|
118
116
|
/**
|
|
119
|
-
*
|
|
117
|
+
* The search column a table's `search` block asks for, or `undefined` when
|
|
118
|
+
* it declares none — read from the table descriptor. What the planner calls.
|
|
120
119
|
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* a collection whose `engine` was changed after the block was written — because
|
|
124
|
-
* the alternative is the exact failure the block exists to prevent: a developer
|
|
125
|
-
* who declared what to index, saw no error, and got the substring fallback.
|
|
126
|
-
*
|
|
127
|
-
* Called with *every* collection, before the Postgres ones are filtered out.
|
|
120
|
+
* Throws {@link SearchConfigError} on a block that cannot be honoured; the
|
|
121
|
+
* compiler refuses most of them first (`checkSearch`).
|
|
128
122
|
*/
|
|
129
|
-
export declare const
|
|
130
|
-
/**
|
|
131
|
-
* Build the full spec for a collection, or undefined when it has not opted in.
|
|
132
|
-
*
|
|
133
|
-
* Throws {@link SearchConfigError} on a config that cannot be honoured. Callers
|
|
134
|
-
* at boot surface that as a startup failure — a search block that half-works is
|
|
135
|
-
* worse than one that refuses.
|
|
136
|
-
*/
|
|
137
|
-
export declare const buildSearchColumnSpec: (collection: CollectionConfig) => SearchColumnSpec | undefined;
|
|
123
|
+
export declare const buildTableSearchColumnSpec: (table: TableDescriptor) => SearchColumnSpec | undefined;
|
|
138
124
|
/**
|
|
139
125
|
* The IMMUTABLE wrappers the generated expressions call.
|
|
140
126
|
*
|
|
@@ -240,19 +226,14 @@ export declare const searchStampGuards: (spec: SearchColumnSpec) => string[];
|
|
|
240
226
|
*/
|
|
241
227
|
export declare const searchIndexNames: (spec: SearchColumnSpec) => string[];
|
|
242
228
|
/**
|
|
243
|
-
* The generated column names a
|
|
244
|
-
*
|
|
245
|
-
* These are physical columns on the table, so `SELECT *` returns them. They are
|
|
246
|
-
* an index in column form — a list of lexeme positions, or a concatenation of
|
|
247
|
-
* every searchable field on the row — and nothing outside the query planner has
|
|
248
|
-
* any use for them. Left in, every list response carries a second, larger copy
|
|
249
|
-
* of the row's text.
|
|
229
|
+
* The generated column names a table's search block adds, read from its
|
|
230
|
+
* descriptor: the search columns (`search_vector`, and the fuzzy column when there is one).
|
|
250
231
|
*/
|
|
251
|
-
export declare const
|
|
232
|
+
export declare const tableSearchColumnNames: (table: TableDescriptor) => string[];
|
|
252
233
|
/**
|
|
253
234
|
* True for a column whose type only ever holds a search index.
|
|
254
235
|
*
|
|
255
|
-
* Independent of any
|
|
236
|
+
* Independent of any table declaration on purpose: an introspected database
|
|
256
237
|
* (BaaS mode) can carry a `tsvector` column this framework never created —
|
|
257
238
|
* Pagila's `film.fulltext` is the canonical one — and it should not be returned
|
|
258
239
|
* to callers either. `isDerivedIndexColumn` already keeps such a column out of
|
|
@@ -261,17 +242,4 @@ export declare const searchColumnNames: (collection: CollectionConfig) => string
|
|
|
261
242
|
export declare const isSearchIndexColumn: (column: {
|
|
262
243
|
getSQLType?: () => string;
|
|
263
244
|
}) => boolean;
|
|
264
|
-
/**
|
|
265
|
-
* A drizzle select projection over `table` with the search columns dropped.
|
|
266
|
-
*
|
|
267
|
-
* Returns undefined when nothing needs dropping, so the common case keeps using
|
|
268
|
-
* a plain `select()` and this stays invisible in the generated SQL.
|
|
269
|
-
*/
|
|
270
|
-
export declare const visibleColumnProjection: <C extends {
|
|
271
|
-
getSQLType?: () => string;
|
|
272
|
-
}>(tableColumns: Record<string, C> | undefined, collection?: CollectionConfig) => Record<string, C> | undefined;
|
|
273
|
-
/** The same exclusion as a drizzle `db.query` `columns` denylist. */
|
|
274
|
-
export declare const hiddenColumnsOption: (tableColumns: Record<string, {
|
|
275
|
-
getSQLType?: () => string;
|
|
276
|
-
}> | undefined, collection?: CollectionConfig) => Record<string, false> | undefined;
|
|
277
245
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The one place a
|
|
2
|
+
* The one place a table's `indexes` become `CREATE INDEX`.
|
|
3
3
|
*
|
|
4
4
|
* Like `search-column.ts` and `vector-index.ts`, this module exists so the DDL
|
|
5
5
|
* generator and the boot-time ensure render the *same* specification rather
|
|
@@ -31,9 +31,7 @@
|
|
|
31
31
|
* dropped, there is never a window with no index, and drift detection reduces
|
|
32
32
|
* to a set difference over names.
|
|
33
33
|
*/
|
|
34
|
-
import type {
|
|
35
|
-
/** Resolve a property key to its column name. Injected to avoid an import cycle. */
|
|
36
|
-
export type ResolveColumnName = (propName: string, prop?: Property | null) => string;
|
|
34
|
+
import type { TableDescriptor } from "@rebasepro/types";
|
|
37
35
|
export type IndexMethod = "btree" | "gin" | "brin";
|
|
38
36
|
/** A key column, with the ordering Postgres will actually apply. */
|
|
39
37
|
export interface ResolvedIndexKey {
|
|
@@ -59,7 +57,7 @@ export type ResolvedPredicate = {
|
|
|
59
57
|
and: readonly ResolvedPredicate[];
|
|
60
58
|
};
|
|
61
59
|
/** One index, fully resolved. The only shape the renderers accept. */
|
|
62
|
-
export interface
|
|
60
|
+
export interface TableIndexSpec {
|
|
63
61
|
schema: string;
|
|
64
62
|
table: string;
|
|
65
63
|
method: IndexMethod;
|
|
@@ -67,8 +65,11 @@ export interface CollectionIndexSpec {
|
|
|
67
65
|
keys: ResolvedIndexKey[];
|
|
68
66
|
include: string[];
|
|
69
67
|
predicate: ResolvedPredicate | null;
|
|
70
|
-
/**
|
|
71
|
-
|
|
68
|
+
/**
|
|
69
|
+
* The author's one-line justification, when there is one. Never enters
|
|
70
|
+
* the name. A legacy `indexes` entry must state it; a table's may not.
|
|
71
|
+
*/
|
|
72
|
+
reason?: string;
|
|
72
73
|
/** Derived by {@link deriveIndexName}. Frozen — see the module comment. */
|
|
73
74
|
indexName: string;
|
|
74
75
|
/**
|
|
@@ -89,7 +90,7 @@ export interface CollectionIndexSpec {
|
|
|
89
90
|
* the alternative is a `CREATE INDEX` that fails during a push with a Postgres
|
|
90
91
|
* error mentioning a column the author never wrote.
|
|
91
92
|
*/
|
|
92
|
-
export declare class
|
|
93
|
+
export declare class TableIndexConfigError extends Error {
|
|
93
94
|
readonly collectionSlug: string;
|
|
94
95
|
readonly position: number;
|
|
95
96
|
constructor(collectionSlug: string, position: number, message: string);
|
|
@@ -129,7 +130,7 @@ export declare const isRebaseIndexName: (name: string) => boolean;
|
|
|
129
130
|
* `v` is the only escape hatch, and it is expensive on purpose: bumping it
|
|
130
131
|
* renames every index in the field.
|
|
131
132
|
*/
|
|
132
|
-
export declare const indexFingerprint: (spec: Omit<
|
|
133
|
+
export declare const indexFingerprint: (spec: Omit<TableIndexSpec, "indexName">) => string;
|
|
133
134
|
/**
|
|
134
135
|
* `<table>_<columns>_ix_<hash>`, or `_ux_` when unique.
|
|
135
136
|
*
|
|
@@ -140,7 +141,7 @@ export declare const indexFingerprint: (spec: Omit<CollectionIndexSpec, "indexNa
|
|
|
140
141
|
* `_fkey` suffix truncated away, so a second foreign key on that table would
|
|
141
142
|
* derive a byte-identical name.
|
|
142
143
|
*/
|
|
143
|
-
export declare const deriveIndexName: (spec: Omit<
|
|
144
|
+
export declare const deriveIndexName: (spec: Omit<TableIndexSpec, "indexName">) => string;
|
|
144
145
|
/** Render a resolved predicate as the body of a `WHERE` clause. */
|
|
145
146
|
export declare const renderPredicate: (predicate: ResolvedPredicate) => string;
|
|
146
147
|
/**
|
|
@@ -152,44 +153,22 @@ export declare const renderPredicate: (predicate: ResolvedPredicate) => string;
|
|
|
152
153
|
* nothing for a UNIQUE index — the rendered text is `CREATE UNIQUE INDEX …`
|
|
153
154
|
* and the pattern never matches.
|
|
154
155
|
*/
|
|
155
|
-
export declare const
|
|
156
|
+
export declare const tableIndexStatement: (spec: TableIndexSpec, options?: {
|
|
156
157
|
concurrently?: boolean;
|
|
157
158
|
ifNotExists?: boolean;
|
|
158
159
|
}) => string;
|
|
159
|
-
export declare const
|
|
160
|
+
export declare const tableIndexStatements: (specs: readonly TableIndexSpec[], options?: {
|
|
160
161
|
concurrently?: boolean;
|
|
161
162
|
ifNotExists?: boolean;
|
|
162
163
|
}) => string[];
|
|
163
164
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* `primary_category_id` — which is the case an index is most often wanted for
|
|
168
|
-
* and the case where the property key and the column differ. Everything else
|
|
169
|
-
* goes through `resolveColumnName`.
|
|
170
|
-
*
|
|
171
|
-
* The other relation kinds have no local column at all: the foreign key lives
|
|
172
|
-
* on the target's table, or in a junction. Indexing them here is refused
|
|
173
|
-
* rather than resolved to a column that does not exist.
|
|
174
|
-
*/
|
|
175
|
-
export declare const resolveIndexableColumn: (collection: CollectionConfig, propKey: string, resolveColumnName: ResolveColumnName, fail: (message: string) => never) => string;
|
|
176
|
-
/**
|
|
177
|
-
* Every index one collection declares, resolved and named.
|
|
178
|
-
*
|
|
179
|
-
* Throws {@link CollectionIndexConfigError} rather than dropping a bad entry:
|
|
180
|
-
* an index that silently does not exist is the failure mode this whole feature
|
|
181
|
-
* is here to remove.
|
|
182
|
-
*/
|
|
183
|
-
export declare const buildCollectionIndexSpecs: (collection: CollectionConfig, resolveColumnName: ResolveColumnName) => CollectionIndexSpec[];
|
|
184
|
-
/**
|
|
185
|
-
* Every declared index across a set of collections, in a stable order.
|
|
165
|
+
* Every index one table declares (`indexes`), resolved and named, read from
|
|
166
|
+
* its descriptor — what the planner calls, for a table and for a
|
|
167
|
+
* materialized view's stored rows alike.
|
|
186
168
|
*
|
|
187
|
-
*
|
|
188
|
-
* compares against a regenerated copy — `generatePostgresDdl` does not sort its
|
|
189
|
-
* collections, so leaving this in declaration order would make the artifact
|
|
190
|
-
* depend on the order files happened to load in.
|
|
169
|
+
* Throws {@link TableIndexConfigError} rather than dropping a bad entry.
|
|
191
170
|
*/
|
|
192
|
-
export declare const
|
|
171
|
+
export declare const buildTableIndexSpecs: (table: TableDescriptor) => TableIndexSpec[];
|
|
193
172
|
/**
|
|
194
173
|
* The stable order every consumer of a set of index specs uses.
|
|
195
174
|
*
|
|
@@ -198,7 +177,7 @@ export declare const buildCollectionIndexPlan: (collections: readonly Collection
|
|
|
198
177
|
* exclude list and `schema.sql` do — a second sort written out beside this one
|
|
199
178
|
* is a second order the moment either is edited.
|
|
200
179
|
*/
|
|
201
|
-
export declare const sortIndexSpecs: (specs: readonly
|
|
180
|
+
export declare const sortIndexSpecs: (specs: readonly TableIndexSpec[]) => TableIndexSpec[];
|
|
202
181
|
/**
|
|
203
182
|
* The `reason` a derived foreign-key index carries. Never part of the name —
|
|
204
183
|
* see {@link indexFingerprint} — so rewording it renames nothing.
|
|
@@ -214,7 +193,7 @@ export declare const FOREIGN_KEY_INDEX_REASON = "Derived for a foreign key: Post
|
|
|
214
193
|
* has to reach every row. Nor does GIN or BRIN, which answer different
|
|
215
194
|
* questions than "the rows whose key is one of these".
|
|
216
195
|
*/
|
|
217
|
-
export declare const leadsWithColumn: (spec: Pick<
|
|
196
|
+
export declare const leadsWithColumn: (spec: Pick<TableIndexSpec, "method" | "predicate" | "keys">, column: string) => boolean;
|
|
218
197
|
/**
|
|
219
198
|
* The btree a foreign-key column gets when nothing else already leads with it.
|
|
220
199
|
*
|
|
@@ -233,4 +212,4 @@ export declare const leadsWithColumn: (spec: Pick<CollectionIndexSpec, "method"
|
|
|
233
212
|
* derive. That identity is what makes the derived index and a declared one the
|
|
234
213
|
* same object rather than two.
|
|
235
214
|
*/
|
|
236
|
-
export declare const foreignKeyIndexSpec: (schema: string, table: string, column: string) =>
|
|
215
|
+
export declare const foreignKeyIndexSpec: (schema: string, table: string, column: string) => TableIndexSpec;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
2
|
+
/**
|
|
3
|
+
* The schema the meta table lives in: the runtime's own, `rebase`, whatever
|
|
4
|
+
* schema the tables are in. Shared by the boot (through the bootstrapper),
|
|
5
|
+
* `rebase db push` and the doctor, so all three read and write one row.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SCHEMA_META_SCHEMA = "rebase";
|
|
2
8
|
/**
|
|
3
9
|
* Anything that can run SQL for us.
|
|
4
10
|
*
|
|
@@ -18,7 +24,7 @@ export interface SchemaMetaQueryable {
|
|
|
18
24
|
* `null` instead of a thrown 42P01 — the overwhelmingly common case on a fresh
|
|
19
25
|
* database is that neither exists yet, and that is not news.
|
|
20
26
|
*/
|
|
21
|
-
export declare function
|
|
27
|
+
export declare function readTablesSchemaVersion(db: SchemaMetaQueryable | NodePgDatabase, metaSchema: string): Promise<string | null>;
|
|
22
28
|
/**
|
|
23
29
|
* Record the version this runtime just applied.
|
|
24
30
|
*
|
|
@@ -29,4 +35,4 @@ export declare function readCollectionsSchemaVersion(db: SchemaMetaQueryable | N
|
|
|
29
35
|
* arranges; it is tolerated here for the same reason it is elsewhere in the boot
|
|
30
36
|
* path, and the caller treats any failure as a warning rather than a fatal.
|
|
31
37
|
*/
|
|
32
|
-
export declare function
|
|
38
|
+
export declare function stampTablesSchemaVersion(db: SchemaMetaQueryable | NodePgDatabase, metaSchema: string, version: string): Promise<void>;
|
|
@@ -40,7 +40,25 @@
|
|
|
40
40
|
* out: the objects leave `schema.sql`, Atlas is told to exclude them, and
|
|
41
41
|
* Rebase applies them itself. See `generatePostgresVectorDdl`.
|
|
42
42
|
*/
|
|
43
|
-
import type {
|
|
43
|
+
import type { TableDescriptor } from "@rebasepro/types";
|
|
44
|
+
/**
|
|
45
|
+
* A pgvector distance as the index plan names it — one operator class each,
|
|
46
|
+
* spelled the way `vectorSearch`'s `distance` spells it.
|
|
47
|
+
*/
|
|
48
|
+
export type VectorDistance = "cosine" | "l2" | "inner_product";
|
|
49
|
+
/** How one column's ANN index is built: what a column's `VectorIndexOptions` resolves to. */
|
|
50
|
+
export interface VectorIndexConfig {
|
|
51
|
+
/** `hnsw` (the default) or `ivfflat`. */
|
|
52
|
+
method?: "hnsw" | "ivfflat";
|
|
53
|
+
/** The distance(s) indexed, one index each; `cosine` by default. */
|
|
54
|
+
distance?: VectorDistance | VectorDistance[];
|
|
55
|
+
/** HNSW: connections per node. */
|
|
56
|
+
m?: number;
|
|
57
|
+
/** HNSW: candidate-list size while building. */
|
|
58
|
+
efConstruction?: number;
|
|
59
|
+
/** IVFFlat: number of partitions. */
|
|
60
|
+
lists?: number;
|
|
61
|
+
}
|
|
44
62
|
/**
|
|
45
63
|
* The widest `vector` pgvector will build an HNSW or IVFFlat index over.
|
|
46
64
|
* Storage and exact search are unaffected by this limit.
|
|
@@ -76,21 +94,15 @@ export interface VectorIndexPlan {
|
|
|
76
94
|
export declare class VectorIndexConfigError extends Error {
|
|
77
95
|
constructor(message: string);
|
|
78
96
|
}
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
*
|
|
82
|
-
* `resolveColumn` is passed in rather than imported so that this module stays
|
|
83
|
-
* free of the DDL generator, which imports *it*. Both callers hand it the same
|
|
84
|
-
* `resolveColumnName`, and a contract test asserts the names agree.
|
|
85
|
-
*/
|
|
86
|
-
export declare const buildVectorIndexPlan: (collection: CollectionConfig, resolveColumn: (propName: string, prop?: Property | null) => string) => VectorIndexPlan;
|
|
97
|
+
/** Every ANN index a table's vector columns call for, read from its descriptor. */
|
|
98
|
+
export declare const buildTableVectorIndexPlan: (table: TableDescriptor) => VectorIndexPlan;
|
|
87
99
|
/**
|
|
88
100
|
* The `CREATE INDEX` for one spec.
|
|
89
101
|
*
|
|
90
102
|
* `CONCURRENTLY` is deliberately absent, for the same reason it is absent from
|
|
91
103
|
* `searchIndexStatements`: this form is replayed as part of a migration, where
|
|
92
104
|
* a concurrent build is not allowed. The boot-time ensure rewrites it — see
|
|
93
|
-
* `
|
|
105
|
+
* `ensureTables`.
|
|
94
106
|
*/
|
|
95
107
|
export declare const vectorIndexStatement: (spec: VectorIndexSpec) => string;
|
|
96
108
|
/** Every statement for a plan, in a stable order. */
|
|
@@ -162,14 +174,8 @@ export interface VectorColumnSpec {
|
|
|
162
174
|
/** Rendered after the type, in the generator's order: UNIQUE then NOT NULL. */
|
|
163
175
|
modifiers: string;
|
|
164
176
|
}
|
|
165
|
-
/**
|
|
166
|
-
|
|
167
|
-
*
|
|
168
|
-
* Wider than {@link buildVectorIndexPlan} on purpose: that one answers "what
|
|
169
|
-
* gets an ANN index", and skips both a property with `index: false` and one too
|
|
170
|
-
* wide to index. Either still needs its column.
|
|
171
|
-
*/
|
|
172
|
-
export declare const buildVectorColumnSpecs: (collection: CollectionConfig, resolveColumn: (propName: string, prop?: Property | null) => string) => VectorColumnSpec[];
|
|
177
|
+
/** Every vector column a table declares, read from its descriptor. */
|
|
178
|
+
export declare const buildTableVectorColumnSpecs: (table: TableDescriptor) => VectorColumnSpec[];
|
|
173
179
|
/** The column type — the one place `VECTOR(n)` is spelled. */
|
|
174
180
|
export declare const vectorColumnType: (spec: Pick<VectorColumnSpec, "dimensions">) => string;
|
|
175
181
|
/** The column definition as it appears inside `CREATE TABLE`. */
|
|
@@ -196,13 +202,3 @@ export declare const vectorColumnDefinition: (spec: VectorColumnSpec) => string;
|
|
|
196
202
|
* column was declared as a bare `vector`, which is drift in the same sense.
|
|
197
203
|
*/
|
|
198
204
|
export declare const vectorDimensionGuard: (spec: VectorColumnSpec) => string;
|
|
199
|
-
/**
|
|
200
|
-
* The object names a collection's vector properties own, unqualified.
|
|
201
|
-
*
|
|
202
|
-
* What Atlas has to be told to exclude. Only the column and the ANN indexes: a
|
|
203
|
-
* `UNIQUE` or `NOT NULL` on the column is a property *of* the column, and
|
|
204
|
-
* excluding the column takes them with it — measured against Atlas 1.2.3 and
|
|
205
|
-
* 1.3.2, where a target carrying `vector(3) NOT NULL UNIQUE` and a `schema.sql`
|
|
206
|
-
* carrying neither reported "Schema is synced, no changes to be made".
|
|
207
|
-
*/
|
|
208
|
-
export declare const vectorObjectNames: (collection: CollectionConfig, resolveColumn: (propName: string, prop?: Property | null) => string) => string[];
|