Skip to content

bug: lastId < 0 when id INTEGER PRIMARY KEY #687

Description

@devioarts

Plugin version:
8.0.1

Platform(s):
web

Current behavior:
when I run a query where PRIMARY KEY is, for example, -1, it gives the error "Run: RunSQL: lastId < 0"

Expected behavior:
return -1 as lastId

Steps to reproduce:

  1. create table users
  2. try to insert row with negative id

Related code:

CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, user_name TEXT);
INSERT INTO `users` (`id`,`user_name`) VALUES(-1, "Admin")

Other information:
SQLite itself has no problem with this

Capacitor doctor:

npx cap doctor
💊   Capacitor Doctor  💊 

Latest Dependencies:

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

Installed Dependencies:

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

[success] Android looking great! 👌
[success] iOS looking great! 👌

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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