Skip to content

Changelog

Version history of the db-gen tool. The authoritative copy lives at ../db-gen/CHANGELOG.md.

Unreleased

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).

0.6.1

Bug fixes

  • Field-name generation preserves underscores before numberscountry_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 mappingNullableReturnType, 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: snakesnakecase, lcasecamelcase, ucasepascalcase.
  • Template functions renamed: snakesnakeCased, lCamelcamelCased, uCamelpascalCased.

New features

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