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

Error on drop database and table #192

Open
gsustalo opened this issue Jan 23, 2020 · 5 comments
Open

Error on drop database and table #192

gsustalo opened this issue Jan 23, 2020 · 5 comments

Comments

@gsustalo
Copy link

@gsustalo gsustalo commented Jan 23, 2020

Which version are you using?
2.3.7

Describe the bug
Dropping tables always return next error:

core.js:9110 ERROR Error: Uncaught (in promise): TypeError: Cannot set property 'count' of undefined

Dropping databases always return next error:

Error: TypeError: Cannot read property 'pkCol' of undefined

Tables are not dropped really in IndexedDB storage. Wherever, when query 'show tables' is submmited, this tables don't are returned

Example
nSQL().dropDatabase("my_db").then(() => { // never }).catch(() => { // ALWAYS!! })

    nSQL('users')
      .query('drop')
      .exec()
      .then(() => {
    // never
}).catch(() => {
    // ALWAYS!! 
})`
@m11m
Copy link

@m11m m11m commented Feb 3, 2020

I've seen something similar.

Which adapter (or value of mode in db config) are you using?

@gsustalo
Copy link
Author

@gsustalo gsustalo commented Feb 4, 2020

I'm using 'PERM' mode.
Just like in:
https://nanosql.io/databases.html#creating-a-database

@patowazhir
Copy link

@patowazhir patowazhir commented Feb 7, 2020

Hi! Did you get any far with this? I'm using 'TEMP' and seeing it as well.

@patowazhir
Copy link

@patowazhir patowazhir commented Feb 7, 2020

To be more specific, seeing it when dropping a table:
await nSQL(this.tableName).query('drop').exec();

@nevf
Copy link

@nevf nevf commented Feb 16, 2020

Update: Ok I've had a closer look at my code and I'm not actually using 'drop' after all because it didn't (possibly still doesn't) delete indexes. I'm using 'delete' instead to delete all rows in the table.
++++
No problems using 'drop' in my application.
result = await nSQL( this.dbTableName )).query( 'drop' ).exec()

You could try rebuilding indexes.
const result = await nSQL( this.dbTableName ).query( 'rebuild indexes' ).exec()

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.