@voltro/database 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +316 -0
- package/dist/{fileBased-CDnutVVk.js → frameworkLiveTables-BvPIm2cD.js} +174 -174
- package/dist/index.d.ts +15 -0
- package/dist/index.js +651 -651
- package/dist/sql.d.ts +20 -3
- package/dist/sql.js +917 -884
- package/package.json +2 -2
package/dist/sql.d.ts
CHANGED
|
@@ -135,7 +135,13 @@ export declare interface ApplyPlanCtx {
|
|
|
135
135
|
* Caller passes the dialect explicitly. Defaults to `'postgres'` for
|
|
136
136
|
* call-sites that haven't migrated yet.
|
|
137
137
|
*/
|
|
138
|
-
export declare const applySchema: (tables: ReadonlyArray<AnyTable>, dialect?: DialectId
|
|
138
|
+
export declare const applySchema: (tables: ReadonlyArray<AnyTable>, dialect?: DialectId,
|
|
139
|
+
/** NOTIFY channel for the reactive triggers. Pass the SAME value the store
|
|
140
|
+
* was built with. They are two halves of one contract and used to be able to
|
|
141
|
+
* disagree silently: the store listened on its `cdcChannel` while the DDL
|
|
142
|
+
* always emitted on the default, so a custom channel received nothing and
|
|
143
|
+
* raised nothing. */
|
|
144
|
+
cdcChannel?: string) => Effect.Effect<void, never, SqlClient.SqlClient>;
|
|
139
145
|
|
|
140
146
|
/** Per-row backfill body executed by the migration runner. */
|
|
141
147
|
declare type BackfillFunction<TsType = unknown> = (row: Readonly<Record<string, unknown>>) => TsType | Promise<TsType>;
|
|
@@ -706,6 +712,12 @@ declare type ColumnType = 'id' | 'text' | 'integer' | 'real' | 'decimal' | 'bigi
|
|
|
706
712
|
*/
|
|
707
713
|
export declare const declaredSnapshot: (tables: ReadonlyArray<TableLike>, dialect?: DialectId) => SchemaSnapshot;
|
|
708
714
|
|
|
715
|
+
/** The NOTIFY channel a schema emits on when none is configured. Exported so
|
|
716
|
+
* the store and the DDL cannot drift: they must agree, and before this they
|
|
717
|
+
* did not — the store read `options.cdcChannel` while the trigger hardcoded
|
|
718
|
+
* the default, so any custom channel listened to silence. */
|
|
719
|
+
export declare const DEFAULT_CDC_CHANNEL = "framework_changes";
|
|
720
|
+
|
|
709
721
|
/**
|
|
710
722
|
* `DEFAULT <expr>` for an array-valued default.
|
|
711
723
|
*
|
|
@@ -815,7 +827,9 @@ export declare const emitDropColumnDdlMysql: (op: Extract<MigrationOperation, {
|
|
|
815
827
|
* Dialect-uniform now, because there is nothing left in it that only one dialect
|
|
816
828
|
* can express.
|
|
817
829
|
*/
|
|
818
|
-
export declare const emitFrameworkBootstrapSql: (tables: ReadonlyArray<AnyTable>, dialect: DialectId
|
|
830
|
+
export declare const emitFrameworkBootstrapSql: (tables: ReadonlyArray<AnyTable>, dialect: DialectId,
|
|
831
|
+
/** NOTIFY channel for the reactive triggers — see `applySchema`. */
|
|
832
|
+
cdcChannel?: string) => string;
|
|
819
833
|
|
|
820
834
|
/**
|
|
821
835
|
* Emit the full schema DDL SCOPED to a tenant namespace. The container is
|
|
@@ -856,7 +870,10 @@ export declare const emitNamespacedSchemaSql: (tables: ReadonlyArray<AnyTable>,
|
|
|
856
870
|
*/
|
|
857
871
|
export declare const emitNamespaceProvisionDdl: (namespace: string, dialect: DialectId, sqliteFile?: string) => string;
|
|
858
872
|
|
|
859
|
-
export declare const emitSchemaSql: (entities: ReadonlyArray<AnyTable | AnyView>, dialect: DialectId
|
|
873
|
+
export declare const emitSchemaSql: (entities: ReadonlyArray<AnyTable | AnyView>, dialect: DialectId,
|
|
874
|
+
/** NOTIFY channel for the reactive triggers. Must match the store's
|
|
875
|
+
* `cdcChannel`, or writes emit where nothing is listening. */
|
|
876
|
+
cdcChannel?: string) => string;
|
|
860
877
|
|
|
861
878
|
declare type EmptyMerge = unknown;
|
|
862
879
|
|