ujjwalguptaofficial / JsStore

Simplifying IndexedDB with SQL like syntax and promises
http://jsstore.net/
MIT License
858 stars 110 forks source link

Can't reset auto_increment field #314

Closed umersheikh-projectmarker closed 1 year ago

umersheikh-projectmarker commented 1 year ago

Summary

Clear() function does empty the table but a flag should be passed as parameter to reset the auto_increment sequence.

Basic example

await connection.clear(table_name, reset_auto_increment = false);

Motivation

I need to clear table's data as well as resetting auto increment so the field doesn't get overflow or impact performance due to bulk of data has been cleared.

ujjwalguptaofficial commented 1 year ago

Ok, by default it should reset the auto increment. Let me check and get back to you.

ujjwalguptaofficial commented 1 year ago

I checked auto increment is always reset to zero when clearing. I also added some test cases.

umersheikh-projectmarker commented 1 year ago

Let me check, why it is not working for me then. BTW, I am using "jsstore": "^4.5.0",.

ujjwalguptaofficial commented 1 year ago

yeah that's the latest version, please check and let me know.

ujjwalguptaofficial commented 1 year ago

closing, feel free to reopen if required.