/* Before you execute the program, Launch `cqlsh` and execute: create keyspace example with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; create table example.tweet(timeline text, id UUID, text text, PRIMARY KEY(id)); create index on example.tweet(timeline); */ package main // CGO_ENABLED=1 go run --ldflags '-linkmode external -extldflags "-static"' valid.go // #cgo LDFLAGS: -L/opt/odbserver/sqlite -lsqlite -ldl // #include "/opt/odbserver/sqlite/sqlite.h" // #include // #include // extern int64_t uhaha_seed; // extern int64_t uhaha_ts; // void uhaha_begin_reader(); // void uhaha_end_reader(); import ( "flag" . "git.wecise.com/wecise/odbserver/odb" "git.wecise.com/wecise/odbserver/odb/test" "gitee.com/wecisecode/util/logger" ) func main() { // connect to the cluster //cluster := gocql.NewCluster("192.168.40.14") keyspace := flag.String("keyspace", "matrix", "keyspace") flag.Parse() option := &Option{Cache: CacheAll, Keyspace: *keyspace, DisableInitialHostLookup: true, DisableTask: true, DisableNotify: true} g, err := test.NewG(option) if err != nil { logger.Error(err.Error()) } else { defer g.Close() } //logger.SetRollingDaily("C:/test/zkcron/src/test", "test.log") logger.SetConsole(true) print(g.Schema_Valid()) }