norm now targets PostgreSQL (default), SQLite and MySQL — plus the compatible MariaDB, CockroachDB and YugabyteDB — through a Dialect abstraction on Config.
Highlights
Config.Dialectselects bind placeholders ($Nvs?),RETURNING/upsert syntax and default column types. PostgreSQL stays the default.- migrate and gen support SQLite and MySQL: DDL generation,
MODIFY COLUMN, andinformation_schema/PRAGMAintrospection. - Opt-in
Config.QuoteIdentifiersquotes generated table/column names, so reserved words (e.g. a table namedorder) work. - Dialect-aware JSON marshaling of
map/slicefields; on PostgreSQL slices map to native array columns (text[],bigint[]), andgenresolves the precise element type. - Compatible dialects:
MariaDBreuses MySQL,CockroachDB/YugabyteDBreuse PostgreSQL.
Testing & examples
- Live integration tests for SQLite (pure-Go driver) and, behind Docker, MySQL and PostgreSQL.
- New examples:
sqlite,mysql,pg_arrays,compatible_dialects.
Compatibility
Fully backward compatible with v4.3.0: no exported signature changed, and the default PostgreSQL output is byte-for-byte identical. New behavior is opt-in via Config.Dialect / Config.QuoteIdentifiers.
Full changelog: v4.3.0...v4.4.0