Nano-SQL icon indicating copy to clipboard operation
Nano-SQL copied to clipboard

AI table not created in Cordova

Open nerdoza opened this issue 6 years ago • 0 comments

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

nerdoza avatar Jan 22 '20 20:01 nerdoza