I am having problems with SQLDelight and SQLite on...
# squarelibraries
m
I am having problems with SQLDelight and SQLite on desktop. I have tested all my queries via the SQLite Browser before I started to migrate a project to use SQLDelight/SQLite. Now it turns out that even the latest version of SQLDelight (2.1.0) only supports an ancient dialect of SQLite (3.18?) which has lots of limitations compared to modern SQLite. Is there any way to configure a more recent dialect version or any other workaround for this?
g
e
m
@gildor It seems it uses the oldest supported one (3.18) if you haven’t explicitly configured another one.
@eygraber Thanks, I did not know that. Configuring a more recent version (3.38) works. But I still get this error message:
Copy code
Compiling with dialect app.cash.sqldelight.dialects.sqlite_3_38.SqliteDialect

/Users/mpaus/Projects/mpMediaSoft/apps/JavaForumStuttgartApp/jfsAdmin/src/commonMain/sqldelight/jfsadmindb/de/mpmediasoft/javaforumstuttgart/model/jfsadmindb/jfsadmindb.sq:446:9 <compound operator real>, <join operator real>, GROUP, HAVING, INDEXED, LIMIT, NOT, ORDER, WHERE or WINDOW expected, got 'join'
440    SELECT
441        Sp.firstName,
442        Sp.surName,
443        Sp.eMail,
444        Talk.title
445    FROM Talk
446        left join Speaker as Sp    on Talk.speakerId     = Sp.id
                ^^^^
447        left join Speaker as CoSp1 on Talk.coSpeakerId1  = CoSp1.id
448        left join Speaker as CoSp2 on Talk.coSpeakerId2  = CoSp2.id
449    WHERE
450        Talk.status = "SEL"
451    ORDER BY
452        Sp.surName
for this SQL query which works perfectly in the latest SQLite Browser.
Copy code
SELECT
    Sp.firstName,
    Sp.surName,
    Sp.eMail,
    Talk.title
FROM Talk
    left join Speaker as Sp    on Talk.speakerId     = Sp.id
    left join Speaker as CoSp1 on Talk.coSpeakerId1  = CoSp1.id
    left join Speaker as CoSp2 on Talk.coSpeakerId2  = CoSp2.id
WHERE
    Talk.status = "SEL"
ORDER BY
    Sp.surName
;
Any idea how to fix that?
s
Does changing SQL keywords case to uppercase change anything?
left join
->
LEFT JOIN
https://github.com/sqldelight/sqldelight/issues/3345
1
🙏 1
m
Good point. That fixed it. But I had to fix
as
and
on
too.
s
We should print better error messages when this happens
👍 1
💯 1