@rebasepro/server-postgres 0.16.0 → 0.16.1-canary.g0d7af95
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/dist/PostgresAdapter.d.ts +1 -1
- package/dist/PostgresBackendDriver.d.ts +75 -12
- package/dist/PostgresBootstrapper.d.ts +6 -6
- package/dist/auth/services.d.ts +1 -1
- package/dist/backup/backup-cron.d.ts +1 -1
- package/dist/backup/backup-service.d.ts +2 -2
- package/dist/backup/index.d.ts +4 -4
- package/dist/{backup-service-BZoixhVl.js → backup-service-BtgHxfFm.js} +5 -4
- package/dist/{backup-service-BZoixhVl.js.map → backup-service-BtgHxfFm.js.map} +1 -1
- package/dist/cli-helpers.d.ts +41 -0
- package/dist/{auth-users-columns-CgyPWQ18.js → collection-index-DxJBvVTH.js} +486 -503
- package/dist/collection-index-DxJBvVTH.js.map +1 -0
- package/dist/collections/PostgresCollectionRegistry.d.ts +1 -1
- package/dist/collections/buildRegistry.d.ts +1 -1
- package/dist/collections/validate-relations.d.ts +1 -1
- package/dist/{connection-BuZ97wsr.js → connection-GOKU3Hu5.js} +34 -7
- package/dist/connection-GOKU3Hu5.js.map +1 -0
- package/dist/connection.d.ts +16 -0
- package/dist/data-transformer.d.ts +1 -1
- package/dist/{ensure-collection-policies-BVFb2olB.js → ensure-collection-policies-DFpOl8SM.js} +4 -4
- package/dist/{ensure-collection-policies-BVFb2olB.js.map → ensure-collection-policies-DFpOl8SM.js.map} +1 -1
- package/dist/ensure-collection-tables-DMjOkeRy.js +1952 -0
- package/dist/ensure-collection-tables-DMjOkeRy.js.map +1 -0
- package/dist/index.d.ts +16 -16
- package/dist/index.es.js +19 -7128
- package/dist/index.es.js.map +1 -1
- package/dist/{rls-bootstrap-sql-B5Sajku6.js → rls-bootstrap-sql-DNzaWd4C.js} +3 -3
- package/dist/{rls-bootstrap-sql-B5Sajku6.js.map → rls-bootstrap-sql-DNzaWd4C.js.map} +1 -1
- package/dist/{rls-enforcement-Ch0T6OwW.js → rls-enforcement-CInuYj1-.js} +14 -4
- package/dist/rls-enforcement-CInuYj1-.js.map +1 -0
- package/dist/schema/classify-change.d.ts +82 -0
- package/dist/schema/collection-index.d.ts +182 -0
- package/dist/schema/dynamic-tables.d.ts +1 -1
- package/dist/schema/ensure-collection-policies.d.ts +1 -1
- package/dist/schema/ensure-collection-tables.d.ts +93 -2
- package/dist/schema/generate-schema-commit.d.ts +136 -0
- package/dist/schema/generated-schema-staleness.d.ts +19 -0
- package/dist/schema/introspect-db-constraints.d.ts +1 -1
- package/dist/schema/introspect-db-logic.d.ts +3 -3
- package/dist/schema/introspect-db-project.d.ts +1 -1
- package/dist/schema/introspect-db-queries.d.ts +1 -1
- package/dist/schema/introspect-db-structure.d.ts +2 -2
- package/dist/schema/introspect-runtime.d.ts +1 -1
- package/dist/schema/vector-index.d.ts +88 -0
- package/dist/services/BranchService.d.ts +2 -2
- package/dist/services/FetchService.d.ts +4 -4
- package/dist/services/PersistService.d.ts +5 -5
- package/dist/services/RelationService.d.ts +3 -3
- package/dist/services/RelationWriteService.d.ts +3 -3
- package/dist/services/cdc/junction-tables.d.ts +1 -1
- package/dist/services/cdc/trigger-cdc.d.ts +1 -1
- package/dist/services/channel-bus/PostgresChannelBus.d.ts +1 -1
- package/dist/services/channel-bus/index.d.ts +2 -2
- package/dist/services/collection-helpers.d.ts +1 -1
- package/dist/services/dataService.d.ts +10 -10
- package/dist/services/index.d.ts +4 -4
- package/dist/services/junction-writes.d.ts +2 -2
- package/dist/services/nested-path.d.ts +1 -1
- package/dist/services/realtimeService.d.ts +3 -3
- package/dist/services/row-pipeline.d.ts +1 -1
- package/dist/services/write-denial.d.ts +1 -1
- package/dist/{src-BBFsDaeA.js → src-DiDgtX8P.js} +97 -1
- package/dist/src-DiDgtX8P.js.map +1 -0
- package/dist/utils/drizzle-conditions.d.ts +2 -2
- package/dist/websocket-CUnpSe8v.js +8188 -0
- package/dist/websocket-CUnpSe8v.js.map +1 -0
- package/dist/websocket.d.ts +29 -2
- package/package.json +7 -7
- package/src/PostgresBackendDriver.ts +190 -59
- package/src/backup/backup-service.ts +1 -1
- package/src/cli-helpers.ts +117 -2
- package/src/cli.ts +22 -0
- package/src/connection.ts +37 -3
- package/src/databasePoolManager.ts +5 -2
- package/src/schema/classify-change.ts +436 -0
- package/src/schema/collection-index.ts +427 -0
- package/src/schema/ensure-collection-tables.test.ts +168 -1
- package/src/schema/ensure-collection-tables.ts +365 -14
- package/src/schema/generate-drizzle-schema-logic.ts +23 -11
- package/src/schema/generate-drizzle-schema.ts +13 -2
- package/src/schema/generate-postgres-ddl-logic.ts +33 -6
- package/src/schema/generate-postgres-ddl.ts +13 -2
- package/src/schema/generate-schema-commit.ts +242 -0
- package/src/schema/generated-schema-staleness.ts +114 -1
- package/src/schema/vector-index.ts +278 -0
- package/src/services/collection-helpers.ts +3 -2
- package/src/websocket.ts +47 -3
- package/dist/auth-users-columns-CgyPWQ18.js.map +0 -1
- package/dist/connection-BuZ97wsr.js.map +0 -1
- package/dist/data_driver-ULAyJEi9.js +0 -193
- package/dist/data_driver-ULAyJEi9.js.map +0 -1
- package/dist/ensure-collection-tables-BY1pHRD_.js +0 -840
- package/dist/ensure-collection-tables-BY1pHRD_.js.map +0 -1
- package/dist/rls-enforcement-Ch0T6OwW.js.map +0 -1
- package/dist/src-BBFsDaeA.js.map +0 -1
- package/dist/utils/table-classification.d.ts +0 -8
- package/dist/websocket-BVgDVO-V.js +0 -614
- package/dist/websocket-BVgDVO-V.js.map +0 -1
- package/src/utils/table-classification.ts +0 -16
package/dist/cli-helpers.d.ts
CHANGED
|
@@ -89,6 +89,47 @@ export declare function seedDevDatabaseSearchHelpers(devDatabaseUrl: string, col
|
|
|
89
89
|
* catalogs. Separated from {@link getTableExcludes} so its failure mode can
|
|
90
90
|
* be handled explicitly (fail closed) and so tests can inject a stub.
|
|
91
91
|
*/
|
|
92
|
+
/**
|
|
93
|
+
* Every index Postgres holds on a table Rebase manages, as
|
|
94
|
+
* `schema.table.index`.
|
|
95
|
+
*
|
|
96
|
+
* Constraint-backed indexes are left out: a `PRIMARY KEY` or a `UNIQUE` is a
|
|
97
|
+
* *constraint* to Atlas, diffed from the constraint declaration, and naming its
|
|
98
|
+
* index in an exclude would shield the constraint itself.
|
|
99
|
+
*/
|
|
100
|
+
export declare function queryExistingIndexes(databaseUrl: string): Promise<string[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Glob patterns keeping Atlas away from indexes that are not Rebase's.
|
|
103
|
+
*
|
|
104
|
+
* The problem this solves is live and predates the `indexes:` block. `db push`
|
|
105
|
+
* is declarative, so an index on a managed table that is absent from
|
|
106
|
+
* `schema.sql` is drift — and Atlas plans `DROP INDEX` for it. Verified
|
|
107
|
+
* against atlas v1.2.3: create one by hand, re-run an unchanged push, and the
|
|
108
|
+
* plan is a bare drop. `DROP INDEX` is not in `DESTRUCTIVE_PATTERNS`, so the
|
|
109
|
+
* auto-approved apply took it without asking. Until now the only way to have
|
|
110
|
+
* an index at all was to write it by hand, which made that the *only* outcome.
|
|
111
|
+
*
|
|
112
|
+
* Ownership rather than a prompt, because once indexes are declarable a drop
|
|
113
|
+
* is usually correct: removing one from the config should remove it from the
|
|
114
|
+
* database, quietly. What must never be dropped is an index Rebase never
|
|
115
|
+
* created — a hand-written one, or one an introspected database arrived with.
|
|
116
|
+
* {@link isRebaseIndexName} is the test, the same arrangement
|
|
117
|
+
* `isGeneratedPolicyName` uses to let policy reconciliation drop only what it
|
|
118
|
+
* generated.
|
|
119
|
+
*
|
|
120
|
+
* The named-in-the-desired-state check comes first and is what makes removal
|
|
121
|
+
* work: a declared index that the author has just deleted still matches the
|
|
122
|
+
* name pattern, is no longer in the plan, and so is *not* excluded — Atlas
|
|
123
|
+
* drops it, as intended.
|
|
124
|
+
*
|
|
125
|
+
* Three-part `schema.table.index`, never two: a two-part pattern reads as a
|
|
126
|
+
* *table* named `<index>` in a *schema* named `<table>`, matches nothing, and
|
|
127
|
+
* reports no error — the trap already recorded for the search excludes.
|
|
128
|
+
*/
|
|
129
|
+
export declare function getForeignIndexExcludes(databaseUrl: string, collectionsPath: string, deps?: {
|
|
130
|
+
queryExistingIndexes?: (databaseUrl: string) => Promise<string[]>;
|
|
131
|
+
getManagedIndexNames?: (collectionsPath: string) => Promise<Set<string>>;
|
|
132
|
+
}): Promise<string[]>;
|
|
92
133
|
export declare function queryExistingTables(databaseUrl: string): Promise<string[]>;
|
|
93
134
|
/**
|
|
94
135
|
* Raised when the exclude list could not be built. `db push` MUST abort on
|