@voltro/database 0.20.1 → 0.21.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 +171 -0
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.js +486 -442
- package/dist/sql.d.ts +25 -10
- package/dist/sql.js +315 -280
- package/package.json +4 -4
package/dist/sql.d.ts
CHANGED
|
@@ -550,6 +550,31 @@ export declare interface ColumnSnapshot {
|
|
|
550
550
|
readonly from: ColumnType;
|
|
551
551
|
readonly using?: string;
|
|
552
552
|
};
|
|
553
|
+
/**
|
|
554
|
+
* Bounded text length from `text().maxLength(n)` — carried on BOTH sides.
|
|
555
|
+
*
|
|
556
|
+
* DECLARED: from the column definition. LIVE: from introspection, and ONLY when
|
|
557
|
+
* the dialect materialises a length. An unbounded text family member
|
|
558
|
+
* (`text`/`longtext`/`mediumtext`/`clob`) leaves this `undefined` rather than
|
|
559
|
+
* reporting the type's theoretical maximum — mysql answers 4294967295 for
|
|
560
|
+
* `longtext`, and comparing that against a declared `undefined` would re-emit an
|
|
561
|
+
* ALTER on every boot forever.
|
|
562
|
+
*
|
|
563
|
+
* WHY IT IS HERE AT ALL. It was absent from the snapshot entirely: the value
|
|
564
|
+
* lived on the column definition, was read only when rendering CREATE DDL, and
|
|
565
|
+
* never reached the comparison. So the differ was not comparing lengths wrongly
|
|
566
|
+
* — it could not see them. Adding `.maxLength(n)` to an EXISTING column planned
|
|
567
|
+
* zero operations and reported "schema is up to date" while the live column
|
|
568
|
+
* stayed `longtext`. A consumer hit that trying to apply the documented remedy
|
|
569
|
+
* for MariaDB's hash long-unique, and their contrast is what pinned it: a column
|
|
570
|
+
* bounded AT CREATION was `varchar(64)` (DDL path, fine), one bounded afterwards
|
|
571
|
+
* stayed `longtext` (diff path, blind).
|
|
572
|
+
*
|
|
573
|
+
* NOT compared on sqlite: it has no length-enforced type, so the declared value
|
|
574
|
+
* is real and the live side can never report one. Comparing them there would
|
|
575
|
+
* re-emit forever. See `sameColumnShape`.
|
|
576
|
+
*/
|
|
577
|
+
readonly maxLength?: number;
|
|
553
578
|
readonly references?: {
|
|
554
579
|
readonly table: string;
|
|
555
580
|
readonly column: string;
|
|
@@ -1074,16 +1099,6 @@ export declare interface IndexSnapshot {
|
|
|
1074
1099
|
readonly expression?: boolean;
|
|
1075
1100
|
}
|
|
1076
1101
|
|
|
1077
|
-
/**
|
|
1078
|
-
* Read the current shape of the connected database. Dispatched per
|
|
1079
|
-
* dialect; supports postgres only.
|
|
1080
|
-
*
|
|
1081
|
-
* The returned `SchemaSnapshot` is the same shape `declaredSnapshot`
|
|
1082
|
-
* produces — they're directly diffable via `planMigrations`.
|
|
1083
|
-
*
|
|
1084
|
-
* Restricted to the `public` schema today; multi-schema apps will
|
|
1085
|
-
* grow a `schema` parameter when we have a real need.
|
|
1086
|
-
*/
|
|
1087
1102
|
export declare const introspectSchema: (sql: SqlClient.SqlClient) => Effect.Effect<SchemaSnapshot, SqlError_2>;
|
|
1088
1103
|
|
|
1089
1104
|
/** Type-guard for the discovery walker. */
|