aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Database/IDB/chapters.ts
blob: 56ac379bee6e88fa6e2b61d191ffddc258ff4d7d (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();