Releases: scylladb/gocqlx
v3.0.4
What's Changed
- Upgrade gocql to 1.15.3 by @dkropachev in #343
- Fix: #340 Add comment handling and related tests for migration functionality by @itsfuad in #344
Full Changelog: v3.0.3...v3.0.4
v3.0.3
What's Changed
- Add missing batch API by @dkropachev in #325
- Add ContextBatch api to create batch with context by @dkropachev in #326
- Bring back index model generation by @daskol in #328
- Update documentation to reflect switch to scylladb/gocql by @sylwiaszunejko in #333
- Update module github.com/scylladb/gocql to v1.15.2 by @renovate[bot] in #335
Full Changelog: v3.0.2...v3.0.3
v3.0.2
What's Changed
- expose SelectBuilder for table Get operation by @YeminLi in #251
- adding lesson link to readme file by @guy9 in #181
- Add --query-timeout and --connection-timeout options by @dkropachev in #293
- Update README.md schemagen installation and usage by @dkropachev in #292
- Add schemagen ssl options by @dkropachev in #294
- Fix USING TIMEOUT time generation by @dkropachev in #299
- Enhance cluster configuration with reconnection policy and improve code by @itsfuad in #301
- Adjust permissions of output file and directory by @daskol in #303
- fix(deps): update github.com/psanford/memfs digest to 4ef9117 by @renovate in #304
- chore(deps): update actions/setup-go action to v5 by @renovate in #309
- chore(deps): update actions/checkout action to v4 by @renovate in #308
- chore(deps): update actions/cache action to v4 by @renovate in #307
- fix(deps): update all dependencies to v1 (major) by @renovate in #310
- Use scylladb/scylla image by @dkropachev in #312
- Makefile: rename run-scylla to start-scylla by @dkropachev in #311
- Refactor Makefile tools installation by @dkropachev in #313
- Update golang to 1.20 by @dkropachev in #316
- Update gocql to 1.14.5 by @dkropachev in #315
- Update dependencies by @dkropachev in #317
- Bring back materialized view generation by @daskol in #321
- Update gocql to v1.15.1 by @dkropachev in #323
New Contributors
- @itsfuad made their first contribution in #301
- @daskol made their first contribution in #303
- @renovate made their first contribution in #304
Full Changelog: v3.0.1...v3.0.2
Release v3.0.1
What's Changed
- Update migration error messages by @jackphilippi in #285
- Add option to add ALLOW FILTERING to the update query by @sylwiaszunejko in #290
- feat(migrate): add
Pendingfunction for pending migrations by @JustSamuel in #286 - Bump scylladb/gocql version to v1.14.4 by @sylwiaszunejko in #291
New Contributors
- @jackphilippi made their first contribution in #285
- @JustSamuel made their first contribution in #286
Full Changelog: v3.0...v3.0.1
Release v3.0
This major release introduces significant changes. We have switched from gocql/gocql to scylladb/gocql and replaced the Unsafe mechanism with the Strict mechanism to ensure compatibility with the default behavior of gocql. These two changes are breaking changes, which is why this release is classified as a major update. Additionally, several smaller fixes and features have been added.
What's Changed
- Adding batch wrapper on query builder by @mariosttass in #239
- Improve cmd/schemagen by @iwittkau in #262
- Bump scylla version and add a linter to the CI by @sylwiaszunejko in #271
- Update golangci-lint in Makefile and CI and turn it on in CI by @dkropachev in #273
- Switch to scylladb/gocql by @dkropachev in #274
- Add additional methods to Batch similar to what exists on Queryx by @dkropachev in #275
- Marshal missing UDT fields as null instead of failing by @sylwiaszunejko in #269
- Replace Unsafe with Strict mechanism by @sylwiaszunejko in #276
- Switch to use scylla image instead of scylla version, to be able to target enterprise by @dkropachev in #277
- Release v3 - change v2 suffix to v3 by @sylwiaszunejko in #279
New Contributors
- @mariosttass made their first contribution in #239
- @izenhaim made their first contribution in #263
- @iwittkau made their first contribution in #262
- @sylwiaszunejko made their first contribution in #271
- @dkropachev made their first contribution in #273
Full Changelog: v2.8.0...v3.0
Release 2.8.0
The release adds support for schemagen to generate structs in table model, as well as username/password authentication to schemagen.
What's Changed
- Force metadata retrieval for CAS queries by @Drahflow in #221
- Fix typo in test by @Bobochka in #223
- fix using timeout order in select stmt by @YeminLi in #229
- update documentation with examples of non-persisted fields by @slycrel in #226
- queryx: add note to ExecCAS docs by @kevinbarbour in #231
- Update GH actions by @mrwormhole in #233
- add user password authentication to schemagen by @niklassemmler in #236
- Structs tables by @pavle995 in #212
New Contributors
- @YeminLi made their first contribution in #229
- @slycrel made their first contribution in #226
- @kevinbarbour made their first contribution in #231
- @mrwormhole made their first contribution in #233
- @niklassemmler made their first contribution in #236
- @pavle995 made their first contribution in #212
Full Changelog: v2.7.0...v2.8.0
Release 2.7.0
What's Changed
- migrate: add CallbackRegister::Find by @mmatczuk in #210
- dbutil: RewriteTable add possibility to skip rows by @mmatczuk in #211
- Added test database name flag by @spolischook in #209
- Make qb.DESC of type qb.Order, not bool by @Drahflow in #218
- avoid DATA RACE if reusing query builder by @tehsphinx in #220
- Add TupleNamed for two-sided range-queries on tuples by @Drahflow in #219
New Contributors
- @spolischook made their first contribution in #209
- @Drahflow made their first contribution in #218
- @tehsphinx made their first contribution in #220
Full Changelog: v2.6.0...v2.7.0
Release 2.6.0
This release adds automatic support for gocql.UnsetValue.
This is a special value representing not set i.e. not resulting in any change to the existing value.
This is great for PATCHING entities, you can have a single prepared statement that can be reused to update any combination of the fields.
Example:
The following example upserts Operation not changing the Fee field.
// Insert operation with empty fee.
insertQuery = insertOperation.Query(session).
WithBindTransformer(gocqlx.UnsetEmptyTransformer).
BindStruct(Operation{
ID: "2",
ClientID: "42",
Type: "Input",
PaymentID: "1",
Fee: nil,
})
if err := insertQuery.ExecRelease(); err != nil {
t.Fatal("ExecRelease() failed:", err)
}Also, the bind transformer can be set globally for the whole application.
// Set default transformer to avoid setting it for each query.
gocqlx.DefaultBindTransformer = gocqlx.UnsetEmptyTransformerWhat's Changed
- qb: add named limit and per partition limit clauses by @N1cOs in #208
- queryx: unset empty values by @N1cOs in #206
New Contributors
Full Changelog: v2.5.0...v2.6.0
Release 2.5.0
Schemagen 🥇
This release adds schemagen tool that generates goclqx table models based on database schema.
Example:
Running the following command for examples keyspace:
$GOBIN/schemagen -cluster="127.0.0.1:9042" -keyspace="examples" -output="models" -pkgname="models"Generates models/models.go as follows:
// Code generated by "gocqlx/cmd/schemagen"; DO NOT EDIT.
package models
import "github.com/scylladb/gocqlx/v2/table"
// Table models.
var (
Playlists = table.New(table.Metadata{
Name: "playlists",
Columns: []string{
"album",
"artist",
"id",
"song_id",
"title",
},
PartKey: []string{
"id",
},
SortKey: []string{
"title",
"album",
"artist",
},
})
Songs = table.New(table.Metadata{
Name: "songs",
Columns: []string{
"album",
"artist",
"data",
"id",
"tags",
"title",
},
PartKey: []string{
"id",
},
SortKey: []string{},
})
)Installation
go get -u "github.com/scylladb/gocqlx/v2/cmd/schemagen"What's Changed
- GetCAS: check if the query has a build error before trying to execute it by @ok32 in #187
- Correctly state in the GetQuery comment that it gets by primary key by @alfa-alex in #190
- Update godoc badge link by @quenbyako in #193
- qb: add support for USING TIMEOUT clause by @mmatczuk in #195
- schemagen cli by @Bobochka in #201
- schemagen refactoring by @mmatczuk in #203
New Contributors
- @ok32 made their first contribution in #187
- @alfa-alex made their first contribution in #190
- @quenbyako made their first contribution in #193
- @Bobochka made their first contribution in #201
Full Changelog: v2.4.0...v2.5.0
Release 2.4.0
This release adds support for embedding migration files inside binary with go:embed.
It requires go 1.16+.
Example:
Embed all cql files in your migration directory.
//go:embed *.cql
var Files embed.FSPass the FS to migration function.
if err := migrate.FromFS(context.Background(), session, cql.Files); err != nil {
// handle error
}The migrate.Migrate function is now deprecated.