@drzl/analyzer 1.18.0 → 1.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/README.md CHANGED
@@ -48,10 +48,22 @@ The CLI consumes this analysis to generate validation, services, and routers.
48
48
  - issues (warnings/errors) for constraints and shape
49
49
 
50
50
  Per column, beyond the type: `nullable`, `hasDefault`, `defaultValue` (literal defaults only),
51
- `isGenerated`, `enumValues`, `maxLength` (characters), `maxBytes` (MySQL's TEXT family is a byte
52
- budget, which is a different measurement on the same kind of column), `min`/`max`,
53
- `arrayDimensions`, `format`, and `shape` for values that are not scalars (json, buffer, tuple,
54
- numberObject, vector, bitstring, customType).
51
+ `isGenerated`, `enumValues`, `maxLength` (characters), `maxBytes` (bytes, which is a different
52
+ measurement on the same kind of column), `min`/`max`, `arrayDimensions`, `format`, and `shape` for
53
+ values that are not scalars (json, buffer, tuple, numberObject, vector, bitstring, customType).
54
+
55
+ `maxBytes` is set by MySQL and nothing else. Its TEXT and BLOB families carry their limit in the
56
+ type rather than in a declared length, and count it in bytes: 255 for `tinytext` and `tinyblob`,
57
+ 65535 for `text` and `blob`, 16777215 for the medium pair and 4294967295 for the long pair. A
58
+ `varchar(n)` is genuinely n characters and keeps `maxLength`. See
59
+ [the analyzer page](https://use-drzl.github.io/drzl/packages/analyzer) for how the generators
60
+ encode it.
61
+
62
+ `format` names a pattern in `COLUMN_FORMATS`, and two of its values name a dialect: a
63
+ `bigint({ mode: 'string' })` column is `pgBigint` on Postgres and `mysqlBigint` on MySQL and
64
+ SingleStore, because the two servers really do parse that text differently (`'0x1f'` is 31 on one
65
+ and an error on the other, `'12.5'` is 13 on one and an error on the other). SQL Server carries no
66
+ format for it, since none was measured.
55
67
 
56
68
  `DRZL_ANL_UNKNOWN_COLUMN` is reported for any column whose validator would accept anything, which
57
69
  is the shape a missing type mapping takes: nothing throws, and every row passes.