drop database does not work!
Which version are you using? ^2.3.7
Describe the bug I have created a new database table “test” and I like to drop this table. I used the local storage to save the information. The database is existing and I can save and load information from it but when I try to remove the database after logout there is an error appearing “type error: table is undefined”. I don’t know why this error is appearing because I’m trying to remove the complete database. Usually, it doesn’t matter which tables are inside because I like to remove everything. I’m not sure if I did something wrong during initialization or if this is really a bug. I hope someone can help me to solve this problem. It is a little bit annoying because I only try to remove an existing database…
Expected behavior The database “test” is removed after executing command
Example
My create database command:
nSQL() .createDatabase({ id: DatabaseEnum.DATABASE_NAME, mode: DatabaseEnum.NANO_SQL_MODE, tables: [ { name: DatabaseEnum.TABLE_NAME_AUTH, model: { "id:uuid": {pk: true}, "key:string": {}, "value:string": {} } } ], version: DatabaseEnum.NANO_SQL_VERSION }) .then(() => { callBack(); }) .catch((exception) => { DialogUtil.openDialogWithComponent( container, DialogOneButtonComponent, ExceptionUtil.getHeading(exception).toUpperCase(), ExceptionUtil.getMessage(exception) ); });
My drop database command:
nSQL() .dropDatabase(DatabaseEnum.DATABASE_NAME) .then(() => { callBack(); }).catch((exception) => { DialogUtil.openDialogWithComponent( container, DialogOneButtonComponent, ExceptionUtil.getHeading(exception).toUpperCase(), ExceptionUtil.getMessage(exception) ); });
Constants: DATABASE_NAME = test NANO_SQL_MODE = LS TABLE_NAME_AUTH = authorization NANO_SQL_VERSION = 3
I am seeing the same problem with SQL mode LS or PERM. The create statement seems to work fine but not able to drop the database.
same issue here after calling nSQL().dropDatabase("db-name")
on Chrome
TypeError: Cannot read property 'pkCol' of undefined
at eval (query.js?26b4:914)
at eval (utilities.js?e239:570)
at new Promise (
on Firefox TypeError: table is undefined node_modules nano-sql/core/lib/query.js:914 node_modules nano-sql/core/lib/utilities.js:570 node_modules nano-sql/core/lib/utilities.js:569 node_modules nano-sql/core/lib/utilities.js:568 node_modules nano-sql/core/lib/query.js:913 node_modules nano-sql/core/lib/query.js:114 node_modules nano-sql/core/lib/query.js:63 node_modules nano-sql/core/lib/query.js:113 node_modules nano-sql/core/lib/index.js:821 node_modules nano-sql/core/lib/index.js:109 node_modules nano-sql/core/lib/index.js:830 node_modules nano-sql/core/lib/index.js:283 node_modules nano-sql/core/lib/index.js:282 node_modules nano-sql/core/lib/query.js:1858 node_modules nano-sql/core/lib/adapters/indexedDB.js:83
Any updates?