capacitor-community / sqlite

Community plugin for native & electron SQLite databases
MIT License
426 stars 104 forks source link

Multirow statements inserts wrong semicolon #538

Closed lasher23 closed 3 weeks ago

lasher23 commented 1 month ago

Describe the bug After the replaced values in the multirow statement it always inserts a semicolon. Code

This only works if the insert has the values at the end of the statement. Insert into values (?,?,?) changes into Insert into table values ('','',''); If we for example use the SQLite Upsert/On Conflict the values are not at the end of the statement. INSERT INTO users (name, email) VALUES (?, ?) ON CONFLICT(email) DO UPDATE SET name = excluded.name changes into INSERT INTO users (name, email) VALUES ('', ''); ON CONFLICT(email) DO UPDATE SET name = excluded.name

This transforms is an invalid statement

To Reproduce Steps to reproduce the behavior:

  1. Execute the statements from above

Expected behavior No semicolon is inserted at all.

Desktop (please complete the following information):

jepiqueau commented 3 weeks ago

@lasher23 fix in v5.7.3-2 thanks for your contribution

lasher23 commented 3 weeks ago

@jepiqueau thank you for merging