Releases: modfin/squildx
Releases · modfin/squildx
v0.1.2
v0.1.1
Added Insert, Update and Delete handling
Should be Non-breaking changes just additive for basic CRUD applications.
v0.1.0
Breaking Changes
- Named parameter maps: All clause methods (
Where,OrderBy,Having,InnerJoin,LeftJoin, etc.) now accept...Params(namedmap[string]any) instead of positional...anyvalues. This gives callers explicit control over parameter names and eliminates the implicit positional-to-name mapping. Build()return type: ReturnsParams(a namedmap[string]anytype) instead of a rawmap[string]any.- Removed
ErrParamMismatch: Replaced byErrMissingParam(placeholder with no map key) andErrExtraParam(map key with no placeholder), providing more precise error reporting.
New Features
@parameter prefix support: Named placeholders can now use either:paramor@paramsyntax (but not both in the same query). Mixed prefixes produceErrMixedPrefix.- 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
Paramsmaps that are merged, e.g.Where("a = :x AND b = :y", Params{"x": 1}, Params{"y": 2}). Paramsnamed type: NewParamstype (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. toSnakeCasedigit boundaries: Field names containing digits followed by uppercase letters (e.g.Field1Name,V2API,S3Bucket) now correctly producefield1_name,v2_api,s3_bucketinstead offield1name,v2api,s3bucket.- Embedded struct tag handling:
collectColumnsnow respects tags on embedded (anonymous) struct fields. An embedded struct tagged withdb:"-"is skipped, and one tagged withdb:"name"is treated as a single column rather than being recursed into.
Internal
- Defensive copying of caller-provided
Paramsmaps to prevent external mutation - Bidirectional validation between SQL placeholders and map keys
detectPrefix/reconcilePrefixfunctions for robust prefix tracking duringBuild()fieldTagNamehelper extracted for reuse in struct column collection
v0.0.3
What's Changed
- Same variable use in param clauses by @AlexPalex97 in #5
- Lateral join by @AlexPalex97 in #6
- Distinct by @AlexPalex97 in #7
- Double join by @AlexPalex97 in #8
Full Changelog: v0.0.2...v0.0.3
v0.0.2
What's Changed
- Order by param by @AlexPalex97 in #3
- Where subquery by @AlexPalex97 in #4
Full Changelog: v0.0.1...v0.0.2
v0.0.1
First basic functionality