Hey guys, i was trying out sqldelight 2.0.0-alpha-...
# multiplatform
s
Hey guys, i was trying out sqldelight 2.0.0-alpha-05, facing some issue and when i try to generate the SqlDelight interface from gradle task it gives me an error, anyone else faced this ?
h
Any details about the error?
s
Screenshot 2023-03-18 at 6.21.06 PM.png
this happens when i uncomment the insert query
h
Can you paste the query?
s
Copy code
insert:
INSERT OR REPLACE INTO transactions (transactionAmount, partyName, isExpendeiture)
VALUES ?;
this is all i got because it doesn't generate anything
h
I mean the whole file with the table
s
Copy code
CREATE TABLE IF NOT EXISTS transactions (
    transactionId INTEGER PRIMARY KEY ASC ,
    transactionAmount TEXT,
    partyName TEXT,
    isExpendeiture INTEGER DEFAULT 0 NOT NULL
);

insert:
INSERT OR REPLACE INTO transactions (transactionAmount, partyName, isExpendeiture)
VALUES ?;

selectAll:
SELECT * FROM transactions;
--
-- selectParticular:
-- SELECT * FROM Transactions WHERE transactionId == ?;
--
-- deleteAll:
-- DELETE FROM Transactions;
h
ahhh, you cant use 'insert' as name, it is a reserved SQL keyword
s
gives the same error when i change the query name
Copy code
putInValue:
INSERT OR REPLACE INTO transactions (transactionAmount, partyName, isExpendeiture)
VALUES ?;
h
there is no insert or replace in mysql: https://dev.mysql.com/doc/refman/8.0/en/insert.html
s
thanks it worked 😄