HomeSoftware Heritage

Stop using `USE <keyspace>` with prepared statements

Description

Stop using USE <keyspace> with prepared statements

This caused the following warning:

WARNING  cassandra.protocol:libevreactor.py:361 Server warning: `USE <keyspace>` with prepared statements is considered to be an anti-pattern due to ambiguity in non-qualified table names. Please consider removing instances of `Session#setKeyspace(<keyspace>)`, `Session#execute("USE <keyspace>")` and `cluster.newSession(<keyspace>)` from your code, and always use fully qualified table names (e.g. <keyspace>.<table>).

This also prepends 'test' to the name of keyspaces used in tests, so
they are guaranteed to start with an letter (starting with digits cause
syntax errors in most statements).

Details

Provenance
vlorentzAuthored on Aug 4 2022, 1:53 PM
vlorentzPushed on Aug 5 2022, 10:06 AM
Differential Revision
D8183: Stop using `USE <keyspace>` with prepared statements
Parents
rDSTO0aff46189a13: cassandra: Simplify SELECT statement formatting
Branches
Unknown
Tags
Unknown
Build Status
Buildable 30630
Build 47892: test-and-buildJenkins console · Jenkins