aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Database/IDB/user.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-08-24 02:38:40 -0700
committerFuwn <[email protected]>2024-08-24 02:42:01 -0700
commit32c7545faae4f33c94a045408789c9b9ef7de53a (patch)
tree3ce6632bd710b4453749f0e71186027683415843 /src/lib/Database/IDB/user.ts
parentfeat(SequelCatcher): side stories toggle (diff)
downloaddue.moe-32c7545faae4f33c94a045408789c9b9ef7de53a.tar.xz
due.moe-32c7545faae4f33c94a045408789c9b9ef7de53a.zip
refactor(Data): rename database references
Diffstat (limited to 'src/lib/Database/IDB/user.ts')
-rw-r--r--src/lib/Database/IDB/user.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/Database/IDB/user.ts b/src/lib/Database/IDB/user.ts
new file mode 100644
index 00000000..e7285a07
--- /dev/null
+++ b/src/lib/Database/IDB/user.ts
@@ -0,0 +1,23 @@
+import type { AniListAuthorisation } from '$lib/Data/AniList/identity';
+import Dexie, { type Table } from 'dexie';
+
+export interface User {
+ id: number;
+ user: AniListAuthorisation;
+ lastNotificationID: number | null;
+}
+
+export class UserDatabase extends Dexie {
+ users: Table<User>;
+
+ constructor() {
+ super('users');
+ this.version(1).stores({
+ users: 'id, user, lastNotificationID'
+ });
+
+ this.users = this.table('users');
+ }
+}
+
+export const database = new UserDatabase();