@workerstack/database 0.21.0 → 0.22.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.
Files changed (82) hide show
  1. package/README.md +197 -33
  2. package/docs/meta-contract.md +55 -1
  3. package/package.json +1 -6
  4. package/src/codegen/analyzer-types.ts +6 -1
  5. package/src/codegen/annotations.ts +66 -9
  6. package/src/codegen/format-constraints.ts +114 -0
  7. package/src/codegen/generators/dtos/entity-file.ts +2 -1
  8. package/src/codegen/generators/dtos/example-meta.ts +22 -2
  9. package/src/codegen/generators/dtos/field-schema.ts +31 -8
  10. package/src/codegen/generators/dtos/ip-patterns.ts +25 -11
  11. package/src/codegen/generators/dtos/number-range.ts +22 -3
  12. package/src/codegen/generators/dtos/schema-aliases.ts +5 -3
  13. package/src/codegen/generators/dtos/text-format.ts +63 -0
  14. package/src/codegen/generators/dtos/text-schema.ts +49 -2
  15. package/src/codegen/generators/manifest.ts +9 -1
  16. package/src/codegen/runtime/read-comb.ts +71 -3
  17. package/src/codegen/runtime/read-tables.ts +31 -19
  18. package/src/codegen/runtime/snapshot-types.ts +3 -1
  19. package/src/codegen/runtime/to-meta.ts +6 -3
  20. package/src/formats/catalog.ts +255 -0
  21. package/src/formats/iana-time-zone.ts +117 -0
  22. package/src/formats/iso3166-1.ts +78 -0
  23. package/src/formats/iso4217.ts +42 -0
  24. package/src/formats/iso639-1.ts +41 -0
  25. package/src/formats/uts35.ts +143 -0
  26. package/src/index.ts +5 -0
  27. package/src/meta/column.ts +22 -9
  28. package/src/pg/columns.ts +6 -4
  29. package/src/sqlite/columns.ts +6 -4
  30. package/src/sqlite/constraints.ts +120 -6
  31. package/types/codegen/analyzer-types.d.ts +6 -1
  32. package/types/codegen/analyzer-types.d.ts.map +1 -1
  33. package/types/codegen/annotations.d.ts +12 -7
  34. package/types/codegen/annotations.d.ts.map +1 -1
  35. package/types/codegen/format-constraints.d.ts +22 -0
  36. package/types/codegen/format-constraints.d.ts.map +1 -0
  37. package/types/codegen/generators/dtos/entity-file.d.ts.map +1 -1
  38. package/types/codegen/generators/dtos/example-meta.d.ts.map +1 -1
  39. package/types/codegen/generators/dtos/field-schema.d.ts.map +1 -1
  40. package/types/codegen/generators/dtos/ip-patterns.d.ts +7 -0
  41. package/types/codegen/generators/dtos/ip-patterns.d.ts.map +1 -1
  42. package/types/codegen/generators/dtos/number-range.d.ts +8 -0
  43. package/types/codegen/generators/dtos/number-range.d.ts.map +1 -1
  44. package/types/codegen/generators/dtos/schema-aliases.d.ts +1 -1
  45. package/types/codegen/generators/dtos/schema-aliases.d.ts.map +1 -1
  46. package/types/codegen/generators/dtos/text-format.d.ts +31 -0
  47. package/types/codegen/generators/dtos/text-format.d.ts.map +1 -0
  48. package/types/codegen/generators/dtos/text-schema.d.ts +8 -1
  49. package/types/codegen/generators/dtos/text-schema.d.ts.map +1 -1
  50. package/types/codegen/generators/manifest.d.ts +5 -0
  51. package/types/codegen/generators/manifest.d.ts.map +1 -1
  52. package/types/codegen/runtime/read-comb.d.ts +17 -3
  53. package/types/codegen/runtime/read-comb.d.ts.map +1 -1
  54. package/types/codegen/runtime/read-tables.d.ts.map +1 -1
  55. package/types/codegen/runtime/snapshot-types.d.ts +3 -1
  56. package/types/codegen/runtime/snapshot-types.d.ts.map +1 -1
  57. package/types/codegen/runtime/to-meta.d.ts.map +1 -1
  58. package/types/formats/catalog.d.ts +51 -0
  59. package/types/formats/catalog.d.ts.map +1 -0
  60. package/types/formats/iana-time-zone.d.ts +7 -0
  61. package/types/formats/iana-time-zone.d.ts.map +1 -0
  62. package/types/formats/iso3166-1.d.ts +12 -0
  63. package/types/formats/iso3166-1.d.ts.map +1 -0
  64. package/types/formats/iso4217.d.ts +7 -0
  65. package/types/formats/iso4217.d.ts.map +1 -0
  66. package/types/formats/iso639-1.d.ts +6 -0
  67. package/types/formats/iso639-1.d.ts.map +1 -0
  68. package/types/formats/uts35.d.ts +13 -0
  69. package/types/formats/uts35.d.ts.map +1 -0
  70. package/types/index.d.ts +5 -0
  71. package/types/index.d.ts.map +1 -1
  72. package/types/meta/column.d.ts +7 -1
  73. package/types/meta/column.d.ts.map +1 -1
  74. package/types/pg/columns.d.ts +3 -3
  75. package/types/pg/columns.d.ts.map +1 -1
  76. package/types/sqlite/columns.d.ts +3 -3
  77. package/types/sqlite/columns.d.ts.map +1 -1
  78. package/types/sqlite/constraints.d.ts +117 -5
  79. package/types/sqlite/constraints.d.ts.map +1 -1
  80. package/src/sqlite/patterns.ts +0 -19
  81. package/types/sqlite/patterns.d.ts +0 -19
  82. package/types/sqlite/patterns.d.ts.map +0 -1
