Skip to content

tuple comparison does not compile #4510

@sphrak

Description

@sphrak

SQLDelight Version

2.0.0

Operating System

MacOS

Gradle Version

7.6.2

Kotlin Version

1.9.0

Dialect

3.38

AGP Version

No response

Describe the Bug

Hello,
A while ago this sqldelight/sql-psi#411 added "tuple comparison" support to sql-psi, and prior to 2.0.0 release #3454 got merged which (i have assumed) contained bumped sql-psi.

..and i believe prior to tuple comparison support in sql-psi it was not possible to write a query like this without the sqldelight plugin showing an error:

pageSelect:
SELECT *
FROM posts
WHERE (id, created_at) <= (:id, :createdAt)
ORDER BY created_at DESC
LIMIT 4

This however seems to work now, i get no errors in the *.sq itself -- but if I try to compile I get the stacktrace below.

I made a sample project here: https://github.com/sphrak/sqldelight-multi-column-expr-bug

Stacktrace

Execution failed for task ':generateMainTestdbInterface'.
> A failure occurred while executing app.cash.sqldelight.gradle.SqlDelightTask$GenerateInterfaces
   > Failed to compile SqlCompoundSelectStmtImpl(COMPOUND_SELECT_STMT): [] :
     SELECT *
         FROM posts
         WHERE (id, created_at) <= (:id, :createdAt)
         ORDER BY created_at DESC
         LIMIT 4

Gradle Build Script

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions