@uncutsql/core 0.6.0 → 0.7.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/dist/index.d.cts +28 -5
- package/dist/index.d.ts +28 -5
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -800,6 +800,11 @@ interface Dialect<Ast, PhysicalPlan, E extends Error = Error, R = never, Semanti
|
|
|
800
800
|
/** The model of an empty database, used as the migration baseline before the first migration. Defaults to `{ tables: [] }`. */
|
|
801
801
|
readonly emptyDatabaseSchema?: DatabaseSchema;
|
|
802
802
|
readonly encodeMigration: (plan: PhysicalPlan) => Effect.Effect<string, E, R>;
|
|
803
|
+
/**
|
|
804
|
+
* When `true`, the dialect is a proof of concept with partial coverage: the CLI loads it only
|
|
805
|
+
* when the project accepts it by `name` (`experimentalDialect`, ADR 0040). Absent means stable.
|
|
806
|
+
*/
|
|
807
|
+
readonly experimental?: boolean;
|
|
803
808
|
readonly format: (ast: Ast) => Effect.Effect<string, E, R>;
|
|
804
809
|
readonly lowerMigration: (migration: DatabaseMigration, before: DatabaseSchema, after: DatabaseSchema) => Effect.Effect<PhysicalPlan, E, R>;
|
|
805
810
|
readonly name: string;
|
|
@@ -945,8 +950,11 @@ interface ExtractResult {
|
|
|
945
950
|
}
|
|
946
951
|
/** One line per omission, ordered by category (unsupported, unmanaged, dependent), then name. */
|
|
947
952
|
export declare const formatExtractOmissions: (omitted: readonly ExtractOmission[]) => readonly string[];
|
|
948
|
-
/**
|
|
949
|
-
|
|
953
|
+
/**
|
|
954
|
+
* What a driver can do with a database, and the dialect its history belongs to. Engine factories
|
|
955
|
+
* build it from a profile; a published driver adds its maturity (`MigrationExecutor`).
|
|
956
|
+
*/
|
|
957
|
+
interface ExecutorCapabilities<E extends Error = Error, R = never> {
|
|
950
958
|
/** Verify a replayed prefix against an existing target, then initialize its history. */
|
|
951
959
|
readonly adopt?: <V extends Error, RV>(target: string, prefix: readonly MigrationSource[], verifySchema: (actual: DatabaseSchema, expected: DatabaseSchema) => Effect.Effect<void, V, RV>, desired?: DatabaseSchema, options?: ReplayOptions) => Effect.Effect<void, E | V, R | RV>;
|
|
952
960
|
readonly apply: <V extends Error, RV>(target: string, migrations: readonly MigrationSource[], desired: DatabaseSchema, verifySchema: (actual: DatabaseSchema, expected: DatabaseSchema, stage: "applied" | "desired") => Effect.Effect<void, V, RV>,
|
|
@@ -961,7 +969,22 @@ interface MigrationExecutor<E extends Error = Error, R = never> {
|
|
|
961
969
|
/** Schema-only SQL in parts, with the objects the driver left out. */
|
|
962
970
|
readonly extract?: (target: string, options?: ExtractOptions) => Effect.Effect<ExtractResult, E, R>;
|
|
963
971
|
/** Undo only the most recently applied migration. */
|
|
964
|
-
readonly rollback?:
|
|
972
|
+
readonly rollback?: ExecutorCapabilities<E, R>["apply"];
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Optional execution capability, selected and wired by the consumer separately from syntax: a
|
|
976
|
+
* published driver's capabilities, and how the package presents itself (ADR 0040). Maturity
|
|
977
|
+
* belongs to the export, never to the factory that built the capabilities.
|
|
978
|
+
*/
|
|
979
|
+
interface MigrationExecutor<E extends Error = Error, R = never> extends ExecutorCapabilities<E, R> {
|
|
980
|
+
/**
|
|
981
|
+
* When `true`, the driver is a proof of concept: the CLI loads it only when the project accepts
|
|
982
|
+
* it by `name` (`experimentalDriver`, ADR 0040). It states the driver's own maturity, whatever
|
|
983
|
+
* its dialect's. Absent means stable.
|
|
984
|
+
*/
|
|
985
|
+
readonly experimental?: boolean;
|
|
986
|
+
/** Identifies the driver in an `experimentalDriver` opt-in. Required when `experimental` is set. */
|
|
987
|
+
readonly name?: string;
|
|
965
988
|
}
|
|
966
989
|
/** The positions a run of migration files covers. */
|
|
967
990
|
interface MigrationRun {
|
|
@@ -1029,7 +1052,7 @@ export declare const mergeMigrationDecisions: (fresh: MigrationDecisions, previo
|
|
|
1029
1052
|
after: DatabaseSchema;
|
|
1030
1053
|
before: DatabaseSchema;
|
|
1031
1054
|
version: 1;
|
|
1032
|
-
}, SchemaDiffError |
|
|
1055
|
+
}, SchemaDiffError | SchemaModelError | MigrationDecisionError, never>;
|
|
1033
1056
|
/** Validate untrusted JSON and resolve intent against fresh comparison results. */
|
|
1034
1057
|
export declare const resolveMigrationDecisions: (before: DatabaseSchema, after: DatabaseSchema, supplied?: unknown) => Effect.Effect<{
|
|
1035
1058
|
decisions: MigrationDecisions;
|
|
@@ -1259,4 +1282,4 @@ interface DynamicGeneratorPlugin {
|
|
|
1259
1282
|
export declare const decodeMapperPlugin: (value: unknown) => Effect.Effect<DynamicMapperPlugin, CodegenError>;
|
|
1260
1283
|
/** Validate the generator value selected from a module by the consumer. */
|
|
1261
1284
|
export declare const decodeGeneratorPlugin: (value: unknown) => Effect.Effect<DynamicGeneratorPlugin, CodegenError>;
|
|
1262
|
-
export type { ApplicationContract, ApplicationMapper, CodegenDiagnostic, ColumnIdentity, Dialect, DynamicGeneratorPlugin, DynamicMapperPlugin, ExecutionOptions, ExecutionResult, ExternalChange, ExternalUse, ExtractOmission, ExtractOptions, ExtractResult, ExtractedPart, GeneratedFile, GenerationResult, Generator, GeneratorDescriptor, GeneratorPlugin, MapperDescriptor, MapperPlugin, MappingResult, MigrationCheckpoint, MigrationExecutor, MigrationRun, MigrationSource, ReplayOptions, SemanticColumn, SemanticColumnType, SemanticDatabaseSchema, SemanticDiagnostic, SemanticDiagnosticSubject, SemanticElement, SemanticFact, SemanticForeignKey, SemanticForeignKeyTarget, SemanticInsertPolicy, SemanticKey, SemanticRelation, SemanticSchemaResolution, SemanticStructField, SemanticValueDomain, SemanticWritePolicy, StatementEdit };
|
|
1285
|
+
export type { ApplicationContract, ApplicationMapper, CodegenDiagnostic, ColumnIdentity, Dialect, DynamicGeneratorPlugin, DynamicMapperPlugin, ExecutionOptions, ExecutionResult, ExecutorCapabilities, ExternalChange, ExternalUse, ExtractOmission, ExtractOptions, ExtractResult, ExtractedPart, GeneratedFile, GenerationResult, Generator, GeneratorDescriptor, GeneratorPlugin, MapperDescriptor, MapperPlugin, MappingResult, MigrationCheckpoint, MigrationExecutor, MigrationRun, MigrationSource, ReplayOptions, SemanticColumn, SemanticColumnType, SemanticDatabaseSchema, SemanticDiagnostic, SemanticDiagnosticSubject, SemanticElement, SemanticFact, SemanticForeignKey, SemanticForeignKeyTarget, SemanticInsertPolicy, SemanticKey, SemanticRelation, SemanticSchemaResolution, SemanticStructField, SemanticValueDomain, SemanticWritePolicy, StatementEdit };
|
package/dist/index.d.ts
CHANGED
|
@@ -800,6 +800,11 @@ interface Dialect<Ast, PhysicalPlan, E extends Error = Error, R = never, Semanti
|
|
|
800
800
|
/** The model of an empty database, used as the migration baseline before the first migration. Defaults to `{ tables: [] }`. */
|
|
801
801
|
readonly emptyDatabaseSchema?: DatabaseSchema;
|
|
802
802
|
readonly encodeMigration: (plan: PhysicalPlan) => Effect.Effect<string, E, R>;
|
|
803
|
+
/**
|
|
804
|
+
* When `true`, the dialect is a proof of concept with partial coverage: the CLI loads it only
|
|
805
|
+
* when the project accepts it by `name` (`experimentalDialect`, ADR 0040). Absent means stable.
|
|
806
|
+
*/
|
|
807
|
+
readonly experimental?: boolean;
|
|
803
808
|
readonly format: (ast: Ast) => Effect.Effect<string, E, R>;
|
|
804
809
|
readonly lowerMigration: (migration: DatabaseMigration, before: DatabaseSchema, after: DatabaseSchema) => Effect.Effect<PhysicalPlan, E, R>;
|
|
805
810
|
readonly name: string;
|
|
@@ -945,8 +950,11 @@ interface ExtractResult {
|
|
|
945
950
|
}
|
|
946
951
|
/** One line per omission, ordered by category (unsupported, unmanaged, dependent), then name. */
|
|
947
952
|
export declare const formatExtractOmissions: (omitted: readonly ExtractOmission[]) => readonly string[];
|
|
948
|
-
/**
|
|
949
|
-
|
|
953
|
+
/**
|
|
954
|
+
* What a driver can do with a database, and the dialect its history belongs to. Engine factories
|
|
955
|
+
* build it from a profile; a published driver adds its maturity (`MigrationExecutor`).
|
|
956
|
+
*/
|
|
957
|
+
interface ExecutorCapabilities<E extends Error = Error, R = never> {
|
|
950
958
|
/** Verify a replayed prefix against an existing target, then initialize its history. */
|
|
951
959
|
readonly adopt?: <V extends Error, RV>(target: string, prefix: readonly MigrationSource[], verifySchema: (actual: DatabaseSchema, expected: DatabaseSchema) => Effect.Effect<void, V, RV>, desired?: DatabaseSchema, options?: ReplayOptions) => Effect.Effect<void, E | V, R | RV>;
|
|
952
960
|
readonly apply: <V extends Error, RV>(target: string, migrations: readonly MigrationSource[], desired: DatabaseSchema, verifySchema: (actual: DatabaseSchema, expected: DatabaseSchema, stage: "applied" | "desired") => Effect.Effect<void, V, RV>,
|
|
@@ -961,7 +969,22 @@ interface MigrationExecutor<E extends Error = Error, R = never> {
|
|
|
961
969
|
/** Schema-only SQL in parts, with the objects the driver left out. */
|
|
962
970
|
readonly extract?: (target: string, options?: ExtractOptions) => Effect.Effect<ExtractResult, E, R>;
|
|
963
971
|
/** Undo only the most recently applied migration. */
|
|
964
|
-
readonly rollback?:
|
|
972
|
+
readonly rollback?: ExecutorCapabilities<E, R>["apply"];
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Optional execution capability, selected and wired by the consumer separately from syntax: a
|
|
976
|
+
* published driver's capabilities, and how the package presents itself (ADR 0040). Maturity
|
|
977
|
+
* belongs to the export, never to the factory that built the capabilities.
|
|
978
|
+
*/
|
|
979
|
+
interface MigrationExecutor<E extends Error = Error, R = never> extends ExecutorCapabilities<E, R> {
|
|
980
|
+
/**
|
|
981
|
+
* When `true`, the driver is a proof of concept: the CLI loads it only when the project accepts
|
|
982
|
+
* it by `name` (`experimentalDriver`, ADR 0040). It states the driver's own maturity, whatever
|
|
983
|
+
* its dialect's. Absent means stable.
|
|
984
|
+
*/
|
|
985
|
+
readonly experimental?: boolean;
|
|
986
|
+
/** Identifies the driver in an `experimentalDriver` opt-in. Required when `experimental` is set. */
|
|
987
|
+
readonly name?: string;
|
|
965
988
|
}
|
|
966
989
|
/** The positions a run of migration files covers. */
|
|
967
990
|
interface MigrationRun {
|
|
@@ -1029,7 +1052,7 @@ export declare const mergeMigrationDecisions: (fresh: MigrationDecisions, previo
|
|
|
1029
1052
|
after: DatabaseSchema;
|
|
1030
1053
|
before: DatabaseSchema;
|
|
1031
1054
|
version: 1;
|
|
1032
|
-
}, SchemaDiffError |
|
|
1055
|
+
}, SchemaDiffError | SchemaModelError | MigrationDecisionError, never>;
|
|
1033
1056
|
/** Validate untrusted JSON and resolve intent against fresh comparison results. */
|
|
1034
1057
|
export declare const resolveMigrationDecisions: (before: DatabaseSchema, after: DatabaseSchema, supplied?: unknown) => Effect.Effect<{
|
|
1035
1058
|
decisions: MigrationDecisions;
|
|
@@ -1259,4 +1282,4 @@ interface DynamicGeneratorPlugin {
|
|
|
1259
1282
|
export declare const decodeMapperPlugin: (value: unknown) => Effect.Effect<DynamicMapperPlugin, CodegenError>;
|
|
1260
1283
|
/** Validate the generator value selected from a module by the consumer. */
|
|
1261
1284
|
export declare const decodeGeneratorPlugin: (value: unknown) => Effect.Effect<DynamicGeneratorPlugin, CodegenError>;
|
|
1262
|
-
export type { ApplicationContract, ApplicationMapper, CodegenDiagnostic, ColumnIdentity, Dialect, DynamicGeneratorPlugin, DynamicMapperPlugin, ExecutionOptions, ExecutionResult, ExternalChange, ExternalUse, ExtractOmission, ExtractOptions, ExtractResult, ExtractedPart, GeneratedFile, GenerationResult, Generator, GeneratorDescriptor, GeneratorPlugin, MapperDescriptor, MapperPlugin, MappingResult, MigrationCheckpoint, MigrationExecutor, MigrationRun, MigrationSource, ReplayOptions, SemanticColumn, SemanticColumnType, SemanticDatabaseSchema, SemanticDiagnostic, SemanticDiagnosticSubject, SemanticElement, SemanticFact, SemanticForeignKey, SemanticForeignKeyTarget, SemanticInsertPolicy, SemanticKey, SemanticRelation, SemanticSchemaResolution, SemanticStructField, SemanticValueDomain, SemanticWritePolicy, StatementEdit };
|
|
1285
|
+
export type { ApplicationContract, ApplicationMapper, CodegenDiagnostic, ColumnIdentity, Dialect, DynamicGeneratorPlugin, DynamicMapperPlugin, ExecutionOptions, ExecutionResult, ExecutorCapabilities, ExternalChange, ExternalUse, ExtractOmission, ExtractOptions, ExtractResult, ExtractedPart, GeneratedFile, GenerationResult, Generator, GeneratorDescriptor, GeneratorPlugin, MapperDescriptor, MapperPlugin, MappingResult, MigrationCheckpoint, MigrationExecutor, MigrationRun, MigrationSource, ReplayOptions, SemanticColumn, SemanticColumnType, SemanticDatabaseSchema, SemanticDiagnostic, SemanticDiagnosticSubject, SemanticElement, SemanticFact, SemanticForeignKey, SemanticForeignKeyTarget, SemanticInsertPolicy, SemanticKey, SemanticRelation, SemanticSchemaResolution, SemanticStructField, SemanticValueDomain, SemanticWritePolicy, StatementEdit };
|