all repos — kōi @ b5de4391b4e6ac6d03170feb4108ea1b84312528

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})