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

using query with single sql_raw column drops FROM clause #416

Open
machow opened this issue Apr 11, 2022 · 0 comments
Open

using query with single sql_raw column drops FROM clause #416

machow opened this issue Apr 11, 2022 · 0 comments

Comments

@machow
Copy link
Owner

machow commented Apr 11, 2022

SqlAlchemy uses the tables that columns are associated to, to decide what to include in the FROM clause. Because sql_raw does not have a table associated with it--having it as the sole column causes the FROM clause to be omitted.

We could pretty easily, associate the current table/subquery to the clause, but I wonder if we should also add an argument to sql_raw to optionally disable this behavior.

Note also that sql_raw is literally sqlalchemy.sql.elements.literal_column, so a user could add the table themselves, etc..

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