capacitor-community / sqlite

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

Multi Row Statement does not escape characters #535

Closed lasher23 closed 3 weeks ago

lasher23 commented 1 month ago

Describe the bug Using a multi row statement via the executeSet Plugin Method does not escape special characters

To Reproduce

  1. use executeSet method
  2. pass a two dimensional array as paramter to trigger multi row statement
  3. pass as one parameter of the value a string with a special charachter, like '

Expected behavior If a special character is used it should be appropriatly escaped

Desktop (please complete the following information):

jepiqueau commented 1 month ago

@lasher23 please give a full example

lasher23 commented 1 month ago

Yeah Sure i also created a pull request

execute("create table abc (name varchar(20))")
executeSet([{statement: "insert into abc(name) values (?)", values: ["a'b"]}])
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