From e7267922c4da8588a6f587aed9f3e821ed4694fb Mon Sep 17 00:00:00 2001 From: sylwiaszunejko Date: Wed, 10 Jul 2024 07:49:07 +0200 Subject: [PATCH] Release v3 - change v2 suffix to v3 Because of recent changes there is a need for a new major release. Changes are switching to scylladb/gocql and replacing Unsafe with Strict mechanism. --- README.md | 8 ++++---- batchx_test.go | 6 +++--- benchmark_test.go | 6 +++--- cmd/schemagen/keyspace.tmpl | 2 +- cmd/schemagen/schemagen.go | 6 +++--- cmd/schemagen/schemagen_test.go | 2 +- cmd/schemagen/testdata/go.mod | 9 ++++++--- cmd/schemagen/testdata/go.sum | 10 ++++------ cmd/schemagen/testdata/models.go | 4 ++-- cmd/schemagen/testdata/models_test.go | 7 ++++--- dbutil/rewrite.go | 4 ++-- dbutil/rewrite_test.go | 8 ++++---- doc_test.go | 4 ++-- example_test.go | 8 ++++---- go.mod | 2 +- gocqlxtest/gocqlxtest.go | 2 +- iterx_test.go | 6 +++--- migrate/callback.go | 2 +- migrate/example/example_test.go | 8 ++++---- migrate/migrate.go | 4 ++-- migrate/migrate_test.go | 6 +++--- qb/batch.go | 2 +- qb/delete.go | 2 +- qb/insert.go | 2 +- qb/select.go | 2 +- qb/update.go | 2 +- queryx_bench_test.go | 2 +- table/table.go | 4 ++-- table/table_test.go | 2 +- 29 files changed, 67 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index 58bc789..5a5e4ef 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# πŸš€ GocqlX [![GoDoc](https://pkg.go.dev/badge/github.com/scylladb/gocqlx/v2.svg)](https://pkg.go.dev/github.com/scylladb/gocqlx/v2) [![Go Report Card](https://goreportcard.com/badge/github.com/scylladb/gocqlx)](https://goreportcard.com/report/github.com/scylladb/gocqlx) [![Build Status](https://travis-ci.org/scylladb/gocqlx.svg?branch=master)](https://travis-ci.org/scylladb/gocqlx) +# πŸš€ GocqlX [![GoDoc](https://pkg.go.dev/badge/github.com/scylladb/gocqlx/v3.svg)](https://pkg.go.dev/github.com/scylladb/gocqlx/v3) [![Go Report Card](https://goreportcard.com/badge/github.com/scylladb/gocqlx)](https://goreportcard.com/report/github.com/scylladb/gocqlx) [![Build Status](https://travis-ci.org/scylladb/gocqlx.svg?branch=master)](https://travis-ci.org/scylladb/gocqlx) GocqlX makes working with Scylla easy and less error-prone. It’s inspired by [Sqlx](https://github.com/jmoiron/sqlx), a tool for working with SQL databases, but it goes beyond what Sqlx provides. @@ -20,7 +20,7 @@ Subpackages provide additional functionality: ## Installation ```bash - go get -u github.com/scylladb/gocqlx/v2 + go get -u github.com/scylladb/gocqlx/v3 ``` ## Getting started @@ -112,7 +112,7 @@ t.Log(people) Installation ```bash -go get -u "github.com/scylladb/gocqlx/v2/cmd/schemagen" +go get -u "github.com/scylladb/gocqlx/v3/cmd/schemagen" ``` Usage: @@ -143,7 +143,7 @@ Generates `models/models.go` as follows: package models -import "github.com/scylladb/gocqlx/v2/table" +import "github.com/scylladb/gocqlx/v3/table" // Table models. var ( diff --git a/batchx_test.go b/batchx_test.go index d2b87b9..f1e3b00 100644 --- a/batchx_test.go +++ b/batchx_test.go @@ -13,9 +13,9 @@ import ( "github.com/gocql/gocql" "github.com/google/go-cmp/cmp" - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/gocqlxtest" - "github.com/scylladb/gocqlx/v2/qb" + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/gocqlxtest" + "github.com/scylladb/gocqlx/v3/qb" ) func TestBatch(t *testing.T) { diff --git a/benchmark_test.go b/benchmark_test.go index 53d3ab7..6777a81 100644 --- a/benchmark_test.go +++ b/benchmark_test.go @@ -12,9 +12,9 @@ import ( "os" "testing" - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/gocqlxtest" - "github.com/scylladb/gocqlx/v2/qb" + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/gocqlxtest" + "github.com/scylladb/gocqlx/v3/qb" ) type benchPerson struct { diff --git a/cmd/schemagen/keyspace.tmpl b/cmd/schemagen/keyspace.tmpl index 24fe40f..807950c 100644 --- a/cmd/schemagen/keyspace.tmpl +++ b/cmd/schemagen/keyspace.tmpl @@ -3,7 +3,7 @@ package {{.PackageName}} import ( - "github.com/scylladb/gocqlx/v2/table" + "github.com/scylladb/gocqlx/v3/table" {{- range .Imports}} "{{.}}" {{- end}} diff --git a/cmd/schemagen/schemagen.go b/cmd/schemagen/schemagen.go index fa2dd4b..3eb9e57 100644 --- a/cmd/schemagen/schemagen.go +++ b/cmd/schemagen/schemagen.go @@ -17,8 +17,8 @@ import ( "github.com/gocql/gocql" - "github.com/scylladb/gocqlx/v2" - _ "github.com/scylladb/gocqlx/v2/table" + "github.com/scylladb/gocqlx/v3" + _ "github.com/scylladb/gocqlx/v3/table" ) var ( @@ -110,7 +110,7 @@ func renderTemplate(md *gocql.KeyspaceMetadata) ([]byte, error) { imports := make([]string, 0) if len(md.Types) != 0 { - imports = append(imports, "github.com/scylladb/gocqlx/v2") + imports = append(imports, "github.com/scylladb/gocqlx/v3") } for _, t := range md.Tables { diff --git a/cmd/schemagen/schemagen_test.go b/cmd/schemagen/schemagen_test.go index 62fbd42..1ddb0ca 100644 --- a/cmd/schemagen/schemagen_test.go +++ b/cmd/schemagen/schemagen_test.go @@ -11,7 +11,7 @@ import ( "github.com/gocql/gocql" "github.com/google/go-cmp/cmp" - "github.com/scylladb/gocqlx/v2/gocqlxtest" + "github.com/scylladb/gocqlx/v3/gocqlxtest" ) var flagUpdate = flag.Bool("update", false, "update golden file") diff --git a/cmd/schemagen/testdata/go.mod b/cmd/schemagen/testdata/go.mod index 180b7af..ae36933 100644 --- a/cmd/schemagen/testdata/go.mod +++ b/cmd/schemagen/testdata/go.mod @@ -4,8 +4,8 @@ go 1.17 require ( github.com/gocql/gocql v0.0.0-20211015133455-b225f9b53fa1 - github.com/google/go-cmp v0.5.4 - github.com/scylladb/gocqlx/v2 v2.8.0 + github.com/google/go-cmp v0.6.0 + github.com/scylladb/gocqlx/v3 v3.0.0 ) require ( @@ -15,4 +15,7 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect ) -replace github.com/gocql/gocql => github.com/scylladb/gocql v1.14.0 +replace ( + github.com/gocql/gocql => github.com/scylladb/gocql v1.14.0 + github.com/scylladb/gocqlx/v3 => ../../.. +) diff --git a/cmd/schemagen/testdata/go.sum b/cmd/schemagen/testdata/go.sum index a0e246e..bd4d6e8 100644 --- a/cmd/schemagen/testdata/go.sum +++ b/cmd/schemagen/testdata/go.sum @@ -8,8 +8,9 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -23,20 +24,17 @@ github.com/scylladb/go-reflectx v1.0.1 h1:b917wZM7189pZdlND9PbIJ6NQxfDPfBvUaQ7cj github.com/scylladb/go-reflectx v1.0.1/go.mod h1:rWnOfDIRWBGN0miMLIcoPt/Dhi2doCMZqwMCJ3KupFc= github.com/scylladb/gocql v1.14.0 h1:MuQ2sEOHxqTmCWS8zoH34SD5bpm3NbXi7CQbIVxSsZY= github.com/scylladb/gocql v1.14.0/go.mod h1:ZLEJ0EVE5JhmtxIW2stgHq/v1P4fWap0qyyXSKyV8K0= -github.com/scylladb/gocqlx/v2 v2.8.0 h1:f/oIgoEPjKDKd+RIoeHqexsIQVIbalVmT+axwvUqQUg= -github.com/scylladb/gocqlx/v2 v2.8.0/go.mod h1:4/+cga34PVqjhgSoo5Nr2fX1MQIqZB5eCE5DK4xeDig= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= golang.org/x/net v0.0.0-20220526153639-5463443f8c37 h1:lUkvobShwKsOesNfWWlCS5q7fnbG1MEliIzwu886fn8= golang.org/x/net v0.0.0-20220526153639-5463443f8c37/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= diff --git a/cmd/schemagen/testdata/models.go b/cmd/schemagen/testdata/models.go index 02a81c9..5e4fc3e 100644 --- a/cmd/schemagen/testdata/models.go +++ b/cmd/schemagen/testdata/models.go @@ -4,8 +4,8 @@ package schemagentest import ( "github.com/gocql/gocql" - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/table" + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/table" ) // Table models. diff --git a/cmd/schemagen/testdata/models_test.go b/cmd/schemagen/testdata/models_test.go index aadd225..af52a2e 100644 --- a/cmd/schemagen/testdata/models_test.go +++ b/cmd/schemagen/testdata/models_test.go @@ -2,14 +2,15 @@ package schemagentest import ( "flag" - "github.com/google/go-cmp/cmp" "strings" "testing" "time" "github.com/gocql/gocql" - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/qb" + "github.com/google/go-cmp/cmp" + + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/qb" ) var flagCluster = flag.String("cluster", "127.0.0.1", "a comma-separated list of host:port or host tuples") diff --git a/dbutil/rewrite.go b/dbutil/rewrite.go index b6b839f..ee30c28 100644 --- a/dbutil/rewrite.go +++ b/dbutil/rewrite.go @@ -5,8 +5,8 @@ package dbutil import ( - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/table" + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/table" ) // RewriteTable rewrites src table to dst table. diff --git a/dbutil/rewrite_test.go b/dbutil/rewrite_test.go index a72ff29..2044387 100644 --- a/dbutil/rewrite_test.go +++ b/dbutil/rewrite_test.go @@ -11,10 +11,10 @@ import ( "testing" "time" - "github.com/scylladb/gocqlx/v2/dbutil" - "github.com/scylladb/gocqlx/v2/gocqlxtest" - "github.com/scylladb/gocqlx/v2/qb" - "github.com/scylladb/gocqlx/v2/table" + "github.com/scylladb/gocqlx/v3/dbutil" + "github.com/scylladb/gocqlx/v3/gocqlxtest" + "github.com/scylladb/gocqlx/v3/qb" + "github.com/scylladb/gocqlx/v3/table" ) func TestRewriteTableTTL(t *testing.T) { diff --git a/doc_test.go b/doc_test.go index 7318aba..11c20e1 100644 --- a/doc_test.go +++ b/doc_test.go @@ -7,8 +7,8 @@ package gocqlx_test import ( "github.com/gocql/gocql" - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/qb" + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/qb" ) func ExampleSession() { diff --git a/example_test.go b/example_test.go index 22cd792..557a2f2 100644 --- a/example_test.go +++ b/example_test.go @@ -17,10 +17,10 @@ import ( "golang.org/x/sync/errgroup" "gopkg.in/inf.v0" - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/gocqlxtest" - "github.com/scylladb/gocqlx/v2/qb" - "github.com/scylladb/gocqlx/v2/table" + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/gocqlxtest" + "github.com/scylladb/gocqlx/v3/qb" + "github.com/scylladb/gocqlx/v3/table" ) // Running examples locally: diff --git a/go.mod b/go.mod index dc6194a..95d7424 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/scylladb/gocqlx/v2 +module github.com/scylladb/gocqlx/v3 go 1.17 diff --git a/gocqlxtest/gocqlxtest.go b/gocqlxtest/gocqlxtest.go index 11f3512..26cb669 100644 --- a/gocqlxtest/gocqlxtest.go +++ b/gocqlxtest/gocqlxtest.go @@ -14,7 +14,7 @@ import ( "github.com/gocql/gocql" - "github.com/scylladb/gocqlx/v2" + "github.com/scylladb/gocqlx/v3" ) var ( diff --git a/iterx_test.go b/iterx_test.go index 3d217bb..f6fc339 100644 --- a/iterx_test.go +++ b/iterx_test.go @@ -19,9 +19,9 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "gopkg.in/inf.v0" - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/gocqlxtest" - "github.com/scylladb/gocqlx/v2/qb" + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/gocqlxtest" + "github.com/scylladb/gocqlx/v3/qb" ) type FullName struct { diff --git a/migrate/callback.go b/migrate/callback.go index b94dc21..be4a66b 100644 --- a/migrate/callback.go +++ b/migrate/callback.go @@ -8,7 +8,7 @@ import ( "context" "errors" - "github.com/scylladb/gocqlx/v2" + "github.com/scylladb/gocqlx/v3" ) // CallbackEvent specifies type of the event when calling CallbackFunc. diff --git a/migrate/example/example_test.go b/migrate/example/example_test.go index c2595c9..51c3f4a 100644 --- a/migrate/example/example_test.go +++ b/migrate/example/example_test.go @@ -11,10 +11,10 @@ import ( "context" "testing" - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/gocqlxtest" - "github.com/scylladb/gocqlx/v2/migrate" - "github.com/scylladb/gocqlx/v2/migrate/example/cql" + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/gocqlxtest" + "github.com/scylladb/gocqlx/v3/migrate" + "github.com/scylladb/gocqlx/v3/migrate/example/cql" ) // Running examples locally: diff --git a/migrate/migrate.go b/migrate/migrate.go index bd2da27..382a2dd 100644 --- a/migrate/migrate.go +++ b/migrate/migrate.go @@ -20,8 +20,8 @@ import ( "github.com/gocql/gocql" - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/qb" + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/qb" ) // DefaultAwaitSchemaAgreement controls whether checking for cluster schema agreement diff --git a/migrate/migrate_test.go b/migrate/migrate_test.go index 041ec37..01ba037 100644 --- a/migrate/migrate_test.go +++ b/migrate/migrate_test.go @@ -16,9 +16,9 @@ import ( "github.com/psanford/memfs" - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/gocqlxtest" - "github.com/scylladb/gocqlx/v2/migrate" + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/gocqlxtest" + "github.com/scylladb/gocqlx/v3/migrate" ) var migrateSchema = ` diff --git a/qb/batch.go b/qb/batch.go index 3556634..cbd4138 100644 --- a/qb/batch.go +++ b/qb/batch.go @@ -10,7 +10,7 @@ import ( "fmt" "time" - "github.com/scylladb/gocqlx/v2" + "github.com/scylladb/gocqlx/v3" ) // BATCH reference: diff --git a/qb/delete.go b/qb/delete.go index a1ff3b9..008ec33 100644 --- a/qb/delete.go +++ b/qb/delete.go @@ -12,7 +12,7 @@ import ( "context" "time" - "github.com/scylladb/gocqlx/v2" + "github.com/scylladb/gocqlx/v3" ) // DeleteBuilder builds CQL DELETE statements. diff --git a/qb/insert.go b/qb/insert.go index 25923f1..07fae59 100644 --- a/qb/insert.go +++ b/qb/insert.go @@ -12,7 +12,7 @@ import ( "context" "time" - "github.com/scylladb/gocqlx/v2" + "github.com/scylladb/gocqlx/v3" ) // initializer specifies an value for a column in an insert operation. diff --git a/qb/select.go b/qb/select.go index 7964164..e1b2141 100644 --- a/qb/select.go +++ b/qb/select.go @@ -12,7 +12,7 @@ import ( "context" "time" - "github.com/scylladb/gocqlx/v2" + "github.com/scylladb/gocqlx/v3" ) // Order specifies sorting order. diff --git a/qb/update.go b/qb/update.go index 1826199..d3a404d 100644 --- a/qb/update.go +++ b/qb/update.go @@ -12,7 +12,7 @@ import ( "context" "time" - "github.com/scylladb/gocqlx/v2" + "github.com/scylladb/gocqlx/v3" ) // assignment specifies an assignment in a set operation. diff --git a/queryx_bench_test.go b/queryx_bench_test.go index 85502af..722bdce 100644 --- a/queryx_bench_test.go +++ b/queryx_bench_test.go @@ -7,7 +7,7 @@ package gocqlx_test import ( "testing" - "github.com/scylladb/gocqlx/v2" + "github.com/scylladb/gocqlx/v3" ) func BenchmarkCompileNamedQuery(b *testing.B) { diff --git a/table/table.go b/table/table.go index 6f1d663..e006ca8 100644 --- a/table/table.go +++ b/table/table.go @@ -7,8 +7,8 @@ package table import ( "context" - "github.com/scylladb/gocqlx/v2" - "github.com/scylladb/gocqlx/v2/qb" + "github.com/scylladb/gocqlx/v3" + "github.com/scylladb/gocqlx/v3/qb" ) // Metadata represents table schema. diff --git a/table/table_test.go b/table/table_test.go index c69a86f..da8464e 100644 --- a/table/table_test.go +++ b/table/table_test.go @@ -10,7 +10,7 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/scylladb/gocqlx/v2/qb" + "github.com/scylladb/gocqlx/v3/qb" ) func TestTableGet(t *testing.T) {