Update scripts for async db
This commit is contained in:
parent
b4d48218b8
commit
3d1d56355d
|
@ -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())
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue