@uncutsql/core 0.7.0 → 0.9.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/README.md +8 -3
- package/dist/index.cjs +585 -93
- package/dist/index.d.cts +169 -22
- package/dist/index.d.ts +169 -22
- package/dist/index.js +582 -95
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ const migrationSql = (beforeSql: string, afterSql: string) =>
|
|
|
49
49
|
Effect.gen(function* () {
|
|
50
50
|
const before = yield* dialect.toDatabaseSchema(yield* dialect.parse(beforeSql), "before");
|
|
51
51
|
const after = yield* dialect.toDatabaseSchema(yield* dialect.parse(afterSql), "after");
|
|
52
|
-
const { diff } = yield* resolveMigrationDecisions(before, after);
|
|
52
|
+
const { diff } = yield* resolveMigrationDecisions(before, after, undefined, dialect.typeChange);
|
|
53
53
|
const plan = yield* dialect.lowerMigration(planDatabaseMigration(diff), before, after);
|
|
54
54
|
return yield* dialect.encodeMigration(plan);
|
|
55
55
|
});
|
|
@@ -59,8 +59,8 @@ const migrationSql = (beforeSql: string, afterSql: string) =>
|
|
|
59
59
|
// COMMIT;
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
`resolveMigrationDecisions` fails with a `MigrationDecisionError`
|
|
63
|
-
|
|
62
|
+
`resolveMigrationDecisions` fails with a `MigrationDecisionError` when questions about removals
|
|
63
|
+
or type changes need answers. Pass the answered document as its third argument.
|
|
64
64
|
|
|
65
65
|
## Extension contracts
|
|
66
66
|
|
|
@@ -83,6 +83,11 @@ Point the configuration at your own module to use it:
|
|
|
83
83
|
A dialect can also provide `resolveSemanticSchema`, which derives the facts code generators
|
|
84
84
|
rely on (types, nullability, defaults, keys), and a `languageService` for the editor.
|
|
85
85
|
|
|
86
|
+
A mapper can also provide an optional `describe(schema, subject)` that returns a
|
|
87
|
+
`MapperSubjectDescription` (language, labelled type texts, definitions and notes) for a table or
|
|
88
|
+
column. Core passes the mapped schema through unchanged and checks the returned description; a
|
|
89
|
+
mapper without `describe` simply contributes no description.
|
|
90
|
+
|
|
86
91
|
The full contracts, including migration decision documents and executor helpers, are described
|
|
87
92
|
in [DEVELOPMENT.md](DEVELOPMENT.md). The existing dialect and driver packages are the best
|
|
88
93
|
examples.
|