* Update gocql version to v1.16.1
1. Update gocql to v1.16.1
2. Update golang to 1.25, since new gocql version requres it
* Update golangci to 2.5.0
It is needed since 1.64.8 does not support golang 1.25.
1. Update golangci to 2.5.0
2. Migrate from golangci config v1 to v2
3. Integrate fieldaligment to golangci
4. Drop fieldaligment from Makefile
5. Address complaints
Previously by default the presence of a missing field in
a udt would result in an error reported. The Unsafe
mechanism could be used to ignore these fields.
This PR changes the default behavior to ignoring missing
fields and only reporting an error if Strict mode is used.
This approach is in line with the gocql.
Added ExecCAS, ExecCASRelease, GetCAS, GetCASRelease functions
suitable for INSERT ... IF NOT EXISTS and UPDATE's containing IF statement.
Functions returns information wheter query was applied or not, together
with pre-image.
Fixes#98
Upstream merge
Add Session wrapper
With this patch we can now use gocqlx like:
```
session.Query(`SELECT * FROM struct_table`, nil).Get(&v)
```
instead of (old format):
```
gocqlx.Query(session.Query(`SELECT * FROM struct_table`), nil).Get(&v)
```
Signed-off-by: Michał Matczuk <michal@scylladb.com>
This patch adds the power of GocqlX to UDTs.
Now you can make a struct be UDT compatible by adding a single line.
```
type FullName struct {
gocqlx.UDT
FirstName string
LastName string
}
```
Signed-off-by: Michał Matczuk <michal@scylladb.com>
We have a structure type that implements UnmarshalCQL method.
We use it to unmarshal a user defined type. We also want to use the same struct for scanning an entire row.
There is StructScan method available in gocqlx for this purpose when iterating over rows, but no equivalent when doing a Select.
This commit introduces the possibility when doing select/get as well.
Co-authored-by: Michał Matczuk <michal@scylladb.com>
We used to rely upon NumRows to determine if there are
new pages available. This is not correct since the server
is allowed to return empty pages with has_more_data flag
set and the needed data to do this is not exposed by
the gocql driver.
We simply remove these checks and let the driver decide
when to stop reading.
Co-authored-by: Henrik Johansson <henrik@scylladb.com>
Co-authored-by: Piotr Sarna <sarna@scylladb.com>
Depending on sqlx makes users pull SQL related code that is usually not
needed. Tools like dep make it easier by explicitly listing relevant
subpackages but the code needs to be downloaded anyway.
Releasing query objects in Get/Select could easily lead to
double-releases, which can cause dangerous and tricky data races.
Remove the query field of Iterx and its usages (all release-related).
This is a breaking API change, because it removes the exported method
ReleaseQuery.
Update documenting examples to demonstrate the deferred query release
pattern clients can use to manage query release.