-
Notifications
You must be signed in to change notification settings - Fork 139
Releases: huandu/go-sqlbuilder
v1.41.0
[NEW]Add an optionNoExpandto change default field "expand" behavior for backward compatibility. See #237 for details.
NOTE: Starting from v1.40.0, the Struct utility type defaults to expanding non-primitive struct fields. This change caused unexpected behavior for some users. To address this without reverting the features introduced in v1.40.0, we have introduced a NoExpand configuration. When set to true, all fields will default to no expansion (preserving legacy behavior). You can still opt-in to expansion for specific fields by using the fieldopt:"expand" tag.
Full Changelog: v1.40.0...v1.41.0
Assets 2
v1.40.0
What's new
Struct field / db tag improvements
Support treating a db tag on a struct-typed field as a database alias and expanding its exported fields as aliased columns. This makes it possible to build JOIN projections like post.id, post.title, etc., from a nested struct field and keeps Addr/Scan behavior working by allocating nested pointers when scanning.
Note: This change preserves existing semantics for scalar-like structs (types implementing sql.Scanner/driver.Valuer/time.Time, etc) — they are not expanded.
See issue #233 for more details.
Oracle SELECT behavior
Use OFFSET ... FETCH pattern for Oracle SELECT pagination.
Potential Oracle compatibility note: the change to use OFFSET ... FETCH for Oracle pagination may affect environments using older Oracle versions that do not support this syntax. Please verify compatibility with your Oracle version before upgrading.
Thanks and acknowledgements
Thanks to @zhangyongding for the Oracle pagination improvements.
Full Changelog: v1.39.0...v1.40.0
Assets 2
v1.39.0
03c69da What's Changed
[NEW]Add From support for UpdateBuilder by @stvnkiss in #230[FIX]Fix oracle limit bug by @zhangyongding in #222[FIX]Improve error-msg context for unsupported types during interpolation by @shoriwe in #226[FIX]MarkOrderByas "not recommended" rather than deprecated by in #223[FIX]Fix sqlite string interpolation incorrectly uses backslash escapes by @shoriwe in #228[FIX]Update doc onWhereto avoid confusion in #229
New Contributors
- @zhangyongding made their first contribution in #222
- @shoriwe made their first contribution in #226
- @stvnkiss made their first contribution in #230
Full Changelog: v1.38.0...v1.39.0
Assets 2
v1.38.0
What's Changed
- [NEW] Implement returning method on SQL Server by @Bugadinho in #220
- [FIX] Add document to demonstrate how to write nested
JOIN. #217 - [NEW] Add
OrderByAscandOrderByDesctoSelectBuilder/UpdateBuilder/DeleteBuilder/UnionBuilderfor better readability. The old methodsOrderBy/Asc/Descare marked as deprecated. #214
New Contributors
- @Bugadinho made their first contribution in #220
Full Changelog: v1.37.0...v1.38.0
Assets 2
v1.37.0
044cf35 What's Changed
- [NEW] Support clone (deep copy) in all builders (#218)
- [BUG] Fix union limit syntax error with some flavor (#216) Thanks, @zhangyongding
- [BUG] Support typed nil in interpolation (#213)
Full Changelog: v1.36.0...v1.37.0
Assets 2
v1.36.0
51f40ba What's Changed
- Add a fuzz harness for Select by @edznux-dd in #207
- [bugfix] Nil pointer deref by @edznux-dd in #204
- feat: implement Returning method for
UpdateBuilderandDeleteBuilderin #212
New Contributors
- @edznux-dd made their first contribution in #207
Full Changelog: v1.35.0...v1.36.0
Assets 2
v1.35.0
What's Changed
- NEW: New flavor
Doris, which is a dialect ofMySQL. See discussion in #192 for details. - FIX: the order of LIMIT and OFFSET clauses when using the Presto flavor #195 in #196
- Thanks for your contribution, @barweiss.
New Contributors
Full Changelog: v1.34.0...v1.35.0
Assets 2
v1.34.0
87b9c12 What's Changed
- #189: Use
argsinLIMITand/orOFFSETexpression to optimize query plan caching.- Thanks @stavros-k for raising this issue in #186.
- #190: Ignore empty values and expressions to prevent syntax error.
- Thanks @ErikBooijMB for raising this issue in #188.
- #191: Support
RETURNINGinInsertBuilder.- See discussion in #83 for details.
Full Changelog: v1.33.0...v1.34.0
Assets 2
v1.33.0: Support `LATERAL` keyword
c4b67f5 What's Changed
- Support
LATERALkeyword #181 #183 (Thanks @therve for your ideas)- Add a new method
LateralAsinSelectBuilderto build LATERAL JOIN expression. Read sample code forLateralAson GoDoc for details.
- Add a new method
Full Changelog: v1.32.0...v1.33.0
Assets 2
v1.32.0: Enhancements and Bug Fixes in SQL Statement Handling and Error Identification
5067ee7 What's Changed
- NEW:
Flavorgetters by @rodionovv in #177- There is a new method
Flavor()inBuilderto get current flavor set in a builder.
- There is a new method
- NEW: Automatically reference names of
CTETables inDELETEandUPDATEstatements. #179- Based on the discussion in issue #176, the capability previously used with
CTETableto automatically include the CTE table name in theFROMclause ofSELECTstatements has now been extended toUPDATEandDELETEstatements.
- Based on the discussion in issue #176, the capability previously used with
- FIX: Avoid stack overflow when
Condis misused. #180- Based on the discussion in issue #178, users may call this method to create
Condfor building various conditions, which is a misuse, but we cannot completely prevent this error. - To facilitate problem identification for users, in the event of misuse of
NewCond(), the generated SQL will include the pattern/* INVALID ARG $n */, wherenis the sequence number of the problematic variable, allowing users to quickly pinpoint the issue.
- Based on the discussion in issue #178, users may call this method to create
Full Changelog: v1.31.0...v1.32.0