Releases: pocketbase/dbx
v1.12.0 Release
-
Introduced
QueryBuilder.CombineUnion(sql string, unionClause string) stringto allow specifying how theUNION/UNION ALLstatements should be concatenated to the base query.
To minimize breaking changes the defaultBaseQueryBuilderimplementation is preserved as before - aka. wraps the left and right side of the combined queries in parenthesis (this is not a standard SQL format and it is mostly a MySQL quirk). -
Use custom
SqliteQueryBuilderfor theSqliteBuilderthat removes the default parenthesis wrapping ofUnion()/UnionAll()statements because otherwise it is causing syntax error (see pocketbase#7516).
v1.11.0 Release
- Added 2 new helper functions for prepending/appending raw SQL statements to a
dbx.SelectQuery(e.g.WITHclause):func (s *SelectQuery) PreFragment(fragment string) *SelectQuery func (s *SelectQuery) PostFragment(fragment string) *SelectQuery
v1.10.1 Release
v1.10.0 Release
-
Added
dbx.Queryanddbx.SelectQueryhooks to allow composed app level fail/retry or any other custom query handling.func (q *Query) WithExecHook(fn ExecHookFunc) *Query func (q *Query) WithOneHook(fn OneHookFunc) *Query func (q *Query) WithAllHook(fn AllHookFunc) *Query func (q *SelectQuery) WithBuildHook(fn BuildHookFunc) *SelectQuery
v1.9.0 Release
-
Updated the default logger to print blob/rawbytes params as hex (#2).
-
Added
dbx.Enclose(dbx.Expression)to enclose preemptively a nonempty expression with parenthesis.
v1.8.0 Release
- Added optional
dbx.PostScannerinterface, allowing to attach custom behavior after struct scan (for bothOneandAll).
v1.7.0 Release
- Added
SelectQuery.Info()helper to export the current query fields (eg.from,where,groupBy, etc.) without building the sql expression.