aboutsummaryrefslogtreecommitdiff
path: root/src/lib/chapterDatabase.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/chapterDatabase.ts')
-rw-r--r--src/lib/chapterDatabase.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/chapterDatabase.ts b/src/lib/chapterDatabase.ts
new file mode 100644
index 00000000..d580e6fa
--- /dev/null
+++ b/src/lib/chapterDatabase.ts
@@ -0,0 +1,21 @@
+import Dexie, { type Table } from 'dexie';
+
+export interface Chapter {
+ id: number;
+ chapters: number | null;
+}
+
+export class ChapterDatabase extends Dexie {
+ chapters: Table<Chapter>;
+
+ constructor() {
+ super('chapterDatabase');
+ this.version(1).stores({
+ chapters: 'id, chapters'
+ });
+
+ this.chapters = this.table('chapters');
+ }
+}
+
+export const chapterDatabase = new ChapterDatabase();