Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI table not created in Cordova #190

Open
bayssmekanique opened this issue Jan 22, 2020 · 0 comments
Open

AI table not created in Cordova #190

bayssmekanique opened this issue Jan 22, 2020 · 0 comments

Comments

@bayssmekanique
Copy link

bayssmekanique commented Jan 22, 2020

Which version are you using?
nano-sql/adapter-sqlite-cordova: 2.1.2
nano-sql/core: 2.3.7

Describe the bug
The Adapter-SQLite-Cordova package does not initialize the Automatic Increment table before creating a table which causes an error: sqlite3_prepare_v2 failure: no such table: _ai

Resolution
https://github.com/ClickSimply/Nano-SQL/blob/af74705e3fc4be6e65c0e4044f7dc7c5b745886c/packages/Adapter-SQLite-Cordova/src/index.ts#L51-L59

In the connect method call, rather than calling complete following the creation of the database, there should be a second call to create the _ai table using createAI as seen in other adapters.

https://github.com/ClickSimply/Nano-SQL/blob/c502a60735f77dd04fa5411197a9e7604c3174f2/packages/Adapter-SQLite3/src/index.ts#L46-L57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant