Column rules via the CLI
- Required/optional:
dbx schema field <aggregate> <field> --requiredor--not-required. - Formats:
--format email|url|credit_card|country_code|iso_8601|wgs_84|camel_case|snake_case|kebab_case|pascal_case|upper_case_snake_case. - Contains / does_not_contain:
--contains foo/--does-not-contain bar. - Regex:
--regex '^[A-Z]{2}-\\d+$'(repeatable). - Length:
--length-min <n> --length-max <n>for text/binary. - Range:
--range-min <value> --range-max <value>for numeric/date/time. - Object properties:
--properties '{"address":{"type":"text","required":true}}'to nest rules under anobjectfield.
Testing rules
Use fixtures before promoting to strict mode:Handling failures
- In
restrict=default, events without schemas are allowed; declared schemas validate and return clear errors when violated. - In
restrict=strict, every aggregate must have a schema and any rule violation rejects the write.