tag | e2d9a011e665f45b0cbf2d587419c96a62ff8e84 | |
---|---|---|
tagger | Martin Sucha <martin.sucha@kiwi.com> | Mon Jun 12 17:29:34 2023 +0200 |
object | c27e8098fa3e9e2d59e114a63e8d09f3729fc472 |
v1.5.0 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 2023-06-12: Switching signing key used for github.com/gocql/gocql tags (since v1.5.0) from GPG key ID: E0C5EC9218CB255D to SSH key with the following fingerprint: SHA256:TcKxeY58a0HRfycY4dCuqMF23FrNyEcclOdVzUI9BBI You can verify it with martin.sucha@kiwi.com namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN8Cnim2/FWQqDJmhidmXK/9VNO64rLfVJrvZqKaLqUl in your gpg.ssh.allowedSignersFile -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEW7CgRMsA2lq5yf6v4MXskhjLJV0FAmSHOcYACgkQ4MXskhjL JV2IXhAAye6kQhLwiiCag6bHUKIbKxM0TQHiOZf7aRKYlU2s0aWcsOXMeS6S9pvC cJqmjBdhDZx569bPrgjAy9+jMoe+rNBR5Cr8dcJUk31cKUTjm/7PsKfiCxfDrbnm ARDY2Z3vdGJC39mvBjG16UurzAPlRnP66jzyWYaXBiFBJJGWkP1+m+PNG4eF9ggo 6W89MEeK6ZpLCxI0URq2RyB5JEgGkr1Gb9UB4/70euiTjUxeRjS+RHjosGREC0nG MxfpHND/Z+gOhHXCYt87zrF7N7JWIFU3+4vOj/th8MvMGRYaDzOAKT7MQmc/wc3A drBA5G/adltjNw9aWTRQGNV69jhaoaIkZfv4fy+AvPDz41iGOQD9Nulw8ujkocUC 8zr4OxPhc0LIX1LtqwA2ahYfJABXnC7ObzqZLyXsE0sW5yvWpPNlF+Bj/slAdO+6 d+4uxGs8dd3N/bOihFL2XZoeOStF6ehT5KIFsbr885FUueu6iRgZYPalfv/aWe95 VIh97ikNsfgFH3mO0ZTGP9tnjSCbGIwG2Oh3+0dj5J4tZU1ihJRKiHJJNQirG1xK jMdu9EXOEPFK4CPwaXZgHpTy38cFF2MOxHbsrxErCuWJY8JxRpqlJeOyx0F+eTR4 NGQSrMKvxfKd/F192UznSUSfflRTrQT7stUOhZk3Lc4YcCSiDEk= =em6i -----END PGP SIGNATURE-----
commit | c27e8098fa3e9e2d59e114a63e8d09f3729fc472 | [log] [tgz] |
---|---|---|
author | Martin Sucha <martin.sucha@kiwi.com> | Mon Jun 12 13:29:01 2023 +0200 |
committer | Martin Sucha <martin.sucha@kiwi.com> | Mon Jun 12 13:29:01 2023 +0200 |
tree | 912bfbe5c39f853d83f33d5e2dbaa743d41723d9 | |
parent | 86b5752ed989e8bd1f0e551987a21480000ddabe [diff] |
Mention version advertising in documentation
Package gocql implements a fast and robust Cassandra client for the Go programming language.
Project Website: https://gocql.github.io/
API documentation: https://godoc.org/github.com/gocql/gocql
Discussions: https://groups.google.com/forum/#!forum/gocql
The following matrix shows the versions of Go and Cassandra that are tested with the integration test suite as part of the CI build:
Go/Cassandra | 4.0.x | 4.1.x |
---|---|---|
1.19 | yes | yes |
1.20 | yes | yes |
Gocql has been tested in production against many versions of Cassandra. Due to limits in our CI setup we only test against the latest 2 GA releases.
In general, the gocql team will focus on supporting the current and previous versions of Go. gocql may still work with older versions of Go, but official support for these versions will have been sunset.
go get github.com/gocql/gocql
Marshaler
and Unmarshaler
interfaceWhile the driver strives to be highly performant, there are cases where it is difficult to test and verify. The driver is built with maintainability and code readability in mind first and then performance and features, as such every now and then performance may degrade, if this occurs please report and issue and it will be looked at and remedied. The only time the driver copies data from its read buffer is when it Unmarshal's data into supplied types.
Some tips for getting more performance from the driver:
GOGC
gocql no longer supports executing “use ” statements to simplify the library. The user still has the ability to define the default keyspace for connections but now the keyspace can only be defined before a session is created. Queries can still access keyspaces by indicating the keyspace in the query:
SELECT * FROM example2.table;
Example of correct usage:
cluster := gocql.NewCluster("192.168.1.1", "192.168.1.2", "192.168.1.3")
cluster.Keyspace = "example"
...
session, err := cluster.CreateSession()
Example of incorrect usage:
cluster := gocql.NewCluster("192.168.1.1", "192.168.1.2", "192.168.1.3")
cluster.Keyspace = "example"
...
session, err := cluster.CreateSession()
if err = session.Query("use example2").Exec(); err != nil {
log.Fatal(err)
}
This will result in an err being returned from the session.Query line as the user is trying to execute a “use” statement.
There are various ways to bind application level data structures to CQL statements:
[]map[string]interface{}
using the SliceMap()
API. This returns a slice of row maps keyed by CQL column names. This method requires no special interaction with the gocql API, but it does require your application to be able to deal with a key value view of your data.SliceMap()
API you can also call MapScan()
which returns map[string]interface{}
instances in a row by row fashion.Bind()
API provides a client app with a low level mechanism to introspect query meta data and extract appropriate field values from application level data structures.The following community maintained tools are known to integrate with gocql:
database/sql
package. This project isn’t maintained anymore, because Cassandra wasn't a good fit for the traditional database/sql
API. Use this package instead.For some reason, when you Google golang cassandra
, this project doesn‘t feature very highly in the result list. But if you Google go cassandra
, then we’re a bit higher up the list. So this is note to try to convince Google that golang is an alias for Go.
Copyright (c) 2012-2016 The gocql Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.