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

fix: sql test dont work in Postgresql because required alias #63

Closed
wants to merge 1 commit into from

Conversation

benfdking
Copy link
Collaborator

@benfdking benfdking commented Apr 30, 2024

Postgres doesn't like our current test generation because it doesn't have an alias

called `Result::unwrap()` on an `Err` value: QueryError { query: "error returned from database: subquery in FROM must have an alias", error: "SELECT id, COUNT(*)\nFROM (WITH\ntest_source AS (SELECT * FROM other_schema.test_table),\ntest_model AS (SELECT id FROM test_source)\nSELECT * FROM (SELECT id FROM test_model) AS alias)\nGROUP BY id\nHAVING COUNT(*) > 1;\n" }
thread 'databases_postgres::tests::postgres_sql_test' panicked at rust/quary-databases/src/databases_postgres.rs:839:54:
called `Result::unwrap()` on an `Err` value: QueryError { query: "error returned from database: subquery in FROM must have an alias", error: "SELECT id, COUNT(*)\nFROM (WITH\ntest_source AS (SELECT * FROM other_schema.test_table),\ntest_model AS (SELECT id FROM test_source)\nSELECT * FROM (SELECT id FROM test_model) AS alias)\nGROUP BY id\nHAVING COUNT(*) > 1;\n" }

@benfdking benfdking added the bug Something isn't working label Apr 30, 2024
@benfdking benfdking self-assigned this Apr 30, 2024
@benfdking benfdking marked this pull request as draft April 30, 2024 10:18
@benfdking benfdking changed the title fix: sql test dont work in python because required alias fix: sql test dont work in Postgresql because required alias May 1, 2024
@benfdking
Copy link
Collaborator Author

#262 fixes this issue in Postges

@benfdking benfdking closed this May 22, 2024
@benfdking benfdking deleted the bug_sql_test_postgres branch May 22, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant