diff --git a/deno.json b/deno.json index 24bc364..ca05ab0 100644 --- a/deno.json +++ b/deno.json @@ -16,6 +16,7 @@ "imports": { "@/": "./src/", "@bradenmacdonald/s3-lite-client": "jsr:@bradenmacdonald/s3-lite-client@^0.7.4", + "@db/sqlite": "jsr:@db/sqlite@^0.11.1", "@isaacs/ttlcache": "npm:@isaacs/ttlcache@^1.4.1", "@noble/secp256k1": "npm:@noble/secp256k1@^2.0.0", "@nostrify/nostrify": "jsr:@nostrify/nostrify@^0.15.0", @@ -44,6 +45,7 @@ "nostr-relaypool": "npm:nostr-relaypool2@0.6.34", "nostr-tools": "npm:nostr-tools@^2.5.1", "nostr-wasm": "npm:nostr-wasm@^0.1.0", + "scoped_performance" :"https://deno.land/x/scoped_performance@v2.0.0/mod.ts", "tldts": "npm:tldts@^6.0.14", "tseep": "npm:tseep@^1.2.1", "type-fest": "npm:type-fest@^4.3.0", diff --git a/src/deps.ts b/src/deps.ts index 1672365..7a8fa9a 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -15,6 +15,4 @@ export { export { generateSeededRsa } from 'https://gitlab.com/soapbox-pub/seeded-rsa/-/raw/v1.0.0/mod.ts'; export { DB as Sqlite, - SqliteError, } from 'https://raw.githubusercontent.com/alexgleason/deno-sqlite/325f66d8c395e7f6f5ee78ebfa42a0eeea4a942b/mod.ts'; -export { Database as DenoSqlite3 } from 'https://deno.land/x/sqlite3@0.9.1/mod.ts'; diff --git a/src/workers/sqlite.worker.ts b/src/workers/sqlite.worker.ts index df9d6f0..a3ff1d6 100644 --- a/src/workers/sqlite.worker.ts +++ b/src/workers/sqlite.worker.ts @@ -1,18 +1,18 @@ /// -import { ScopedPerformance } from 'https://deno.land/x/scoped_performance@v2.0.0/mod.ts'; +import { Database as SQLite } from '@db/sqlite'; import { Stickynotes } from '@soapbox/stickynotes'; import * as Comlink from 'comlink'; import { CompiledQuery, QueryResult } from 'kysely'; +import { ScopedPerformance } from 'scoped_performance'; -import { DenoSqlite3 } from '@/deps.ts'; import '@/sentry.ts'; -let db: DenoSqlite3 | undefined; +let db: SQLite | undefined; const console = new Stickynotes('ditto:sqlite.worker'); export const SqliteWorker = { open(path: string): void { - db = new DenoSqlite3(path); + db = new SQLite(path); }, executeQuery({ sql, parameters }: CompiledQuery): QueryResult { if (!db) throw new Error('Database not open');