David Fahlander

Results 557 comments of David Fahlander

If let's say you've released your app with db.version(1) and have changed your model so that a certain table is no more needed, you can explicitely drop the old table...

Yes you can open database without specifying version: ``` js new Dexie("dbname").open().then(db => { console.log (`Current version is: ${db.verno}`); }); ```

That doesn't work because this.version(3) will be executed before the database is opened. You should ideally bootstrap your app with: ``` js async function openDatabase() { var tempDb = await...

..or possibly the following: ``` ts class MyDb extends Dexie { projects: Dexie.Table; constructor() { super("MyDb"); } async init () => { await this.open(); if (this.verno < 3) { await...

Heads up that it's a highly prioritized task to improve the version handling in Dexie (See #287 and #105), and I'll take your use case into account when doing that....

Are you awaiting the init() Another question, is your current version 3 or 30?

I get the point. There's another solution that might work better: ``` ts class MyDb extends Dexie { constructor() { super("MyDb"); this.version(3).stores({ projects: "++id,client,project,start,end" }); let origOpen = this.open as...

Nice to hear. If you need to keep abreast of close() / reopen to work also, you must override close: ``` ts let origClose = this.close as any; (this as...

> @dfahlander Do you have any plans to implement it in near future? The quote refers to other already resolved issues. One of them was not marked as resolved but...

```ts const [id1, id2] = await db.yourTable.bulkAdd([ { foo: "bar" }, { foo: "baz" } ], { allKeys: true }); ``` ... assuming your db was declared something like: ```ts...