HomeSoftware Heritage

Stop using `USE <keyspace>` with prepared statements
1e7ede1828e7Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

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 4 2022, 1:55 PM
Parents
R65:0aff46189a13: cassandra: Simplify SELECT statement formatting
Branches
Unknown
Tags
Unknown
References
tag: phabricator/diff/29542, tag: phabricator/base/29552

Event Timeline