Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include shard_id in results from query #2031

Closed
sqlalchemy-bot opened this issue Jan 23, 2011 · 5 comments
Closed

Include shard_id in results from query #2031

sqlalchemy-bot opened this issue Jan 23, 2011 · 5 comments
Labels
feature sqlalchemy.ext extension modules, most of which are ORM related
Milestone

Comments

@sqlalchemy-bot
Copy link
Collaborator

Migrated issue, originally created by Anonymous

Hi. My situation is the following: I want to get, in a query, from which shard each row came from. This is because I don't have a rule for saving rows, since I only query on the dbs. And I can't tell from where each row came from using only the information in the database. So I made this small patch that fixes my issue.


Attachments: horizontal_shard.py.patch

@sqlalchemy-bot
Copy link
Collaborator Author

Anonymous wrote:

Suggestion of patch

@sqlalchemy-bot
Copy link
Collaborator Author

Changes by Anonymous:

  • attached file horizontal_shard.py.patch

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

de725a0 places "shard_id" in the QueryContext where it's accessible by the 0.7 version of the load() event. At that point the identifier can be associated with the objects in whatever way needed. Example updated in 3be8746

@sqlalchemy-bot
Copy link
Collaborator Author

Changes by Michael Bayer (@zzzeek):

  • set milestone to "0.7.0"
  • changed status to closed

@sqlalchemy-bot
Copy link
Collaborator Author

Anonymous wrote:

Thank you for that, I've never seen a bug fix happen so fast.

@sqlalchemy-bot sqlalchemy-bot added feature sqlalchemy.ext extension modules, most of which are ORM related labels Nov 27, 2018
@sqlalchemy-bot sqlalchemy-bot added this to the 0.7.0 milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature sqlalchemy.ext extension modules, most of which are ORM related
Projects
None yet
Development

No branches or pull requests

1 participant