diff --git a/src/db/DittoDB.ts b/src/db/DittoDB.ts new file mode 100644 index 0000000..e86b7e3 --- /dev/null +++ b/src/db/DittoDB.ts @@ -0,0 +1,17 @@ +import { Conf } from '@/config.ts'; +import { DittoSQLite } from '@/db/adapters/DittoSQLite.ts'; +import { DittoTables } from '@/db/DittoTables.ts'; +import { Kysely } from '@/deps.ts'; + +export class DittoDB { + static getInstance(): Promise> { + const { databaseUrl } = Conf; + + switch (databaseUrl.protocol) { + case 'sqlite:': + return DittoSQLite.getInstance(); + default: + throw new Error('Unsupported database URL.'); + } + } +} \ No newline at end of file