sqldelight / sqldelight/sql-psi
Test fixtures aren't not valid ansi sql
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 104
- Forks
- 35
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 14
Description
Dialect
SQLite
Failing SQL
SELECT 42 WHERE 1 = ?1;
Description
Unfortunately, there is no real ANSI sql standard, because the standard itself is not very strict and every vendor has custom dialects. But the test fixtures should be dialect agnostic as possible.
This includes:
- No
?1because this syntax isn't supported by all dialects (eg PostgreSQL R2DBC or DB2) - Always add a FROM clause. While almost all dialects do support omitting the FROM clause, DB2 does not.
One simple option split the test fixtures and the variable into ansi sql and common sql (name to be discussed), which contains the failing test fixtures.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the SQL test fixtures containing SELECT 42 WHERE 1 = ?1 and inspect how dialect-specific fixture groups are organized. Run the relevant fixture or parser tests, then ensure ANSI fixtures avoid numbered parameters and include a FROM clause, with the tests passing for the supported dialects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100