Skip to content

bug: CREATE TABLE with SQL comments causes ExportToJson to fail #685

@ae8028

Description

@ae8028

Plugin version:
^8.0.0

Platform(s):
Android

Current behavior:
When a CREATE TABLE statement contains SQL comments (-- or /* */),
ExportToJson fails with the following error:

ExportToJson: CreateExportObject: GetTablesFull: length=1; index=1

Expected behavior:
ExportToJson completes successfully.

Steps to reproduce:

  1. Create a table with SQL comments inside the CREATE TABLE statement
  2. Call ExportToJson('full')
  3. Error occurs

Related code:

CREATE TABLE IF NOT EXISTS user_learning_logs (
    uuid TEXT PRIMARY KEY,
    -- 'LEARN', 'REVIEW', 'CHALLENGE','PROFICIENCY'
    activity_type TEXT NOT NULL
);

Other information:
Removing all comments from CREATE TABLE statements resolves the issue.

Capacitor doctor:
Latest Dependencies:

@capacitor/cli: 8.2.0
@capacitor/core: 8.2.0
@capacitor/android: 8.2.0
@capacitor/ios: 8.2.0

Installed Dependencies:

@capacitor/cli: 8.0.2
@capacitor/android: 8.0.2
@capacitor/core: 8.2.0
@capacitor/ios: 8.2.0

[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