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

drop database does not work! #196

Open
juli4nm4ltenberger opened this issue Mar 28, 2020 · 3 comments
Open

drop database does not work! #196

juli4nm4ltenberger opened this issue Mar 28, 2020 · 3 comments

Comments

@juli4nm4ltenberger
Copy link

juli4nm4ltenberger commented Mar 28, 2020

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

@kuhlaid
Copy link

kuhlaid commented Apr 6, 2020

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.

@MuhammadFayed
Copy link

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

@jkt3000
Copy link

jkt3000 commented Dec 25, 2021

Any updates?

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

No branches or pull requests

4 participants