-
Notifications
You must be signed in to change notification settings - Fork 31
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
SQLAlchemy: Ignore SQL's "FOR UPDATE" clause #584
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def for_update_clause(self, select, **kw): | ||
# CrateDB does not support currently 'FOR UPDATE' statements. | ||
# See https://github.com/crate/crate-python/issues/577 | ||
return '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about the user warning, @matriv. I've just added a corresponding improvement to the other patch with 154d77a. If you would be so kind to adjust the patch like that, @surister? 🙏
I think it will be good like this. If you insist on adding it also to the documentation, I can take this, so we do not need to bother @surister about finding a good spot ;].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that logging a warning is enough, mainly for those users that quickly try out CrateDB as their backend (switching from some other DB), to be informed.
People working with CrateDB should already know it doesn't support transactions, so adding a docs entry about that to the python client is a bit too much, so I think it's fine to just log a warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I've amended the patch by adding a similar warning like on the other one.
Dear @surister, after bringing in #582 and #583, I am going to wrap this up, if you don't have any objections. Users are waiting for another release, and my intention was only to bring in a few small maintenance updates and little improvements like this. Your contribution was a perfect fit for that, and arrived just in time. Thank you again. With kind regards, |
49fb8c2
to
3ba3bc8
Compare
3ba3bc8
to
7e35438
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7e35438
to
44c21d2
Compare
44c21d2
to
c07e203
Compare
Summary of the changes / Why this is an improvement
Pretty straightforward, now queries like
select(table).with_for_update()
will not generate aFOR UPDATE
statement.Resolves crate/sqlalchemy-cratedb#95.
Checklist