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.
This commit is contained in:
sylwiaszunejko
2024-07-10 07:49:07 +02:00
committed by Sylwia Szunejko
parent 653faf1e03
commit e7267922c4
29 changed files with 67 additions and 65 deletions

View File

@@ -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. GocqlX makes working with Scylla easy and less error-prone.
Its inspired by [Sqlx](https://github.com/jmoiron/sqlx), a tool for working with SQL databases, but it goes beyond what Sqlx provides. Its 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 ## Installation
```bash ```bash
go get -u github.com/scylladb/gocqlx/v2 go get -u github.com/scylladb/gocqlx/v3
``` ```
## Getting started ## Getting started
@@ -112,7 +112,7 @@ t.Log(people)
Installation Installation
```bash ```bash
go get -u "github.com/scylladb/gocqlx/v2/cmd/schemagen" go get -u "github.com/scylladb/gocqlx/v3/cmd/schemagen"
``` ```
Usage: Usage:
@@ -143,7 +143,7 @@ Generates `models/models.go` as follows:
package models package models
import "github.com/scylladb/gocqlx/v2/table" import "github.com/scylladb/gocqlx/v3/table"
// Table models. // Table models.
var ( var (

View File

@@ -13,9 +13,9 @@ import (
"github.com/gocql/gocql" "github.com/gocql/gocql"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
"github.com/scylladb/gocqlx/v2/gocqlxtest" "github.com/scylladb/gocqlx/v3/gocqlxtest"
"github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/gocqlx/v3/qb"
) )
func TestBatch(t *testing.T) { func TestBatch(t *testing.T) {

View File

@@ -12,9 +12,9 @@ import (
"os" "os"
"testing" "testing"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
"github.com/scylladb/gocqlx/v2/gocqlxtest" "github.com/scylladb/gocqlx/v3/gocqlxtest"
"github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/gocqlx/v3/qb"
) )
type benchPerson struct { type benchPerson struct {

View File

@@ -3,7 +3,7 @@
package {{.PackageName}} package {{.PackageName}}
import ( import (
"github.com/scylladb/gocqlx/v2/table" "github.com/scylladb/gocqlx/v3/table"
{{- range .Imports}} {{- range .Imports}}
"{{.}}" "{{.}}"
{{- end}} {{- end}}

View File

@@ -17,8 +17,8 @@ import (
"github.com/gocql/gocql" "github.com/gocql/gocql"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
_ "github.com/scylladb/gocqlx/v2/table" _ "github.com/scylladb/gocqlx/v3/table"
) )
var ( var (
@@ -110,7 +110,7 @@ func renderTemplate(md *gocql.KeyspaceMetadata) ([]byte, error) {
imports := make([]string, 0) imports := make([]string, 0)
if len(md.Types) != 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 { for _, t := range md.Tables {

View File

@@ -11,7 +11,7 @@ import (
"github.com/gocql/gocql" "github.com/gocql/gocql"
"github.com/google/go-cmp/cmp" "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") var flagUpdate = flag.Bool("update", false, "update golden file")

View File

@@ -4,8 +4,8 @@ go 1.17
require ( require (
github.com/gocql/gocql v0.0.0-20211015133455-b225f9b53fa1 github.com/gocql/gocql v0.0.0-20211015133455-b225f9b53fa1
github.com/google/go-cmp v0.5.4 github.com/google/go-cmp v0.6.0
github.com/scylladb/gocqlx/v2 v2.8.0 github.com/scylladb/gocqlx/v3 v3.0.0
) )
require ( require (
@@ -15,4 +15,7 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect 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 => ../../..
)

View File

@@ -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 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 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.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.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 h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= 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= 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/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 h1:MuQ2sEOHxqTmCWS8zoH34SD5bpm3NbXi7CQbIVxSsZY=
github.com/scylladb/gocql v1.14.0/go.mod h1:ZLEJ0EVE5JhmtxIW2stgHq/v1P4fWap0qyyXSKyV8K0= 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/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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 h1:lUkvobShwKsOesNfWWlCS5q7fnbG1MEliIzwu886fn8=
golang.org/x/net v0.0.0-20220526153639-5463443f8c37/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= 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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/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/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/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/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= 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/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=

View File

@@ -4,8 +4,8 @@ package schemagentest
import ( import (
"github.com/gocql/gocql" "github.com/gocql/gocql"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
"github.com/scylladb/gocqlx/v2/table" "github.com/scylladb/gocqlx/v3/table"
) )
// Table models. // Table models.

View File

@@ -2,14 +2,15 @@ package schemagentest
import ( import (
"flag" "flag"
"github.com/google/go-cmp/cmp"
"strings" "strings"
"testing" "testing"
"time" "time"
"github.com/gocql/gocql" "github.com/gocql/gocql"
"github.com/scylladb/gocqlx/v2" "github.com/google/go-cmp/cmp"
"github.com/scylladb/gocqlx/v2/qb"
"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") var flagCluster = flag.String("cluster", "127.0.0.1", "a comma-separated list of host:port or host tuples")

View File

@@ -5,8 +5,8 @@
package dbutil package dbutil
import ( import (
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
"github.com/scylladb/gocqlx/v2/table" "github.com/scylladb/gocqlx/v3/table"
) )
// RewriteTable rewrites src table to dst table. // RewriteTable rewrites src table to dst table.

View File

@@ -11,10 +11,10 @@ import (
"testing" "testing"
"time" "time"
"github.com/scylladb/gocqlx/v2/dbutil" "github.com/scylladb/gocqlx/v3/dbutil"
"github.com/scylladb/gocqlx/v2/gocqlxtest" "github.com/scylladb/gocqlx/v3/gocqlxtest"
"github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/gocqlx/v3/qb"
"github.com/scylladb/gocqlx/v2/table" "github.com/scylladb/gocqlx/v3/table"
) )
func TestRewriteTableTTL(t *testing.T) { func TestRewriteTableTTL(t *testing.T) {

View File

@@ -7,8 +7,8 @@ package gocqlx_test
import ( import (
"github.com/gocql/gocql" "github.com/gocql/gocql"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
"github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/gocqlx/v3/qb"
) )
func ExampleSession() { func ExampleSession() {

View File

@@ -17,10 +17,10 @@ import (
"golang.org/x/sync/errgroup" "golang.org/x/sync/errgroup"
"gopkg.in/inf.v0" "gopkg.in/inf.v0"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
"github.com/scylladb/gocqlx/v2/gocqlxtest" "github.com/scylladb/gocqlx/v3/gocqlxtest"
"github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/gocqlx/v3/qb"
"github.com/scylladb/gocqlx/v2/table" "github.com/scylladb/gocqlx/v3/table"
) )
// Running examples locally: // Running examples locally:

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/scylladb/gocqlx/v2 module github.com/scylladb/gocqlx/v3
go 1.17 go 1.17

View File

@@ -14,7 +14,7 @@ import (
"github.com/gocql/gocql" "github.com/gocql/gocql"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
) )
var ( var (

View File

@@ -19,9 +19,9 @@ import (
"github.com/google/go-cmp/cmp/cmpopts" "github.com/google/go-cmp/cmp/cmpopts"
"gopkg.in/inf.v0" "gopkg.in/inf.v0"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
"github.com/scylladb/gocqlx/v2/gocqlxtest" "github.com/scylladb/gocqlx/v3/gocqlxtest"
"github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/gocqlx/v3/qb"
) )
type FullName struct { type FullName struct {

View File

@@ -8,7 +8,7 @@ import (
"context" "context"
"errors" "errors"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
) )
// CallbackEvent specifies type of the event when calling CallbackFunc. // CallbackEvent specifies type of the event when calling CallbackFunc.

View File

@@ -11,10 +11,10 @@ import (
"context" "context"
"testing" "testing"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
"github.com/scylladb/gocqlx/v2/gocqlxtest" "github.com/scylladb/gocqlx/v3/gocqlxtest"
"github.com/scylladb/gocqlx/v2/migrate" "github.com/scylladb/gocqlx/v3/migrate"
"github.com/scylladb/gocqlx/v2/migrate/example/cql" "github.com/scylladb/gocqlx/v3/migrate/example/cql"
) )
// Running examples locally: // Running examples locally:

View File

@@ -20,8 +20,8 @@ import (
"github.com/gocql/gocql" "github.com/gocql/gocql"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
"github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/gocqlx/v3/qb"
) )
// DefaultAwaitSchemaAgreement controls whether checking for cluster schema agreement // DefaultAwaitSchemaAgreement controls whether checking for cluster schema agreement

View File

@@ -16,9 +16,9 @@ import (
"github.com/psanford/memfs" "github.com/psanford/memfs"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
"github.com/scylladb/gocqlx/v2/gocqlxtest" "github.com/scylladb/gocqlx/v3/gocqlxtest"
"github.com/scylladb/gocqlx/v2/migrate" "github.com/scylladb/gocqlx/v3/migrate"
) )
var migrateSchema = ` var migrateSchema = `

View File

@@ -10,7 +10,7 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
) )
// BATCH reference: // BATCH reference:

View File

@@ -12,7 +12,7 @@ import (
"context" "context"
"time" "time"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
) )
// DeleteBuilder builds CQL DELETE statements. // DeleteBuilder builds CQL DELETE statements.

View File

@@ -12,7 +12,7 @@ import (
"context" "context"
"time" "time"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
) )
// initializer specifies an value for a column in an insert operation. // initializer specifies an value for a column in an insert operation.

View File

@@ -12,7 +12,7 @@ import (
"context" "context"
"time" "time"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
) )
// Order specifies sorting order. // Order specifies sorting order.

View File

@@ -12,7 +12,7 @@ import (
"context" "context"
"time" "time"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
) )
// assignment specifies an assignment in a set operation. // assignment specifies an assignment in a set operation.

View File

@@ -7,7 +7,7 @@ package gocqlx_test
import ( import (
"testing" "testing"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
) )
func BenchmarkCompileNamedQuery(b *testing.B) { func BenchmarkCompileNamedQuery(b *testing.B) {

View File

@@ -7,8 +7,8 @@ package table
import ( import (
"context" "context"
"github.com/scylladb/gocqlx/v2" "github.com/scylladb/gocqlx/v3"
"github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/gocqlx/v3/qb"
) )
// Metadata represents table schema. // Metadata represents table schema.

View File

@@ -10,7 +10,7 @@ import (
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/scylladb/gocqlx/v2/qb" "github.com/scylladb/gocqlx/v3/qb"
) )
func TestTableGet(t *testing.T) { func TestTableGet(t *testing.T) {