Connections: support of multiple keyspaces and sessions

Description

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

Environment

None

Pull Requests

None

Activity

Show:
Adam Holmberg
August 18, 2016, 6:20 AM

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

Alan Boudreault
August 18, 2016, 7:08 AM

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.

Alan Boudreault
September 1, 2016, 12:21 AM

For the final review

Alan Boudreault
September 1, 2016, 3:37 AM

Merged. Let me know when you want to discuss about an addition on the tests.

Greg Bestland
September 13, 2016, 12:57 AM

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.
https://github.com/datastax/python-driver/commit/83ea44a2d4418717b46d07b0186e682c921ff06e

Fixed

Assignee

Unassigned

Reporter

Alan Boudreault

Fix versions

PM Priority

None

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Pull Request

None

Sprint

Py P-NEXT

Priority

Major