This is a follow-up task of PYTHON-598. This task is to finish the proposal and the implementation of the multiple keyspaces and sessions support in CQLEngine.
Additionally, here are a few things to do in the next major release:
Decouple the keyspace from the Model
Add a .keyspace() descriptor to the Model and ModelQuerySet
A few questions and comments from my initial reading:
Connection.keyspaces : is this just a way of allowing that "Autosync" thing below work? This might get a little dicey if models should not be in all keyspaces equally for a given cluster. We may just want to go the sync_tables(connection, keyspaces) route.
I see you are proposing the descriptors API. I think I would lean toward "Option 1" to avoid the name collision and to avoid having to create a new descriptor every time we think of a new attribute. On a related note, are you planning to add 'connection' to ContextQuery, or doesn't that pattern apply here?
Autosync: would this be required if we have updated management commands?
+1 ContextQuery update
Connection.keyspaces: Good point. +1, will be removed.
I am fine with the "Option 1". Yes, the ContextQuery will support the Connection, forgot to mention it in the proposal.
Autosync: Not really, I agree. +1 as well to not implement this.
For the final review
Merged. Let me know when you want to discuss about an addition on the tests.
Great job with the test additions here, as per your recommendation, I have added a subset of the queryset test suites to run with a non default connection here.