@@ -0,0 +1,78 @@
1
+ // Written by `bun scripts/registries.ts` from the pinned release below: edit the script, not this file.
2
+ // Debian iso-codes v4.20.1: https://salsa.debian.org/iso-codes-team/iso-codes/-/raw/v4.20.1/data/iso_3166-1.json
3
+ // the alpha-2 and alpha-3 code of every officially assigned country
4
+
5
+ // lookup-table: the 249 codes, one line per first letter, read by isIso3166Alpha2
6
+ const ALPHA_2: ReadonlySet<string> = /* @__PURE__ */ new Set(
7
+ /* @__PURE__ */ `AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ
8
+ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ
9
+ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ
10
+ DE DJ DK DM DO DZ
11
+ EC EE EG EH ER ES ET
12
+ FI FJ FK FM FO FR
13
+ GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY
14
+ HK HM HN HR HT HU
15
+ ID IE IL IM IN IO IQ IR IS IT
16
+ JE JM JO JP
17
+ KE KG KH KI KM KN KP KR KW KY KZ
18
+ LA LB LC LI LK LR LS LT LU LV LY
19
+ MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ
20
+ NA NC NE NF NG NI NL NO NP NR NU NZ
21
+ OM
22
+ PA PE PF PG PH PK PL PM PN PR PS PT PW PY
23
+ QA
24
+ RE RO RS RU RW
25
+ SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ
26
+ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ
27
+ UA UG UM US UY UZ
28
+ VA VC VE VG VI VN VU
29
+ WF WS
30
+ YE YT
31
+ ZA ZM ZW`.split(/\s/u),
32
+ )
33
+
34
+ // lookup-table: the 249 codes, one line per first letter, read by isIso3166Alpha3
35
+ const ALPHA_3: ReadonlySet<string> = /* @__PURE__ */ new Set(
36
+ /* @__PURE__ */ `ABW AFG AGO AIA ALA ALB AND ARE ARG ARM ASM ATA ATF ATG AUS AUT AZE
37
+ BDI BEL BEN BES BFA BGD BGR BHR BHS BIH BLM BLR BLZ BMU BOL BRA BRB BRN BTN BVT BWA
38
+ CAF CAN CCK CHE CHL CHN CIV CMR COD COG COK COL COM CPV CRI CUB CUW CXR CYM CYP CZE
39
+ DEU DJI DMA DNK DOM DZA
40
+ ECU EGY ERI ESH ESP EST ETH
41
+ FIN FJI FLK FRA FRO FSM
42
+ GAB GBR GEO GGY GHA GIB GIN GLP GMB GNB GNQ GRC GRD GRL GTM GUF GUM GUY
43
+ HKG HMD HND HRV HTI HUN
44
+ IDN IMN IND IOT IRL IRN IRQ ISL ISR ITA
45
+ JAM JEY JOR JPN
46
+ KAZ KEN KGZ KHM KIR KNA KOR KWT
47
+ LAO LBN LBR LBY LCA LIE LKA LSO LTU LUX LVA
48
+ MAC MAF MAR MCO MDA MDG MDV MEX MHL MKD MLI MLT MMR MNE MNG MNP MOZ MRT MSR MTQ MUS MWI MYS MYT
49
+ NAM NCL NER NFK NGA NIC NIU NLD NOR NPL NRU NZL
50
+ OMN
51
+ PAK PAN PCN PER PHL PLW PNG POL PRI PRK PRT PRY PSE PYF
52
+ QAT
53
+ REU ROU RUS RWA
54
+ SAU SDN SEN SGP SGS SHN SJM SLB SLE SLV SMR SOM SPM SRB SSD STP SUR SVK SVN SWE SWZ SXM SYC SYR
55
+ TCA TCD TGO THA TJK TKL TKM TLS TON TTO TUN TUR TUV TWN TZA
56
+ UGA UKR UMI URY USA UZB
57
+ VAT VCT VEN VGB VIR VNM VUT
58
+ WLF WSM
59
+ YEM
60
+ ZAF ZMB ZWE`.split(/\s/u),
61
+ )
62
+
63
+ /**
64
+ * Whether `value` is an officially assigned ISO 3166-1 alpha-2 country code, exactly as written: uppercase, such as
65
+ * HR or GB (UK is reserved, not assigned). The codes are those of Debian iso-codes v4.20.1. Any string is taken;
66
+ * this never throws.
67
+ */
68
+ export function isIso3166Alpha2(value: string): boolean {
69
+ return ALPHA_2.has(value)
70
+ }
71
+
72
+ /**
73
+ * Whether `value` is an officially assigned ISO 3166-1 alpha-3 country code, exactly as written: uppercase, such as
74
+ * HRV or GBR. The codes are those of Debian iso-codes v4.20.1. Any string is taken; this never throws.
75
+ */
76
+ export function isIso3166Alpha3(value: string): boolean {
77
+ return ALPHA_3.has(value)
78
+ }
@@ -0,0 +1,42 @@
1
+ // Written by `bun scripts/registries.ts` from the pinned release below: edit the script, not this file.
2
+ // ISO 4217 list one as SIX published it on 2026-09-17: https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml
3
+ // the distinct alphabetic codes
4
+
5
+ // lookup-table: the 178 alphabetic codes of the 2026-09-17 list, one line per first letter, read by isIso4217
6
+ const CODES: ReadonlySet<string> = /* @__PURE__ */ new Set(
7
+ /* @__PURE__ */ `AED AFN ALL AMD AOA ARS AUD AWG AZN
8
+ BAM BBD BDT BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD
9
+ CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUP CVE CZK
10
+ DJF DKK DOP DZD
11
+ EGP ERN ETB EUR
12
+ FJD FKP
13
+ GBP GEL GHS GIP GMD GNF GTQ GYD
14
+ HKD HNL HTG HUF
15
+ IDR ILS INR IQD IRR ISK
16
+ JMD JOD JPY
17
+ KES KGS KHR KMF KPW KRW KWD KYD KZT
18
+ LAK LBP LKR LRD LSL LYD
19
+ MAD MDL MGA MKD MMK MNT MOP MRU MUR MVR MWK MXN MXV MYR MZN
20
+ NAD NGN NIO NOK NPR NZD
21
+ OMR
22
+ PAB PEN PGK PHP PKR PLN PYG
23
+ QAR
24
+ RON RSD RUB RWF
25
+ SAR SBD SCR SDG SEK SGD SHP SLE SOS SRD SSP STN SVC SYP SZL
26
+ THB TJS TMT TND TOP TRY TTD TWD TZS
27
+ UAH UGX USD USN UYI UYU UYW UZS
28
+ VED VES VND VUV
29
+ WST
30
+ XAD XAF XAG XAU XBA XBB XBC XBD XCD XCG XDR XOF XPD XPF XPT XSU XTS XUA XXX
31
+ YER
32
+ ZAR ZMW ZWG`.split(/\s/u),
33
+ )
34
+
35
+ /**
36
+ * Whether `value` is a current ISO 4217 alphabetic currency code, exactly as written: uppercase, such as EUR or USD.
37
+ * The codes are those of the list published 2026-09-17, fund and precious metal codes such as XAU included;
38
+ * a withdrawn code such as HRK is not one. Any string is taken; this never throws.
39
+ */
40
+ export function isIso4217(value: string): boolean {
41
+ return CODES.has(value)
42
+ }
@@ -0,0 +1,41 @@
1
+ // Written by `bun scripts/registries.ts` from the pinned release below: edit the script, not this file.
2
+ // Debian iso-codes v4.20.1: https://salsa.debian.org/iso-codes-team/iso-codes/-/raw/v4.20.1/data/iso_639-2.json
3
+ // the two-letter code of every ISO 639-2 language that has one, which is ISO 639-1
4
+
5
+ // lookup-table: the 183 two-letter language codes, one line per first letter, read by isIso639Alpha2
6
+ const CODES: ReadonlySet<string> = /* @__PURE__ */ new Set(
7
+ /* @__PURE__ */ `aa ab ae af ak am an ar as av ay az
8
+ ba be bg bi bm bn bo br bs
9
+ ca ce ch co cr cs cu cv cy
10
+ da de dv dz
11
+ ee el en eo es et eu
12
+ fa ff fi fj fo fr fy
13
+ ga gd gl gn gu gv
14
+ ha he hi ho hr ht hu hy hz
15
+ ia id ie ig ii ik io is it iu
16
+ ja jv
17
+ ka kg ki kj kk kl km kn ko kr ks ku kv kw ky
18
+ la lb lg li ln lo lt lu lv
19
+ mg mh mi mk ml mn mr ms mt my
20
+ na nb nd ne ng nl nn no nr nv ny
21
+ oc oj om or os
22
+ pa pi pl ps pt
23
+ qu
24
+ rm rn ro ru rw
25
+ sa sc sd se sg si sk sl sm sn so sq sr ss st su sv sw
26
+ ta te tg th ti tk tl tn to tr ts tt tw ty
27
+ ug uk ur uz
28
+ ve vi vo
29
+ wa wo
30
+ xh
31
+ yi yo
32
+ za zh zu`.split(/\s/u),
33
+ )
34
+
35
+ /**
36
+ * Whether `value` is an ISO 639-1 two-letter language code, exactly as written: lowercase, such as hr or en. The
37
+ * codes are those of Debian iso-codes v4.20.1. Any string is taken; this never throws.
38
+ */
39
+ export function isIso639Alpha2(value: string): boolean {
40
+ return CODES.has(value)
41
+ }
@@ -0,0 +1,143 @@
1
+ // Written by `bun scripts/registries.ts` from the pinned release below: edit the script, not this file.
2
+ // Unicode CLDR release-49:
3
+ // https://raw.githubusercontent.com/unicode-org/cldr/release-49/common/bcp47/calendar.xml
4
+ // https://raw.githubusercontent.com/unicode-org/cldr/release-49/common/bcp47/measure.xml
5
+ // https://raw.githubusercontent.com/unicode-org/cldr/release-49/common/bcp47/number.xml
6
+
7
+ /** The 18 values of the `ca` (calendar) key of a Unicode locale extension, deprecated ones dropped. */
8
+ export const CALENDARS: readonly string[] = [
9
+ "buddhist",
10
+ "chinese",
11
+ "coptic",
12
+ "dangi",
13
+ "ethioaa",
14
+ "ethiopic",
15
+ "gregory",
16
+ "hebrew",
17
+ "indian",
18
+ "islamic",
19
+ "islamic-civil",
20
+ "islamic-rgsa",
21
+ "islamic-tbla",
22
+ "islamic-umalqura",
23
+ "iso8601",
24
+ "japanese",
25
+ "persian",
26
+ "roc",
27
+ ]
28
+
29
+ /** The 7 values of the `fw` (first day of the week) key of a Unicode locale extension, deprecated ones dropped. */
30
+ export const FIRST_DAYS: readonly string[] = ["fri", "mon", "sat", "sun", "thu", "tue", "wed"]
31
+
32
+ /** The 6 values of the `hc` (hour cycle) key of a Unicode locale extension, deprecated ones dropped. */
33
+ export const HOUR_CYCLES: readonly string[] = ["c12", "c24", "h11", "h12", "h23", "h24"]
34
+
35
+ /** The 3 values of the `ms` (measurement system) key of a Unicode locale extension, deprecated ones dropped. */
36
+ export const MEASUREMENT_SYSTEMS: readonly string[] = ["metric", "uksystem", "ussystem"]
37
+
38
+ /** The 3 values of the `mu` (temperature unit) key of a Unicode locale extension, deprecated ones dropped. */
39
+ export const MEASUREMENT_UNITS: readonly string[] = ["celsius", "fahrenhe", "kelvin"]
40
+
41
+ /** The 100 values of the `nu` (numbering system) key of a Unicode locale extension, deprecated ones dropped. */
42
+ export const NUMBERING_SYSTEMS: readonly string[] = [
43
+ "adlm",
44
+ "ahom",
45
+ "arab",
46
+ "arabext",
47
+ "armn",
48
+ "armnlow",
49
+ "bali",
50
+ "beng",
51
+ "bhks",
52
+ "brah",
53
+ "cakm",
54
+ "cham",
55
+ "cyrl",
56
+ "deva",
57
+ "diak",
58
+ "ethi",
59
+ "finance",
60
+ "fullwide",
61
+ "gara",
62
+ "geor",
63
+ "gong",
64
+ "gonm",
65
+ "grek",
66
+ "greklow",
67
+ "gujr",
68
+ "gukh",
69
+ "guru",
70
+ "hanidays",
71
+ "hanidec",
72
+ "hans",
73
+ "hansfin",
74
+ "hant",
75
+ "hantfin",
76
+ "hebr",
77
+ "hmng",
78
+ "hmnp",
79
+ "java",
80
+ "jpan",
81
+ "jpanfin",
82
+ "jpanyear",
83
+ "kali",
84
+ "kawi",
85
+ "khmr",
86
+ "knda",
87
+ "krai",
88
+ "lana",
89
+ "lanatham",
90
+ "laoo",
91
+ "latn",
92
+ "lepc",
93
+ "limb",
94
+ "mathbold",
95
+ "mathdbl",
96
+ "mathmono",
97
+ "mathsanb",
98
+ "mathsans",
99
+ "mlym",
100
+ "modi",
101
+ "mong",
102
+ "mroo",
103
+ "mtei",
104
+ "mymr",
105
+ "mymrepka",
106
+ "mymrpao",
107
+ "mymrshan",
108
+ "mymrtlng",
109
+ "nagm",
110
+ "native",
111
+ "newa",
112
+ "nkoo",
113
+ "olck",
114
+ "onao",
115
+ "orya",
116
+ "osma",
117
+ "outlined",
118
+ "rohg",
119
+ "roman",
120
+ "romanlow",
121
+ "saur",
122
+ "segment",
123
+ "shrd",
124
+ "sind",
125
+ "sinh",
126
+ "sora",
127
+ "sund",
128
+ "sunu",
129
+ "takr",
130
+ "talu",
131
+ "taml",
132
+ "tamldec",
133
+ "telu",
134
+ "thai",
135
+ "tibt",
136
+ "tirh",
137
+ "tnsa",
138
+ "tols",
139
+ "traditio",
140
+ "vaii",
141
+ "wara",
142
+ "wcho",
143
+ ]
package/src/index.ts CHANGED
@@ -1,4 +1,9 @@
1
1
  export { isCidr } from "./cidr.ts"
