gocql

gocql SELECT * doesn't return all columns

╄→гoц情女王★ 提交于 2019-12-11 03:57:53
问题 I came across this weird behaviour while trying to implement some counters for my application. Basically, I did a counter table like so : CREATE TABLE stats_dev.log_counters ( date text PRIMARY KEY, all counter ); Then I have some specific types of message I want to count as well, so in my Go app, I ALTER the table to add the column I didn't have before. My app is growing, and I start to have more than 30 columns (shouldn't be more than 50) and when I want to retrieve all those counters, some

GoCQL : Marshal string into timestamp

青春壹個敷衍的年華 提交于 2019-12-10 11:22:49
问题 I am developing a time series data model with clustering column i.e. CREATE TABLE events ( id text, time timestamp, type text, val double, PRIMARY KEY (id, time) ) WITH CLUSTERING ORDER BY (time DESC) I wish to perform a select against the partition column 'id' and clustering column 'time'. For example, id:='1', timestamp:='2017-10-09' query := "SELECT id, time, type, val FROM events WHERE id=? AND time>=?" iterable := Cassandra.Session.Query(query, id, timestamp).Consistency(gocql.One).Iter(

GoCQL : Marshal string into timestamp

笑着哭i 提交于 2019-12-06 12:08:01
I am developing a time series data model with clustering column i.e. CREATE TABLE events ( id text, time timestamp, type text, val double, PRIMARY KEY (id, time) ) WITH CLUSTERING ORDER BY (time DESC) I wish to perform a select against the partition column 'id' and clustering column 'time'. For example, id:='1', timestamp:='2017-10-09' query := "SELECT id, time, type, val FROM events WHERE id=? AND time>=?" iterable := Cassandra.Session.Query(query, id, timestamp).Consistency(gocql.One).Iter() for iterable.MapScan(m) { found = true event = Event{ ID: m["id"].(string), Time: m["time"].(time

How to set GOPATH in Mac OS X 10.10

ε祈祈猫儿з 提交于 2019-12-03 08:27:30
问题 I installed Go 1.4 in Mac OS X. Previously I had Go 1.0. I set the GOROOT and PATH as follows, Dineshs-MacBook-Air:go-cassandra Dany$ which go /usr/local/go/bin/go Dineshs-MacBook-Air:go-cassandra Dany$ export GOROOT=/usr/local/go/bin/go Dineshs-MacBook-Air:go-cassandra Dany$ export PATH=$PATH:$GOROOT/bin Go is installed in '/usr/local/go/bin/go'. And I set the GOPATH as my project src directory. I am able to run go code inside my directory. But when I try to install gocql I am getting error.

How to set GOPATH in Mac OS X 10.10

随声附和 提交于 2019-12-02 21:03:35
I installed Go 1.4 in Mac OS X. Previously I had Go 1.0. I set the GOROOT and PATH as follows, Dineshs-MacBook-Air:go-cassandra Dany$ which go /usr/local/go/bin/go Dineshs-MacBook-Air:go-cassandra Dany$ export GOROOT=/usr/local/go/bin/go Dineshs-MacBook-Air:go-cassandra Dany$ export PATH=$PATH:$GOROOT/bin Go is installed in '/usr/local/go/bin/go'. And I set the GOPATH as my project src directory. I am able to run go code inside my directory. But when I try to install gocql I am getting error. Dineshs-MacBook-Air:go-cassandra Dany$ sudo go get github.com/gocql/gocql package github.com/gocql