aboutsummaryrefslogtreecommitdiff
path: root/src/lib/chapterDatabase.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-08-26 22:29:03 -0700
committerFuwn <[email protected]>2023-08-26 22:29:03 -0700
commitb89d0e7dada186e31be37e62a7a75efc2dbe9c99 (patch)
tree8c9f6b5d7aa0f709c06d5eb45fbf763883b21c89 /src/lib/chapterDatabase.ts
downloaddue.moe-b89d0e7dada186e31be37e62a7a75efc2dbe9c99.tar.xz
due.moe-b89d0e7dada186e31be37e62a7a75efc2dbe9c99.zip
feat: initial build
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();