Skip to content

Releases: modfin/squildx

v0.1.2

16 Apr 09:32

Choose a tag to compare

Added MIT LICENSE

v0.1.1

29 Mar 14:45
d59a631

Choose a tag to compare

Added Insert, Update and Delete handling
Should be Non-breaking changes just additive for basic CRUD applications.

v0.1.0

06 Mar 08:53
a844456

Choose a tag to compare

Breaking Changes

  • Named parameter maps: All clause methods (Where, OrderBy, Having, InnerJoin, LeftJoin, etc.) now accept ...Params (named map[string]any) instead of positional ...any values. This gives callers explicit control over parameter names and eliminates the implicit positional-to-name mapping.
  • Build() return type: Returns Params (a named map[string]any type) instead of a raw map[string]any.
  • Removed ErrParamMismatch: Replaced by ErrMissingParam (placeholder with no map key) and ErrExtraParam (map key with no placeholder), providing more precise error reporting.

New Features

  • @ parameter prefix support: Named placeholders can now use either :param or @param syntax (but not both in the same query). Mixed prefixes produce ErrMixedPrefix.
  • PostgreSQL :: and @@ escaping: Double-prefix sequences (value::integer, @@session_var) are correctly skipped and not treated as parameters.
  • Multiple param maps per clause: Methods accept variadic Params maps that are merged, e.g. Where("a = :x AND b = :y", Params{"x": 1}, Params{"y": 2}).
  • Params named type: New Params type (map[string]any) used throughout the public API for clarity and type safety.

Bug Fixes

  • Nested/sibling subquery prefix detection: Build() now correctly detects mixed : and @ prefixes across arbitrarily nested subqueries and sibling subqueries, even when intermediate builders have no direct parameters. Previously, mixed prefixes could silently produce malformed SQL.
  • toSnakeCase digit boundaries: Field names containing digits followed by uppercase letters (e.g. Field1Name, V2API, S3Bucket) now correctly produce field1_name, v2_api, s3_bucket instead of field1name, v2api, s3bucket.
  • Embedded struct tag handling: collectColumns now respects tags on embedded (anonymous) struct fields. An embedded struct tagged with db:"-" is skipped, and one tagged with db:"name" is treated as a single column rather than being recursed into.

Internal

  • Defensive copying of caller-provided Params maps to prevent external mutation
  • Bidirectional validation between SQL placeholders and map keys
  • detectPrefix / reconcilePrefix functions for robust prefix tracking during Build()
  • fieldTagName helper extracted for reuse in struct column collection

v0.0.3

24 Feb 10:48
ab2b985

Choose a tag to compare

What's Changed

Full Changelog: v0.0.2...v0.0.3

v0.0.2

23 Feb 16:32

Choose a tag to compare

What's Changed

Full Changelog: v0.0.1...v0.0.2

v0.0.1

23 Feb 13:53

Choose a tag to compare

First basic functionality