Update scripts for async db

This commit is contained in:
Alex Gleason 2024-05-14 18:51:35 -05:00
parent b4d48218b8
commit 3d1d56355d
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import { JsonParseStream } from '@std/json/json-parse-stream'; import { JsonParseStream } from '@std/json/json-parse-stream';
import { TextLineStream } from '@std/streams/text-line-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 { AdminSigner } from '@/signers/AdminSigner.ts';
import { EventsDB } from '@/storages/events-db.ts'; import { EventsDB } from '@/storages/events-db.ts';
import { type EventStub } from '@/utils/api.ts'; import { type EventStub } from '@/utils/api.ts';
@ -9,7 +9,8 @@ import { nostrNow } from '@/utils.ts';
const signer = new AdminSigner(); const signer = new AdminSigner();
const eventsDB = new EventsDB(db); const kysely = await DittoDB.getInstance();
const eventsDB = new EventsDB(kysely);
const readable = Deno.stdin.readable const readable = Deno.stdin.readable
.pipeThrough(new TextDecoderStream()) .pipeThrough(new TextDecoderStream())

View File

@ -1,12 +1,13 @@
import { NSchema } from '@nostrify/nostrify'; import { NSchema } from '@nostrify/nostrify';
import { db } from '@/db.ts'; import { DittoDB } from '@/db/DittoDB.ts';
import { Conf } from '@/config.ts'; import { Conf } from '@/config.ts';
import { AdminSigner } from '@/signers/AdminSigner.ts'; import { AdminSigner } from '@/signers/AdminSigner.ts';
import { EventsDB } from '@/storages/events-db.ts'; import { EventsDB } from '@/storages/events-db.ts';
import { nostrNow } from '@/utils.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; const [pubkey, role] = Deno.args;