The goal of this pull request is to provide a gocql module inside the scylla-go-driver repository that could be used as a drop-in
replacement for gocql, just by using a replace directive in go.mod like this:
replace github.com/gocql/gocql => github.com/scylladb/scylla-go-driver/gocql <version/commit>
Benefits
Features: ORM, query building and migrations support can be used just by replacing GoCQL with the new driver in https://github.com/scylladb/gocqlx
Tests: Existing integration tests for GoCQLX, Scylla Manager, Scylla Operator, etc. can be used to test drivers correctness and safety.
Tests
New gocql package was tested against GocqlX and Scylla Manager tests.
GocqlX and Scylla Manager tests pass with exceptions:
Scylla Manager repair & backup integration tests.
GocqlX schemagen - due to metadata inconsistencies in scylladb/gocql metadata_scylla.go and metadata_cassandra.go
I added a workflow to run the already passed tests on GitHub Actions, if you want to run them please refer to this action.
To pass the Scylla Manager tests its also needed to add two lines of code to the manager tests as gocql and the new driver return different error messages on unauthorised errors.
Changes
This PR makes many small changes mostly to the driver's API so it can provide a gocql compatible API in the gocql package,
those chages include:
Allowing to check if session is closed
Allowing per-query retry policy setting
More getters/setters for Query and Iter
Configuring coalescing wait time
Transforming a query to a prepared one straight from query level
Allowing binding query arguments using Serializable interface
Exporting UDT fields in frame package
Falling back to random shard discovery when shard-aware port is missing/misbehaving
gocql package
This PR features a new gocql package, wrapping Session, Query and Iter in structs exporting gocql API methods.
Base functionality is here, some missing gocql features are:
GoCQL drop-in replacement
The goal of this pull request is to provide a gocql module inside the scylla-go-driver repository that could be used as a drop-in replacement for gocql, just by using a replace directive in go.mod like this:
replace github.com/gocql/gocql => github.com/scylladb/scylla-go-driver/gocql <version/commit>
Benefits
Features: ORM, query building and migrations support can be used just by replacing GoCQL with the new driver in https://github.com/scylladb/gocqlx Tests: Existing integration tests for GoCQLX, Scylla Manager, Scylla Operator, etc. can be used to test drivers correctness and safety.
Tests
New gocql package was tested against GocqlX and Scylla Manager tests. GocqlX and Scylla Manager tests pass with exceptions:
To pass the Scylla Manager tests its also needed to add two lines of code to the manager tests as gocql and the new driver return different error messages on unauthorised errors.
Changes
This PR makes many small changes mostly to the driver's API so it can provide a gocql compatible API in the gocql package, those chages include:
gocql package
This PR features a new gocql package, wrapping Session, Query and Iter in structs exporting gocql API methods. Base functionality is here, some missing gocql features are: