diff --git a/scripts/admin-event.ts b/scripts/admin-event.ts index a9939ad..29d3ae2 100644 --- a/scripts/admin-event.ts +++ b/scripts/admin-event.ts @@ -1,7 +1,7 @@ import { JsonParseStream } from '@std/json/json-parse-stream'; import { TextLineStream } from '@std/streams/text-line-stream'; -import { db } from '@/db.ts'; +import { DittoDB } from '@/db/DittoDB.ts'; import { AdminSigner } from '@/signers/AdminSigner.ts'; import { EventsDB } from '@/storages/events-db.ts'; import { type EventStub } from '@/utils/api.ts'; @@ -9,7 +9,8 @@ import { nostrNow } from '@/utils.ts'; const signer = new AdminSigner(); -const eventsDB = new EventsDB(db); +const kysely = await DittoDB.getInstance(); +const eventsDB = new EventsDB(kysely); const readable = Deno.stdin.readable .pipeThrough(new TextDecoderStream()) diff --git a/scripts/admin-role.ts b/scripts/admin-role.ts index 4fa212e..57a17e3 100644 --- a/scripts/admin-role.ts +++ b/scripts/admin-role.ts @@ -1,12 +1,13 @@ import { NSchema } from '@nostrify/nostrify'; -import { db } from '@/db.ts'; +import { DittoDB } from '@/db/DittoDB.ts'; import { Conf } from '@/config.ts'; import { AdminSigner } from '@/signers/AdminSigner.ts'; import { EventsDB } from '@/storages/events-db.ts'; import { nostrNow } from '@/utils.ts'; -const eventsDB = new EventsDB(db); +const kysely = await DittoDB.getInstance(); +const eventsDB = new EventsDB(kysely); const [pubkey, role] = Deno.args;