Skip to content

Commit

Permalink
Release v3 - change v2 suffix to v3
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sylwiaszunejko committed Jul 15, 2024
1 parent 653faf1 commit e726792
Show file tree
Hide file tree
Showing 29 changed files with 67 additions and 65 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 (
Expand Down
6 changes: 3 additions & 3 deletions batchx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/schemagen/keyspace.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package {{.PackageName}}

import (
"github.com/scylladb/gocqlx/v2/table"
"github.com/scylladb/gocqlx/v3/table"
{{- range .Imports}}
"{{.}}"
{{- end}}
Expand Down
6 changes: 3 additions & 3 deletions cmd/schemagen/schemagen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/schemagen/schemagen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 6 additions & 3 deletions cmd/schemagen/testdata/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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 => ../../..
)
10 changes: 4 additions & 6 deletions cmd/schemagen/testdata/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand Down
4 changes: 2 additions & 2 deletions cmd/schemagen/testdata/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions cmd/schemagen/testdata/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions dbutil/rewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions dbutil/rewrite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/scylladb/gocqlx/v2
module github.com/scylladb/gocqlx/v3

go 1.17

Expand Down
2 changes: 1 addition & 1 deletion gocqlxtest/gocqlxtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/gocql/gocql"

"github.com/scylladb/gocqlx/v2"
"github.com/scylladb/gocqlx/v3"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions iterx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion migrate/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions migrate/example/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions migrate/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand Down
2 changes: 1 addition & 1 deletion qb/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"fmt"
"time"

"github.com/scylladb/gocqlx/v2"
"github.com/scylladb/gocqlx/v3"
)

// BATCH reference:
Expand Down
2 changes: 1 addition & 1 deletion qb/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"context"
"time"

"github.com/scylladb/gocqlx/v2"
"github.com/scylladb/gocqlx/v3"
)

// DeleteBuilder builds CQL DELETE statements.
Expand Down
2 changes: 1 addition & 1 deletion qb/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion qb/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"context"
"time"

"github.com/scylladb/gocqlx/v2"
"github.com/scylladb/gocqlx/v3"
)

// Order specifies sorting order.
Expand Down
2 changes: 1 addition & 1 deletion qb/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion queryx_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package gocqlx_test
import (
"testing"

"github.com/scylladb/gocqlx/v2"
"github.com/scylladb/gocqlx/v3"
)

func BenchmarkCompileNamedQuery(b *testing.B) {
Expand Down
4 changes: 2 additions & 2 deletions table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion table/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e726792

Please sign in to comment.