aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Database/chapters.ts
blob: 0f77f0a028e12f4e7658ce45bf41391b14e869f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import Dexie, { type Table } from 'dexie';

export interface Chapter {
	id: number;
	chapters: number | null;
	volumes: number | null;
}

export class ChapterDatabase extends Dexie {
	chapters: Table<Chapter>;

	constructor() {
		super('chapters');
		this.version(1).stores({
			chapters: 'id, chapters, volumes'
		});

		this.chapters = this.table('chapters');
	}
}

export const database = new ChapterDatabase();