2
+ export type { IntegerFormat, TextFormat } from "./formats/catalog.ts"
3
+ export { isIanaTimeZone } from "./formats/iana-time-zone.ts"
4
+ export { isIso3166Alpha2, isIso3166Alpha3 } from "./formats/iso3166-1.ts"
5
+ export { isIso4217 } from "./formats/iso4217.ts"
6
+ export { isIso639Alpha2 } from "./formats/iso639-1.ts"
2
7
  export { jsonValue } from "./json-value.ts"
3
8
  export { CombError } from "./error.ts"
4
9
  export {
@@ -45,19 +45,32 @@ function combColumnMeta(column: unknown): CombColumnMeta | undefined {
45
45
  return config?.[COMB_COLUMN] as CombColumnMeta | undefined
46
46
  }
47
47
 
48
- /** A c.enum's options as its column's record: the flags its constraints, the rest its state machine, none when it names no state */
48
+ /** `record` without the keys set to undefined, as a key set to undefined is one left out */
49
+ function defined(record: Readonly<Record<string, unknown>>): Record<string, unknown> {
50
+ return Object.fromEntries(Object.entries(record).filter(([, value]) => value !== undefined))
51
+ }
52
+
53
+ /**
54
+ * A c.enum's options as its column's record: its constraints (the flags, its `format`, and a `schema`
55
+ * a JavaScript caller passes, kept for codegen to refuse by name), the rest its state machine, none
56
+ * when it names no state
57
+ */
49
58
  function enumMeta(
50
59
  values: readonly string[],
51
- options: { nomutate?: boolean | undefined; private?: boolean | undefined; tenant?: boolean | undefined } = {},
60
+ options: {
61
+ format?: string | undefined
62
+ nomutate?: boolean | undefined
63
+ private?: boolean | undefined
64
+ schema?: unknown
65
+ tenant?: boolean | undefined
66
+ } = {},
52
67
  ): { [K in keyof CombColumnMeta]: CombColumnMeta[K] | undefined } {
53
- const { nomutate, private: hidden, tenant, ...given } = options
54
- const flags = { nomutate, private: hidden, tenant }
55
- const flagged = Object.values(flags).some((flag) => flag !== undefined)
56
- /* a state set to undefined is one left out */
57
- const states = Object.fromEntries(Object.entries(given).filter(([, value]) => value !== undefined))
58
- const whole = !flagged && Object.keys(states).length === Object.keys(options).length
68
+ const { format, nomutate, private: hidden, schema, tenant, ...rest } = options
69
+ const constraints = defined({ format, nomutate, private: hidden, schema, tenant })
70
+ const states = defined(rest)
71
+ const whole = Object.keys(constraints).length === 0 && Object.keys(states).length === Object.keys(options).length
59
72
  return {
60
- constraints: flagged ? flags : undefined,
73
+ constraints: Object.keys(constraints).length === 0 ? undefined : constraints,
61
74
  kind: "enum",
62
75
  /* a machine given alone is kept as the very object passed, as assertTransition takes it too */
63
76
  states: Object.keys(states).length === 0 ? undefined : whole ? options : states,
package/src/pg/columns.ts CHANGED
@@ -31,6 +31,8 @@ import type {
31
31
  EnumOptions,
32
32
  IntegerConstraints,
33
33
  JsonConstraints,
34
+ RealConstraints,
35
+ RefConstraints,
34
36
  TextConstraints,
35
37
  TimestampConstraints,
36
38
  } from "../sqlite/constraints.ts"
@@ -100,9 +102,9 @@ export type PgColumns = {
100
102
  _constraints?: JsonConstraints,
101
103
  ) => Set$Type<PgJsonbBuilder, z.infer<TSchema>>
102
104
  /** a floating-point number, stored as double precision */
103
- real: (name: string, _constraints?: IntegerConstraints) => PgDoublePrecisionBuilder
105
+ real: (name: string, _constraints?: RealConstraints) => PgDoublePrecisionBuilder
104
106
  /** a text foreign key; chain `.references()` to name the column it points at */
105
- ref: (name: string, _constraints?: TextConstraints) => Text
107
+ ref: (name: string, _constraints?: RefConstraints) => Text
106
108
  /** the auto-incrementing 4-byte `serial` primary key `id`, filled by the database */
107
109
  serialId: () => SetIsPrimaryKey<PgSerialBuilder>
108
110
  /**
@@ -158,11 +160,11 @@ export const c: PgColumns = {
158
160
  withCombColumn(jsonb(name).$type<z.infer<TSchema>>(), { constraints, kind: "json", schema }),
159
161
 
160
162
  /* Floating point (double precision) */
161
- real: (name: string, constraints?: IntegerConstraints) =>
163
+ real: (name: string, constraints?: RealConstraints) =>
162
164
  withCombColumn(doublePrecision(name), { constraints, kind: "real" }),
163
165
 
164
166
  /* Foreign key reference - use with .references() */
165
- ref: (name: string, constraints?: TextConstraints) => withCombColumn(text(name), { constraints, kind: "ref" }),
167
+ ref: (name: string, constraints?: RefConstraints) => withCombColumn(text(name), { constraints, kind: "ref" }),
166
168
 
167
169
  /* Auto-increment integer primary key */
168
170
  serialId: () => withCombColumn(serial("id").primaryKey(), { kind: "serialId" }),
@@ -21,6 +21,8 @@ import type {
21
21
  EnumOptions,
22
22
  IntegerConstraints,
23
23
  JsonConstraints,
24
+ RealConstraints,
25
+ RefConstraints,
24
26
  TextConstraints,
25
27
  TimestampConstraints,
26
28
  } from "./constraints.ts"
@@ -67,9 +69,9 @@ export type SqliteColumns = {
67
69
  _constraints?: JsonConstraints,
68
70
  ) => $Type<SQLiteTextJsonBuilder, z.infer<TSchema>>
69
71
  /** a floating-point REAL */
70
- real: (name: string, _constraints?: IntegerConstraints) => SQLiteRealBuilder
72
+ real: (name: string, _constraints?: RealConstraints) => SQLiteRealBuilder
71
73
  /** a TEXT foreign key; chain `.references()` to name the column it points at */
72
- ref: (name: string, _constraints?: TextConstraints) => Text
74
+ ref: (name: string, _constraints?: RefConstraints) => Text
73
75
  /** the auto-incrementing INTEGER primary key `id`, filled by the database */
74
76
  serialId: () => IsPrimaryKey<HasDefault<NotNull<SQLiteIntegerBuilder>>>
75
77
  /** a TEXT column; a declared `max` also becomes its declared length */
@@ -122,10 +124,10 @@ export const c: SqliteColumns = {
122
124
  withCombColumn(text(name, { mode: "json" }).$type<z.infer<TSchema>>(), { constraints, kind: "json", schema }),
123
125
 
124
126
  /* Floating point */
125
- real: (name: string, constraints?: IntegerConstraints) => withCombColumn(real(name), { constraints, kind: "real" }),
127
+ real: (name: string, constraints?: RealConstraints) => withCombColumn(real(name), { constraints, kind: "real" }),
126
128
 
127
129
  /* Foreign key reference - use with .references() */
128
- ref: (name: string, constraints?: TextConstraints) => withCombColumn(text(name), { constraints, kind: "ref" }),
130
+ ref: (name: string, constraints?: RefConstraints) => withCombColumn(text(name), { constraints, kind: "ref" }),
129
131
 
130
132
  /* Auto-increment integer primary key */
131
133
  serialId: () =>
@@ -2,8 +2,10 @@
2
2
  * Type-safe column constraint definitions
3
3
  * These exist only in the type system and are completely erased at runtime
4
4
  */
5
+ import type * as z from "zod"
6
+ import type { IntegerFormat, TextFormat } from "../formats/catalog.ts"
5
7
 
6
- /* Base constraints shared across column types */
8
+ /** What every helper's constraints take: the DTO, mutation, privacy, relation and tenant flags */
7
9
  type BaseConstraints = {
8
10
  /** Field is filled by comb or the database: generated create and update DTOs leave it out */
9
11
  autogenerate?: boolean | undefined
@@ -86,13 +88,86 @@ type StringValidationConstraints = {
86
88
  export type TextConstraints = BaseConstraints &
87
89
  StringTransformConstraints &
88
90
  NumericRangeConstraints &
89
- StringValidationConstraints
91
+ StringValidationConstraints & {
92
+ /**
93
+ * The standard a written text holds: the generated DTOs run the format's trim and case, then hold the
94
+ * value to its pattern and, where it names one, its pinned registry, and publish the id as `x-comb-format`.
95
+ * A value it refuses is one zod `invalid_format` issue carrying the id, worded by zod's locale. One of:
96
+ * - `base64url`: RFC 4648 §5 base64url, unpadded; `dGVzdA`; pattern only
97
+ * - `bcp47`: BCP 47 language tag, RFC 5646 §2.1 well-formed; `zh-Hant-TW`; pattern only
98
+ * - `e164`: ITU-T E.164 phone number, + and up to 15 digits; `+385911234567`; pattern only
99
+ * - `iana-time-zone`: IANA time zone name, tzdata 2026f; `Europe/Zagreb`; registry
100
+ * - `ip`: IPv4 dotted quad or IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
101
+ * - `ipv4`: IPv4 address, dotted quad without leading zeros; `192.0.2.1`; pattern only
102
+ * - `ipv6`: IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
103
+ * - `iso3166-1-alpha-2`: ISO 3166-1 alpha-2 country code, Debian iso-codes v4.20.1; `HR`; registry
104
+ * - `iso3166-1-alpha-3`: ISO 3166-1 alpha-3 country code, Debian iso-codes v4.20.1; `HRV`; registry
105
+ * - `iso4217`: ISO 4217 alphabetic currency code, SIX list 2026-09-17; `EUR`; registry
106
+ * - `iso639-1`: ISO 639-1 language code, Debian iso-codes v4.20.1; `hr`; registry
107
+ * - `kebab-slug`: kebab-case slug, lowercase letters and digits joined by single hyphens; `spring-sale-2026`; pattern only
108
+ * - `pkce-s256-challenge`: RFC 7636 §4.2 PKCE SHA-256 code challenge; `E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM`; pattern only
109
+ * - `rfc1123-hostname`: RFC 1123 §2.1 host name; `api.example.com`; pattern only
110
+ * - `semver`: Semantic Versioning 2.0.0 version; `1.4.0-rc.1`; pattern only
111
+ * - `sha256-hex`: SHA-256 digest, FIPS 180-4, lowercase hex; `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`; pattern only
112
+ * - `sha512-hex`: SHA-512 digest, FIPS 180-4, lowercase hex; `cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e`; pattern only
113
+ * - `srgb-hex`: sRGB color as #rrggbb, CSS Color 4; `#1e90ff`; pattern only
114
+ * - `srgb-hex-alpha`: sRGB color with alpha as #rrggbbaa, CSS Color 4; `#1e90ff80`; pattern only
115
+ * - `ulid`: ULID, Crockford base32 in lowercase; `01hzy3k8q2m4n5p6r7s8t9v0wx`; pattern only
116
+ * - `uts35-ca`: UTS #35 calendar (ca) key value, CLDR 49; `gregory`; pattern only
117
+ * - `uts35-fw`: UTS #35 first day of the week (fw) key value, CLDR 49; `mon`; pattern only
118
+ * - `uts35-hc`: UTS #35 hour cycle (hc) key value, CLDR 49; `h23`; pattern only
119
+ * - `uts35-ms`: UTS #35 measurement system (ms) key value, CLDR 49; `metric`; pattern only
120
+ * - `uts35-mu`: UTS #35 measurement unit (mu) key value, CLDR 49; `celsius`; pattern only
121
+ * - `uts35-nu`: UTS #35 numbering system (nu) key value, CLDR 49; `latn`; pattern only
122
+ * - `uuid`: RFC 9562 UUID, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
123
+ * - `uuid-v4`: RFC 9562 UUID version 4, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
124
+ * - `uuid-v7`: RFC 9562 UUID version 7, lowercase hex; `01890a5d-ac96-774b-bcce-b302099a8057`; pattern only
125
+ */
126
+ format?: TextFormat | undefined
127
+ /**
128
+ * An exported zod schema the generated DTOs pipe the value into after every other rule, on the
129
+ * transformed value; its issues reach the caller as zod yields them, and its input JSON Schema is
130
+ * published beside `x-comb-schema`. Codegen imports it as it imports a `c.json` schema, so export it
131
+ * from a module of its own, or above the table that names it
132
+ */
133
+ schema?: z.ZodType<string, string> | undefined
134
+ }
90
135
 
91
136
  /**
92
- * Integer/numeric column constraints
137
+ * Floating-point column constraints: its bounds, and an exported zod schema its value is piped into
93
138
  * Closed record - only these properties allowed
94
139
  */
95
- export type IntegerConstraints = BaseConstraints & NumericRangeConstraints
140
+ export type RealConstraints = BaseConstraints &
141
+ NumericRangeConstraints & {
142
+ /**
143
+ * An exported zod schema the generated DTOs pipe the value into after its bounds; its issues reach
144
+ * the caller as zod yields them, and its input JSON Schema is published beside `x-comb-schema`.
145
+ * Codegen imports it as it imports a `c.json` schema, so export it from a module of its own, or
146
+ * above the table that names it
147
+ */
148
+ schema?: z.ZodType<number, number> | undefined
149
+ }
150
+
151
+ /**
152
+ * Integer column constraints: a real's, and the standard `format` that numbers its values
153
+ * Closed record - only these properties allowed
154
+ */
155
+ export type IntegerConstraints = RealConstraints & {
156
+ /**
157
+ * The standard that numbers the value: its range bounds the generated DTOs, the tighter of it and a
158
+ * declared `min` or `max` winning, and they publish the id as `x-comb-format`. One of:
159
+ * - `iso8601-month`: ISO 8601 month number, 1 January to 12 December; `3`
160
+ * - `iso8601-weekday`: ISO 8601 §3.2.2 weekday number, 1 Monday to 7 Sunday; `1`
161
+ */
162
+ format?: IntegerFormat | undefined
163
+ }
164
+
165
+ /**
166
+ * Foreign key column constraints: a text's but `format` and `schema`, as the value is another
167
+ * table's key, held to that key's own rules
168
+ * Closed record - only these properties allowed
169
+ */
170
+ export type RefConstraints = Omit<TextConstraints, "format" | "schema">
96
171
 
97
172
  /**
98
173
  * JSON column constraints
@@ -126,6 +201,45 @@ export type EnumStates<TState extends string = string> = {
126
201
  transitions?: { readonly [K in TState]?: readonly TState[] | undefined } | undefined
127
202
  }
128
203
 
129
- /** What `c.enum` takes beside its values: its state machine, and the `nomutate`, `private` and `tenant` flags every helper takes */
204
+ /**
205
+ * What `c.enum` takes beside its values: its state machine, the `nomutate`, `private` and `tenant`
206
+ * flags every helper takes, and the standard `format` its values are written in, which codegen holds
207
+ * each value to and publishes as `x-comb-format`
208
+ */
130
209
  export type EnumOptions<TState extends string = string> = EnumStates<TState> &
131
- Pick<BaseConstraints, "nomutate" | "private" | "tenant">
210
+ Pick<BaseConstraints, "nomutate" | "private" | "tenant"> & {
211
+ /**
212
+ * The standard the values are written in: codegen refuses a value the format does not take as written,
213
+ * and the DTOs publish the id as `x-comb-format`; the values stay the rule. One of:
214
+ * - `base64url`: RFC 4648 §5 base64url, unpadded; `dGVzdA`; pattern only
215
+ * - `bcp47`: BCP 47 language tag, RFC 5646 §2.1 well-formed; `zh-Hant-TW`; pattern only
216
+ * - `e164`: ITU-T E.164 phone number, + and up to 15 digits; `+385911234567`; pattern only
217
+ * - `iana-time-zone`: IANA time zone name, tzdata 2026f; `Europe/Zagreb`; registry
218
+ * - `ip`: IPv4 dotted quad or IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
219
+ * - `ipv4`: IPv4 address, dotted quad without leading zeros; `192.0.2.1`; pattern only
220
+ * - `ipv6`: IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
221
+ * - `iso3166-1-alpha-2`: ISO 3166-1 alpha-2 country code, Debian iso-codes v4.20.1; `HR`; registry
222
+ * - `iso3166-1-alpha-3`: ISO 3166-1 alpha-3 country code, Debian iso-codes v4.20.1; `HRV`; registry
223
+ * - `iso4217`: ISO 4217 alphabetic currency code, SIX list 2026-09-17; `EUR`; registry
224
+ * - `iso639-1`: ISO 639-1 language code, Debian iso-codes v4.20.1; `hr`; registry
225
+ * - `kebab-slug`: kebab-case slug, lowercase letters and digits joined by single hyphens; `spring-sale-2026`; pattern only
226
+ * - `pkce-s256-challenge`: RFC 7636 §4.2 PKCE SHA-256 code challenge; `E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM`; pattern only
227
+ * - `rfc1123-hostname`: RFC 1123 §2.1 host name; `api.example.com`; pattern only
228
+ * - `semver`: Semantic Versioning 2.0.0 version; `1.4.0-rc.1`; pattern only
229
+ * - `sha256-hex`: SHA-256 digest, FIPS 180-4, lowercase hex; `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`; pattern only
230
+ * - `sha512-hex`: SHA-512 digest, FIPS 180-4, lowercase hex; `cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e`; pattern only
231
+ * - `srgb-hex`: sRGB color as #rrggbb, CSS Color 4; `#1e90ff`; pattern only
232
+ * - `srgb-hex-alpha`: sRGB color with alpha as #rrggbbaa, CSS Color 4; `#1e90ff80`; pattern only
233
+ * - `ulid`: ULID, Crockford base32 in lowercase; `01hzy3k8q2m4n5p6r7s8t9v0wx`; pattern only
234
+ * - `uts35-ca`: UTS #35 calendar (ca) key value, CLDR 49; `gregory`; pattern only
235
+ * - `uts35-fw`: UTS #35 first day of the week (fw) key value, CLDR 49; `mon`; pattern only
236
+ * - `uts35-hc`: UTS #35 hour cycle (hc) key value, CLDR 49; `h23`; pattern only
237
+ * - `uts35-ms`: UTS #35 measurement system (ms) key value, CLDR 49; `metric`; pattern only
238
+ * - `uts35-mu`: UTS #35 measurement unit (mu) key value, CLDR 49; `celsius`; pattern only
239
+ * - `uts35-nu`: UTS #35 numbering system (nu) key value, CLDR 49; `latn`; pattern only
240
+ * - `uuid`: RFC 9562 UUID, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
241
+ * - `uuid-v4`: RFC 9562 UUID version 4, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
242
+ * - `uuid-v7`: RFC 9562 UUID version 7, lowercase hex; `01890a5d-ac96-774b-bcce-b302099a8057`; pattern only
243
+ */
244
+ format?: TextFormat | undefined
245
+ }
@@ -1,3 +1,4 @@
1
+ import type { IntegerFormat, TextFormat } from "../formats/catalog.ts";
1
2
  import type { CombColumnKind } from "../meta/column.ts";
2
3
  /**
3
4
  * TableMeta — serializable intermediate format produced by TableAnalyzer.
@@ -9,6 +10,8 @@ type FieldConstraintsMeta = {
9
10
  autogenerate: boolean;
10
11
  /** the generated DTOs take only an email address */
11
12
  email: boolean;
13
+ /** the standard the value is held to: a text's or an enum's text format, an integer's integer format; null when none is declared */
14
+ format: TextFormat | IntegerFormat | null;
12
15
  /** an https URL or a data:image/ URI */
13
16
  imageUri: boolean;
14
17
  /** the generated DTOs lowercase the text before they check it */
@@ -120,8 +123,10 @@ type FieldMeta = {
120
123
  isPrimaryKey: boolean;
121
124
  /** the name the generated DTO imports a c.json column's schema under, null for any other column */
122
125
  jsonSchemaName: string | null;
123
- /** the names the field's generated schema uses and must import (a c.json schema) */
126
+ /** the names the field's generated schema uses and must import: a c.json schema, or the zod schema a text or number column's `schema` key names */
124
127
  schemaImports: ImportRef[];
128
+ /** the input JSON Schema of the zod schema a text or number column's `schema` key names, self-contained and without `$schema`, which the generated DTOs publish beside it; null for any other column. The schema's import is the field's one `schemaImports` entry */
129
+ schemaJson: Readonly<Record<string, unknown>> | null;
125
130
  /** a Postgres array's declared dimensions; 0 or absent for a column of one value */
126
131
  dimensions?: number | undefined;
127
132
  /** whether a Postgres array's elements may be null, as its drizzle type declares; false or absent otherwise */
@@ -1 +1 @@
1
- {"version":3,"file":"analyzer-types.d.ts","sourceRoot":"","sources":["../../src/codegen/analyzer-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD;;;GAGG;AAEH,8DAA8D;AAC9D,KAAK,oBAAoB,GAAG;IAC3B,uQAAuQ;IACvQ,YAAY,EAAE,OAAO,CAAA;IACrB,oDAAoD;IACpD,KAAK,EAAE,OAAO,CAAA;IACd,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAA;IACjB,iEAAiE;IACjE,SAAS,EAAE,OAAO,CAAA;IAClB,uKAAuK;IACvK,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,mFAAmF;IACnF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,4FAA4F;IAC5F,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,8DAA8D;IAC9D,IAAI,EAAE,OAAO,CAAA;IACb,wIAAwI;IACxI,OAAO,EAAE,OAAO,CAAA;IAChB,gFAAgF;IAChF,QAAQ,EAAE,OAAO,CAAA;IACjB,wLAAwL;IACxL,QAAQ,EAAE,OAAO,CAAA;IACjB,oHAAoH;IACpH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,0KAA0K;IAC1K,OAAO,EAAE,OAAO,CAAA;IAChB,4JAA4J;IAC5J,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACpC,qIAAqI;IAC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;IAC/C,gBAAgB,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,sBAAsB,EACtB,eAAe,GACf,CAAA"}
1
+ {"version":3,"file":"analyzer-types.d.ts","sourceRoot":"","sources":["../../src/codegen/analyzer-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD;;;GAGG;AAEH,8DAA8D;AAC9D,KAAK,oBAAoB,GAAG;IAC3B,uQAAuQ;IACvQ,YAAY,EAAE,OAAO,CAAA;IACrB,oDAAoD;IACpD,KAAK,EAAE,OAAO,CAAA;IACd,oIAAoI;IACpI,MAAM,EAAE,UAAU,GAAG,aAAa,GAAG,IAAI,CAAA;IACzC,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAA;IACjB,iEAAiE;IACjE,SAAS,EAAE,OAAO,CAAA;IAClB,uKAAuK;IACvK,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,mFAAmF;IACnF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,4FAA4F;IAC5F,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,8DAA8D;IAC9D,IAAI,EAAE,OAAO,CAAA;IACb,wIAAwI;IACxI,OAAO,EAAE,OAAO,CAAA;IAChB,gFAAgF;IAChF,QAAQ,EAAE,OAAO,CAAA;IACjB,wLAAwL;IACxL,QAAQ,EAAE,OAAO,CAAA;IACjB,oHAAoH;IACpH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,0KAA0K;IAC1K,OAAO,EAAE,OAAO,CAAA;IAChB,4JAA4J;IAC5J,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