I'm trying to migrate from SQLDelight 2.0.0 to 2.0...
# squarelibraries
l
I'm trying to migrate from SQLDelight 2.0.0 to 2.0.2 and some of my queries aren't compiling. Specifically, around boolean expressions in SELECT statements.
queries like this:
Copy code
someQuery:
SELECT some_table_1.id AS id,
       some_table_2.id IS NOT NULL AS check_table_2,
       some_table_3.id IS NOT NULL AS check_table_3,
       some_table_4.id IS NOT NULL AS check_table_4,
FROM some_table_1
LEFT JOIN some_table_2 ON some_table_2.id = some_table_1.id
LEFT JOIN some_table_3 ON some_table_3.id = some_table_1.id
LEFT JOIN some_table_4 ON some_table_4.id = some_table_1.id
WHERE some_table_1.id = :id;
fail with an error like this:
Copy code
* What went wrong:
Execution failed for task ':mydatabasemodule:generateMainMyDatabaseInterface'.
> A failure occurred while executing app.cash.sqldelight.gradle.SqlDelightTask$GenerateInterfaces
   > Failed to compile PostgreSqlCompoundSelectStmtImpl(COMPOUND_SELECT_STMT): [] :
I've noticed that removing the
some_table_2.id IS NOT NULL
lines makes the query compile. I've also noticed that if I do a boolean expression on a joined table's column that does not have the same name as the primary table (e.g.
some_table_2.other_column IS NOT NULL
that the query compiles.
Any obvious mistakes I'm making here? Or known issues/changes between 2.0.0 and 2.0.2?