cashapp / sqldelight

SQLDelight - Generates typesafe Kotlin APIs from SQL
https://cashapp.github.io/sqldelight/
Apache License 2.0
6.01k stars 501 forks source link

Can't delete #5278

Closed orelvis15 closed 4 weeks ago

orelvis15 commented 4 weeks ago

SQLDelight Version

2.0.2

Application Operating System

Android

Describe the Bug

I have a database with the authenticated user, all the queries work fine, insert, obtain, update, but delete does not work, if I use the plugin by clicking on the icon next to the query it deletes correctly but when I do it through the code It's not working for me.

this is my .sq file

CREATE TABLE IF NOT EXISTS User (
    idToken TEXT NOT NULL ,
    email TEXT NOT NULL,
    refreshToken TEXT,
    name TEXT,
    localId TEXT
);

removeAllUsers:
DELETE FROM User;

This is the method that is generated

public fun removeAllUsers() {
    driver.execute(1_094_908_294, """DELETE FROM User""", 0)
    notifyQueries(1_094_908_294) { emit ->
      emit("User")
    }
  }

and that's what I'm calling it

databaseQuery?.removeAllUsers()

I am using compose multiplatform 1.6.10 with kotlin 2.0.0, at the moment I have only tested on android.

Stacktrace

No response

orelvis15 commented 4 weeks ago

Forget it, my mistake, I was making the call from a different instance. Doesn't it happen to you that you spend hours with an error, when you create the problem in a few minutes you get the solution?