capacitor-community / capacitor-community/sqlite
bug: CapacitorSQLitePlugin.addUpgradeStatements() fails without error
- Dominant language
- Swift
- Stars
- 661
- Forks
- 158
- PR merge metrics
- No merged PRs in 30d
Description
**Plugin version:**
6.0.2
**Platform(s):**
Web
**Current behavior:**
Calling `addUpgradeStatement()` with SQL statements containing obvious syntax errors silently fails.
**Expected behavior:**
I expect the function to error when executing the statements. Instead, I get errors after initialization at "runtime" when I query my tables that were not created because of invalid upgrade statements.
**Steps to reproduce:**
Change the upgrade statements in [this demo](https://jepiqueau.github.io/2023/08/26/Ionic7Angular-SQLite-CRUD-App.html#create-the-sqlite-database) to contain obvious errors.
**Related code:**
```
{
toVersion: 1,
statements: [`CREATE TABLE IF NOT EXISTS tires (id NOT_A_TYPE);`, `CREATE; T1asd`, ''],
}
```
**Capacitor doctor:**
```
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
@capacitor/android: 7.0.1
@capacitor/ios: 7.0.1
Installed Dependencies:
@capacitor/cli: 6.2.0
@capacitor/core: 6.2.0
@capacitor/android: 6.2.0
@capacitor/ios: 6.2.0
[success] iOS looking great! 👌
[success] Android looking great! 👌
```
Contributor guide
Assessment
This issue has not been assessed yet.