Skip to content

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 TemplateVariables config key holds a free-form string→string map passed to every template, read with the new templateVar function. 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 as Property.SecurityLevel. New config DefaultParameterSecurityLevel (default secure) and ParameterSecurityMappings[], plus a per-function SecurityLevel override. db-gen resolves the level; templates render the masking. See Templating → parameter security levels.
  • validate command — db-gen validate checks configuration and templates without generating files: settings validation, template parsing, and (when a database or routines file is available) rendering against real routines. --offline restricts it to settings + parsing. Exits non-zero on error, for CI. See CLI Commands.
  • --llm reference — db-gen --llm (or db-gen llm) prints one self-contained plain-text reference of the whole tool, aimed at LLM/AI coding assistants.

Improvements

  • Running db-gen with no arguments now prints version/build information before the help output.
  • Root help and the --llm reference 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.Printf so go test / go vet pass 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 govulncheck findings: pgx/v5 v5.5.1 → v5.10.0 (fixes SQL injection and pipeline panic advisories) and golang.org/x/text v0.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 the COPY ... FROM STDIN code. See Copy Targets.
  • Copy-target change detection — staging-table schema changes (added/removed columns, type and nullability changes) are reported by generate and database-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 a FEATURES.md feature-inventory matrix.

0.6.1

Bug fixes

  • Field-name generation preserves underscores before numbers — country_iso_2 no longer collapses to country_iso2. New normalizeStr template function uses normalized db column names directly.
  • Unnamed parameters ($1, $2) no longer crash routine loading — parameter_name is 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 of Optional<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 Optional from Nullable. Optional applies only to parameters with a DEFAULT; both can be overridden separately.

0.5.0

Breaking changes

  • Functions config changed from an array to an object keyed by function name.
  • Removed IgnoredFunctions — set a function to false in Functions instead.
  • 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 routines command exports routines to RoutinesFile.
  • --UseRoutinesFile flag generates from the file instead of the database.

0.3.x

  • Local config supports .local postfix and local. / .local. prefixes.
  • BuildInfo available in all templates.

0.3.0

Breaking changes

  • GeneratedFileCase values renamed: snake → snakecase, lcase → camelcase, ucase → pascalcase.
  • Template functions renamed: snake → snakeCased, lCamel → camelCased, uCamel → pascalCased.

New features

  • ProcessorsFolderName and ModelsFolderName config (defaults processors / models).
  • Config variable available in Model, Processor, and DbContext templates.