Handle database
This commit is contained in:
20
src/lib/catalog/db.ts
Normal file
20
src/lib/catalog/db.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { Volume } from '$lib/upload';
|
||||
import Dexie, { type Table } from 'dexie';
|
||||
|
||||
export interface Catalog {
|
||||
id?: number;
|
||||
manga: Volume[];
|
||||
}
|
||||
|
||||
export class CatalogDexie extends Dexie {
|
||||
catalog!: Table<Catalog>;
|
||||
|
||||
constructor() {
|
||||
super('mokuro');
|
||||
this.version(1).stores({
|
||||
catalog: '++id, manga'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const db = new CatalogDexie();
|
||||
Reference in New Issue
Block a user