Changelog¶
Version history of the db-gen tool. The authoritative copy lives at ../db-gen/CHANGELOG.md.
0.8.0¶
New features¶
- Template variables — new
TemplateVariablesconfig key holds a free-form string→string map passed to every template, read with the newtemplateVarfunction. Lets one shared template set serve multiple projects that differ only in config (e.g. namespaces). See Templating → template variables. - Parameter security levels — each parameter carries a logging-sensitivity level (
none/secure/strict/omit), exposed to templates asProperty.SecurityLevel. New configDefaultParameterSecurityLevel(defaultsecure) andParameterSecurityMappings[], plus a per-functionSecurityLeveloverride. db-gen resolves the level; templates render the masking. See Templating → parameter security levels. validatecommand —db-gen validatechecks configuration and templates without generating files: settings validation, template parsing, and (when a database or routines file is available) rendering against real routines.--offlinerestricts it to settings + parsing. Exits non-zero on error, for CI. See CLI Commands.--llmreference —db-gen --llm(ordb-gen llm) prints one self-contained plain-text reference of the whole tool, aimed at LLM/AI coding assistants.
Improvements¶
- Running
db-genwith no arguments now prints version/build information before the help output. - Root help and the
--llmreference now read "db-gen by Keenmate s.r.o." with a short description of the tool.
0.7.2¶
Bug fixes¶
- Use a constant format string in
log.Printfsogo test/go vetpass under the Go 1.25 toolchain. Test-compilation only; v0.7.1 release binaries were unaffected.
0.7.1¶
Security¶
- Upgraded dependencies to clear all reachable
govulncheckfindings:pgx/v5v5.5.1 → v5.10.0 (fixes SQL injection and pipeline panic advisories) andgolang.org/x/textv0.14.0 → v0.40.0. Bumped the Go toolchain to 1.25, clearing 16 standard-library advisories in released binaries.
0.7.0¶
New features¶
- Copy targets — generate language-agnostic bulk-
COPY-into-table code from a table's columns. db-gen emits column metadata and a per-language template produces theCOPY ... FROM STDINcode. See Copy Targets. - Copy-target change detection — staging-table schema changes (added/removed columns, type and nullability changes) are reported by
generateanddatabase-changes, closing the gap where staging-column drift was silent. - Test framework — three-layer suite (pure unit, DB-backed integration, golden-file e2e).
Documentation¶
- README slimmed into a landing page; reference docs split into a dedicated
docs/set. Added aFEATURES.mdfeature-inventory matrix.
0.6.1¶
Bug fixes¶
- Field-name generation preserves underscores before numbers —
country_iso_2no longer collapses tocountry_iso2. NewnormalizeStrtemplate function uses normalized db column names directly. - Unnamed parameters (
$1,$2) no longer crash routine loading —parameter_nameis coalesced to an empty string.
0.6.0¶
New features¶
- Context Parameter Mapping — inject context params from a UserContext object.
- Additional Generators framework — single-file or per-routine custom outputs.
- Three-tier type mapping —
NullableReturnType,NullableParameterType,OptionalParameterType. - RemoveOrphanedFiles — delete generated files when their database function disappears.
- CleanOutputFolder — clean an additional generator's output folder before generating.
Bug fixes¶
- Per-function type overrides now use global nullable/optional mappings.
- Nullable parameters use
T?(always passed) instead ofOptional<T>. - Fixed double-wrapping of nullable parameters.
- jsonb handling kept inside the DbContext layer.
- Change detection tracks files from all output folders.
0.5.2¶
- Separated
OptionalfromNullable. Optional applies only to parameters with a DEFAULT; both can be overridden separately.
0.5.0¶
Breaking changes¶
Functionsconfig changed from an array to an object keyed by function name.- Removed
IgnoredFunctions— set a function tofalseinFunctionsinstead. - Overloaded functions must declare a unique mapped name.
New features¶
- Per-function mapping overrides (name, value retrieval, per-parameter/column type and nullability, custom mapping function).
4.0.0¶
- New
routinescommand exports routines toRoutinesFile. --UseRoutinesFileflag generates from the file instead of the database.
0.3.x¶
- Local config supports
.localpostfix andlocal./.local.prefixes. BuildInfoavailable in all templates.
0.3.0¶
Breaking changes¶
GeneratedFileCasevalues renamed:snake→snakecase,lcase→camelcase,ucase→pascalcase.- Template functions renamed:
snake→snakeCased,lCamel→camelCased,uCamel→pascalCased.
New features¶
ProcessorsFolderNameandModelsFolderNameconfig (defaultsprocessors/models).Configvariable available in Model, Processor, and DbContext templates.