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

support sharded query for bulk update/delete methods #4196

Closed
sqlalchemy-bot opened this issue Feb 22, 2018 · 10 comments
Closed

support sharded query for bulk update/delete methods #4196

sqlalchemy-bot opened this issue Feb 22, 2018 · 10 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 Michael Bayer (@zzzeek)

ongoing effort at https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/656/.
this needs to include tests with the sharded query itself, including all three fetch methods.

additional issue:

Got a problem when synchronize_session='fetch'. In that case used BulkFetch._do_pre_synchronize (as you know :)). There is query instance with set _bind_id attribute, but it don't passed through execute.

Here is an example that can illustrate that problem: https://gist.github.com/aCLr/a992ca92138aeee86bf9432693be6d6c
It contains Query and Session implementations, which used in my project: MultiBoundQuery and MultiBoundSession.
Also, it contains delete and update execution and checking for update and delete operation. Tracebacks included.

@sqlalchemy-bot
Copy link
Collaborator Author

Anton Ne Anton (@aCLr) wrote:

Hello.
Do you have any progress or suggestion for it?

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

hey! this is still on my TODO, but it's been low priority as it's a feature add, #4228 is also related to sharding and is a little more urgent as well. Also there is zzzeek/sqlalchemy#424, is that more urgent? for sharded update/delete you can always emit core table.update() / table.delete() as needed.

@sqlalchemy-bot
Copy link
Collaborator Author

Anton Ne Anton (@aCLr) wrote:

zzzeek/sqlalchemy#424 patch is already used in my project. And of course I know about core SQLAlchemy features, but currently we rely on ORM-layer :)
I have a question, will be great If you can answer: shoud fix contain some kind of hook, as you presented on https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/656/?

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

yes the work in gerrit 656 is where this is going

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

features are targeted at 1.3 or upwards right now

@sqlalchemy-bot
Copy link
Collaborator Author

Changes by Michael Bayer (@zzzeek):

  • removed labels: bug
  • added labels: feature

@sqlalchemy-bot
Copy link
Collaborator Author

Changes by Michael Bayer (@zzzeek):

  • changed milestone from "1.2.x" to "1.3"

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

does https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/656/ work for you right now?

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

Route bulk update/delete exec through new Query._execute_crud method

Added support for bulk :meth:.Query.update and :meth:.Query.delete
to the :class:.ShardedQuery class within the horiziontal sharding
extension. This also adds an additional expansion hook to the
bulk update/delete methods :meth:.Query._execute_crud.

Fixes: #4196
Change-Id: I65f56458176497a8cbdd368f41b879881f06348b

3081269

@sqlalchemy-bot
Copy link
Collaborator Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

@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 1.3 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