capacitor-community / sqlite

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

(Android): SQL statement with SQL comments return error code 21 #524

Closed ygarg465 closed 2 months ago

ygarg465 commented 2 months ago

Describe the bug I am using ElectricSQL which generates migration SQL statements that contain SQL comments as well. Example 1

-- Toggles for turning the triggers on and off
INSERT OR IGNORE INTO _electric_trigger_settings(tablename,flag) VALUES ('main.settings', 1);

Example 2

  /* Triggers for table settings */

  -- ensures primary key is immutable
  DROP TRIGGER IF EXISTS update_ensure_main_settings_primarykey;

This results in calling the executeUpdateDelete method on the Statement class. Look at this line which return in the above case "-- Tog" as Statement Type

Expected behaviour It should call the respective method on statement object based on the SQL statement ignoring sql comments that starts with "--"

Smartphone (please complete the following information):

ygarg465 commented 2 months ago

Sorry, this issue is reported solved by someone else in electric SQL and fixed. Thanksss