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

drop database does not work!

Open juli4nm4ltenberger opened this issue 6 years ago • 3 comments

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

juli4nm4ltenberger avatar Mar 28 '20 07:03 juli4nm4ltenberger

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.

kuhlaid avatar Apr 06 '20 04:04 kuhlaid

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 () at eval (utilities.js?e239:569) at Array.map () at Object.exports.allAsync (utilities.js?e239:568) at _nanoSQLQuery._upsert (query.js?26b4:913) at eval (query.js?26b4:114) at requireQueryOpts (query.js?26b4:63) at new _nanoSQLQuery (query.js?26b4:113)

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

MuhammadFayed avatar Jul 14 '20 08:07 MuhammadFayed

Any updates?

johntajima avatar Dec 25 '21 20:12 johntajima