We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We should be able to scan and bind arrays and slices.
At the moment
func datatypesTuplesSimple(t *testing.T, session gocqlx.Session) { err := session.ExecStmt(`CREATE KEYSPACE IF NOT EXISTS examples WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}`) if err != nil { t.Fatal("create keyspace:", err) } err = session.ExecStmt(`CREATE TABLE IF NOT EXISTS examples.tuples(k int PRIMARY KEY, c tuple<int,int>)`) if err != nil { t.Fatal("create table:", err) } coordinates1 := [2]int{12, 34} coordinates2 := [2]int{56, 78} insert := session.Query(qb.Insert("examples.tuples").Columns("k").TupleColumn("c", 2).ToCql()) insert.BindMap(qb.M{ "k": 1, "c_0": coordinates1[0], "c_1": coordinates1[1], }) if err := insert.Exec(); err != nil { t.Fatal("Exec() failed:", err) } insert.BindMap(qb.M{ "k": 2, "c_0": coordinates2[0], "c_1": coordinates2[1], }) if err := insert.Exec(); err != nil { t.Fatal("Exec() failed:", err) } row := &struct { K int C [2]int C0 int `db:"c[0]"` C1 int `db:"c[1]"` }{} q := session.Query(qb.Select("examples.tuples").Columns("k", "c").ToCql()) if err := q.Get(row); err != nil { t.Fatal(err) } t.Log(row) }
At the moment it fails with gocql: not enough columns to scan into: have 2 want 3
gocql: not enough columns to scan into: have 2 want 3
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We should be able to scan and bind arrays and slices.
At the moment
At the moment it fails with
gocql: not enough columns to scan into: have 2 want 3
The text was updated successfully, but these errors were encountered: