Commit c875cf15 authored by Aral Balkan's avatar Aral Balkan

Delete database before start

parent 90caa25d
......@@ -32,12 +32,15 @@ function displayDurationFor (taskName) {
}
// Test Dexie
const db = new Dexie('hellodb')
db.version(1).stores({
tasks: '++id,date,description,done'
})
async function start () {
// Start with a fresh database each time
await Dexie.delete('hellodb')
const db = new Dexie('hellodb')
db.version(1).stores({
tasks: '++id,date,description,done'
})
const numInserts = 10000
const inserts = []
for (let i = 0; i < numInserts; i++) {
......@@ -58,7 +61,7 @@ async function start () {
// Select by primary key
resetTimer()
const selectByPrimaryKey = await db.tasks.get(5000)
const selectByPrimaryKey = await db.tasks.get(5000) // eslint-disable-line no-unused-vars
displayDurationFor('Select by primary key')
// Between
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment