Skip to content

bug: CapacitorSQLitePlugin.addUpgradeStatements() fails without error #621

Description

@efleetcon-simon-s

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 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! 👌

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions