@drzl/analyzer 1.17.0 → 1.17.1

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.cjs CHANGED
@@ -578,7 +578,20 @@ var _SchemaAnalyzer = class _SchemaAnalyzer {
578
578
  // 0.4x gives an enum its own class, which had no arm here at all, so an enum column came
579
579
  // back `unknown` and every generator emitted a schema that accepted anything. The values
580
580
  // were on the column the whole time, in `enumValues`, waiting for a type to attach to.
581
+ //
582
+ // The MySQL and SingleStore classes were added later than the Postgres one, and their
583
+ // absence showed up somewhere unexpected: the emitted validator was already right, because
584
+ // every generator reads `enumValues` before it reads `tsType`, so the only thing wrong was
585
+ // the description. That description reached the user anyway, through the untyped-column
586
+ // warning, which said an enum column "will accept any value" while the emitted schema
587
+ // accepted exactly three. A warning that is wrong about the one thing it names is worse
588
+ // than no warning, because it teaches the reader to skip the true ones.
589
+ //
590
+ // v1 already answered `string` here, so this is also the two majors agreeing again rather
591
+ // than a new opinion; the cross-major diff carried the disagreement as a filed defect.
581
592
  case "PgEnumColumn":
593
+ case "MySqlEnumColumn":
594
+ case "SingleStoreEnumColumn":
582
595
  return { tsType: "string", dbType: "TEXT" };
583
596
  case "PgInteger":
584
597
  case "PgSmallInt":
package/dist/index.js CHANGED
@@ -537,7 +537,20 @@ var _SchemaAnalyzer = class _SchemaAnalyzer {
537
537
  // 0.4x gives an enum its own class, which had no arm here at all, so an enum column came
538
538
  // back `unknown` and every generator emitted a schema that accepted anything. The values
539
539
  // were on the column the whole time, in `enumValues`, waiting for a type to attach to.
540
+ //
541
+ // The MySQL and SingleStore classes were added later than the Postgres one, and their
542
+ // absence showed up somewhere unexpected: the emitted validator was already right, because
543
+ // every generator reads `enumValues` before it reads `tsType`, so the only thing wrong was
544
+ // the description. That description reached the user anyway, through the untyped-column
545
+ // warning, which said an enum column "will accept any value" while the emitted schema
546
+ // accepted exactly three. A warning that is wrong about the one thing it names is worse
547
+ // than no warning, because it teaches the reader to skip the true ones.
548
+ //
549
+ // v1 already answered `string` here, so this is also the two majors agreeing again rather
550
+ // than a new opinion; the cross-major diff carried the disagreement as a filed defect.
540
551
  case "PgEnumColumn":
552
+ case "MySqlEnumColumn":
553
+ case "SingleStoreEnumColumn":
541
554
  return { tsType: "string", dbType: "TEXT" };
542
555
  case "PgInteger":
543
556
  case "PgSmallInt":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drzl/analyzer",
3
- "version": "1.17.0",
3
+ "version": "1.17.1",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",