https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
v

Vishnu Shrikar

10/11/2023, 3:22 AM
Copy code
setCurrentPosition: BEGIN ; DELETE FROM CurrentSetPosition; INSERT INTO CurrentSetPosition(pos) VALUES (:position); END;
I am using the SQLDelight Library and this does not generate the right function. There is no "position" parameter, in fact there is no parameter at all. Why is this happening
h

hfhbd

10/11/2023, 4:45 AM
Could you try it with the transaction syntax block?
v

Vishnu Shrikar

10/11/2023, 4:50 AM
like ?
Copy code
BEGIN TRANSACTION ; ...
h

hfhbd

10/11/2023, 8:39 PM
Nope:
Copy code
setCurrentPosition {
DELETE FROM CurrentSetPosition; INSERT INTO CurrentSetPosition(pos) VALUES (:position);
}
v

Vishnu Shrikar

10/12/2023, 2:27 AM
That appears to have done the trick, many thanks