Open SpencerC opened 2 years ago
Callers must chose between including the keyspace in each query:
_, err = stargateClient.ExecuteQuery(&sgpb.Query{ Cql: "INSERT INTO main_keyspace.some_table (id) VALUES ('abcd')", })
or adding a crazy complicated parameter to every query
_, err = stargateClient.ExecuteQuery(&sgpb.Query{ Cql: "INSERT INTO some_table (id) VALUES ('abcd')", Parameters: &sgpb.QueryParameters{Keyspace: &wrapperspb.StringValue{Value: "main_keyspace"}}, })
sc, err := client.NewStargateClientWithConn(conn, cilent.WithDefaultKeyspace("main_keyspace")) _, err = stargateClient.ExecuteQuery(&sgpb.Query{ Cql: "INSERT INTO some_table (id) VALUES ('abcd')", // implicitly uses "main_keyspace" }) _, err = stargateClient.ExecuteQuery(&sgpb.Query{ Cql: "INSERT INTO some_table (id) VALUES ('abcd')", Parameters: &sgpb.QueryParameters{Keyspace: &wrapperspb.StringValue{Value: "overriding_keyspace"}}, })
Current design
Callers must chose between including the keyspace in each query:
or adding a crazy complicated parameter to every query
Proposed design