Skip to content

"on conflict" clause in user insert query causes crash in android 28 #35

@ruffCode

Description

@ruffCode

The query causing the issue is:

insert:
INSERT INTO UserEntity
VALUES ?
    ON CONFLICT(id) 
        DO UPDATE 
        SET email = excluded.email;
    android.database.sqlite.SQLiteException: near "ON": syntax error (code 1 SQLITE_ERROR): , while compiling: INSERT INTO UserEntity
    VALUES (?, ?)
    ON CONFLICT(id) DO UPDATE SET email = excluded.email
        at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
        at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:903)
        at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:514)
        at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
        at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
        at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
        at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1086)
        at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.compileStatement(FrameworkSQLiteDatabase.java:64)
        at com.squareup.sqldelight.android.AndroidSqliteDriver$execute$1.invoke(AndroidSqliteDriver.kt:140)
        at com.squareup.sqldelight.android.AndroidSqliteDriver$execute$1.invoke(AndroidSqliteDriver.kt:21)
        at com.squareup.sqldelight.android.AndroidSqliteDriver.execute(AndroidSqliteDriver.kt:121)
        at com.squareup.sqldelight.android.AndroidSqliteDriver.execute(AndroidSqliteDriver.kt:140)
        at com.squareup.sqldelight.logs.LogSqliteDriver.execute(LogSqliteDriver.kt:40)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions