Skip to content

goodm v0.2.0

Choose a tag to compare

@dwoolworth dwoolworth released this 13 Feb 02:37
· 26 commits to main since this release
4217a50

What's New

New Features

  • BatchPopulate() -- resolve ref fields across a slice of models in a single $in query, eliminating N+1 overhead
  • String length validation -- min/max tags now enforce string length in addition to numeric bounds
  • Configurable drift sample size -- EnforceOptions.DriftSampleSize and DetectDrift() accept a sample size parameter (default 100)
  • Makefile -- make test (with -race), make build (with ldflags version injection), make lint

Improvements

  • Update optimization -- Update() skips the extra fetch when the schema has no immutable fields (1 query instead of 2)
  • Duplicate registration guard -- Register() returns an error if a model is already registered
  • Version injection -- CLI version is now set at build time via -ldflags, defaults to dev
  • Generated code -- init() uses log.Fatal instead of panic

Quality

  • golangci-lint clean -- fixed all errcheck and staticcheck issues across the codebase
  • Race condition tests -- concurrent registry, middleware, and validation tests pass with -race
  • Validation test suite -- comprehensive unit tests for string length, int bounds, enum, and required fields