Releases: ShiftLeftSecurity/gaum
Add SetSQLRow to conflict handlers
Add the possibility to prepend ROW
to the update statement on conflict to please pg >11
Add chain as insert parameter and fix join order
JOIN
order is now respected, the join statements you add will be rendered in the order they were added to the chain, allowing for reference between them using aliases.
Insert
and insertMulti
now understand that, if one of the insertion values is a chain.ExpressionChain
the intention is for that to be rendered as a SQL query inside the VALUES
. Bear in mind, no checks happen on the validity of the SQL statement for that use.
Add FOR UPDATE
Add partial locking to select
Support slice of pointer
Added support for passing []*struct
to the fetching methods.
Bugfix for CTEs
Fixes a bug when constructing queries that contain more than 2 WITH (cte) statements
Support FROM as JOIN for UPDATE
According to official doc (https://www.postgresql.org/docs/9.1/sql-update.html) for the UPDATE statement, the way to perform a JOIN is to use FROM and WHERE
Upgrade PGX version
Just a maintenance move to reduce friction with users.
Support Modules
We now support go modules, net minor upgrade will remove vendored folder.
1.0 New API
- Removed a lot of copied code, this is now worth reading by anyone without inducing a headache)
- Split some of the chain surface into files with some per functionality organization.
- Added a few missing tests, now there is a better coverage that could still use some refactoring to be more concise.
- Updated a lot of docs, the gian and quite comprehensive Readme now has more examples that should make getting to know gaum easier.
- Fixed the long standing typo on Expresion -> Expression (this is what produced the version change)
- Gave more decent names to constructor and added a no db required constructor.
- Completed formatter functionality, we now have a simple way to make some templating in the query, mostly to allow easy table prefixes without having to wrap every field in a function or for cases where that is not possible.
v0.1.17
This is quite a featureful release:
- CTEs are now ordered: CTEs retain the order in which they were added, to make for nicer interdependence and ease testing.
HAVING
: We gained support for the Having keywordUNION
: We gained support for making union of multipleExpresionChain
and produce a SQLUNION
statement with it.- Added support for
RETURNING
toUPDATE
(previously it was only possible inINSERT
) - Gained
String()
method inExpresionChain
for easier debugging of queries and error formatting. - Added
noopScanner
to the automatic mapping of query results to struct fields so we do not fail when a column without match is returned (we do log said event though so you do not miss it) - Added a special
nullScanner
tostring
andtime.Time
type receivers so when scanning aNULL
column into a non pointer field of these two types you get Zero value instead of error (the built in sql scanner expects recipients of nullable columns to be pointers to represent the nullity but some times we just don't care) - Finally fixed a few bugs like
EExec
not properly unpacking arguments.
Special thanks to @alexhornbake and @Ferada for their great participation in this release.