all repos — kōi @ 06d6c343bb7f758261d0ed471cf4711ef5310723

Minimalist task manager

src/lib/db.ts (view raw)

 1import Dexie, { type EntityTable } from 'dexie'
 2
 3export const db = new Dexie('tasks') as Dexie & {
 4    tasks: EntityTable<Task, 'id'>
 5}
 6
 7db.version(1).stores({
 8  tasks: '++id, content, done, dueDate'
 9})
10
11db.open().catch(err => {
12  console.error('Failed to open db: ' + err.stack)
13})