@drzl/validation-core 3.13.0 → 3.15.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
@@ -50,6 +50,23 @@ Shared interfaces and helpers used by validation generators.
50
50
  output and misses `node16`/`nodenext` ES modules. `'ts'` needs
51
51
  `allowImportingTsExtensions`. `.mts` and `.cts` become `.mjs` and `.cjs` under both
52
52
  `'js'` and `'none'`, since an extensionless specifier never resolves to them.
53
+ - CHECK constraints (shared by every generator that reads them)
54
+ - `parseCheck(expression, name)` -> the parts of a `CHECK` that can be stated with certainty:
55
+ column comparisons, `BETWEEN`, `IN (...)`, top-level `AND`, `length()`/`char_length()`,
56
+ `cardinality()`/`array_length(col, 1)`, and comparisons between two columns. A disjunction, a
57
+ negation, `octet_length`, an unrecognised function call and a regex match are all refused
58
+ whole rather than half-applied.
59
+ - `COLUMN_FORMATS` -> patterns for the column formats that are expressible. Only `numeric` is:
60
+ Postgres accepts `today`, `January 8, 1999` and `allballs`, so a date or time pattern would
61
+ reject rows the database takes.
62
+ - `CODEPOINT_LENGTH` -> `[...v].length`, since `varchar(n)` counts characters and JavaScript's
63
+ `.length` counts UTF-16 units. All four generators use it.
64
+ - `isIntegerColumn(c)`
65
+ - Uniqueness
66
+ - `renderDuplicateFinder(table, fnName, rowType)` -> the source of a function returning the rows
67
+ in a batch that collide with an earlier row on a unique constraint. Plain TypeScript with no
68
+ reference to any validation library, so all four generators emit the same one. Null and absent
69
+ columns skip a constraint, matching SQL.
53
70
  - Naming (shared by every generator that emits a schema name)
54
71
  - `resolveAffix({ affix, schemaSuffix })` -> `ResolvedAffix`
55
72
  - `schemaName(mode, tsName, resolved)`, `typeName(mode, tsName, resolved)`