capacitor-community / capacitor-community/electron

Cannot read properties of undefined (reading 'lastId')

Open
#275 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
398
Forks
63
PR merge metrics
No merged PRs in 30d

Description

The plugin shows the message "Error occurred in handler for 'CapacitorSQLite-executeSet': Error: ExecuteSet failed: TypeError: Cannot read properties of undefined (reading 'lastId')"
when i pass an 'executeSet' like:
`[
{statement: 'INSERT INTO MyTable(Field1, Field2, Field3) VALUES(?, ?, ?);', values: [ [1,2,3], [4,5,6], [7,8,9] ]},
{statement: 'INSERT INTO MyOtherTable(Field1, Field2, Field3) VALUES(?, ?, ?);', values: [ [11,12,13], [14,15,16], [17,18,19] ]}
]`
with someting like 10k values per table!

**To Reproduce**

1. Create a new project with Ioinic + Angular and use the `https://github.com/capacitor-community/sqlite` plugin
2. Configure it for Electron for windows 11 X64
3. Create a Table with at least 3 fields
4. Use the mehtod `executeSet(set: capSQLiteSet[], transaction?: boolean, returnMode?: string, isSQL92?: boolean): Promise;` and pass a values array with 10k values.
5. Execute the App and the mentioned method and the error appears.

**Expected behavior**
I expect the same behavior like `executeSet` method in Android platform (it works fast and perfect!!!)

**Screenshots**
![image](https://github.com/capacitor-community/electron/assets/102338437/bb0385ba-e735-40c1-8955-82e27992cf6e)

**Project Information:**
Capacitor: "@capacitor/core": "^5.0.0"
Plugins:

1. @capacitor-community/sqlite": "5.2.5"
2. @capacitor-community/electron": "5.0.1"
3. "electron": "^25.2.0"

Contributor guide

Open the contributing guide

Research direction

Start by reproducing executeSet on the Electron Windows configuration described, using the two INSERT statements with 10k values, and compare the behavior with Android. Trace the path that produces the undefined lastId; done means the Electron call completes without that error and matches the expected executeSet behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, sqlite, typescript
Domain
database, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.