Releases: scylladb/gocqlx
v2.0.3
v2.0.2
Update tests to use v2 Signed-off-by: Michał Matczuk <[email protected]>
v2.0
Lightweight Transactions (aka CAS)
Requires Scylla 4.0 or Scylla 3.3 with --experimental flag enabled.
The "Get" function variant is added: GetCAS
, GetCASRelease
, these functions returns the "applied" indicator. Similarly there are ExecCAS
, ExecCASRelease
functions if you are not interested in preimage. See a lock example in example_test.go.
User Defined Types Automation
You can now add UDT trait to a type by adding a single line of code:
type Coordinates struct {
gocqlx.UDT
X int
Y int
}
You can also add UDT trait to an alien type by embedding a pointer to it:
type CoordinatesUDT struct {
gocqlx.UDT
*coordinates
}
See the full runnable examples in example_test.go.
New Session API
Instead of (old format):
gocqlx.Query(session.Query(`SELECT * FROM struct_table`), nil).Get(&v)
we can now use session "Query" function to return Queryx instance:
session.Query(`SELECT * FROM struct_table`, nil).Get(&v)
It requires wrapping the session on creation:
// Create gocql cluster.
cluster := gocql.NewCluster(hosts...)
// Wrap session on creation, gocqlx session embeds gocql.Session pointer.
session, err := gocqlx.WrapSession(cluster.CreateSession())
if err != nil {
t.Fatal(err)
}
User Defined Types are Scanable
Types implementing UDT marshalling functions are now "scanable", which means you can use them in "Get" and "Select" function families, for queries that return a single column. StructOnly modifier was added to Iterx. When enabled you can use the UDT enabled types as normal structs.
API incompatibilities
Iter(q *gocql.Query) *Iterx
constructor is removed, one should use Queryx::Iter instead
API- Migrate package uses now gocqlx.Session in place of *gocql.Session
Deprecated APIs
Query(q *gocql.Query, names []string) *Queryx
constructor is deprecated, one should use the new Session- qb Batch is deprecated
v1.5.0
This release:
- Extends
table
module with Builders for Update and Delete, and exports PK comparator by @GingerMoon
v1.4.0
This release:
- Adds AwaitSchemaAgreement functionality to migrate by @annismckenzie
- Adds DefaultUnsafe option by @annismckenzie
- Fixes a data race in table by @ajankovic
v1.3.3
v1.3.2
New in this release:
- General maintenance
- Iterx inherit mapper from Query
- qb: Reuse slices to avoid allocations by @meox
- qb: Added not equal comparators (!=) by @pierDipi
- qb: Added support for BYPASS CACHE @martin-sucha
- qb: Added token value comparer to TokenBuilder @zwopir
v1.3.1
This is a maintenance release to fix a bug when iterating over paged result sets.
The server is allowed to return empty pages even when there are more rows
available. We used assume this was not the case and in certain circumstances
iteration was terminated prematurely. We are now handling this case by letting
the gocql driver handle it.
PR: #105
v1.3.0
v1.2.2
This release upgrades go-reflectx to take advantage of recent performance enhancements.