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

Table name included in CRUD update while ClickHouse does not accept it #281

Open
vkozmik opened this issue Jan 12, 2024 · 0 comments
Open

Comments

@vkozmik
Copy link

vkozmik commented Jan 12, 2024

I have a query which increments the column by one:
query = (
update(Table)
.filter(Table.id == '123')
.values(counter=Table.counter + 1)
)
session.connection().execute(query)

This issues
ALTER TABLE table UPDATE counter = (table.counter + 1)
and database complains about "table.counter"

This can be probably fixed by not including table name while calling _get_crud_params, but I do not know if it would have negative side effects for some updates which use select from multiple tables, etc.
def visit_update(self, update_stmt, **kw):
....
crud_params = crud._get_crud_params(
self, update_stmt, compile_state, True, ==>>include_table=False<<==, **kw
)

Version 0.3.0 with sqlalchemy 2.0.25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant