@db/sqlite, scoped_performance aliases

This commit is contained in:
Alex Gleason 2024-05-01 16:40:58 -05:00
parent 08ed52a57b
commit 7de5cdc18d
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
3 changed files with 6 additions and 6 deletions

View File

@ -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",

View File

@ -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';

View File

@ -1,18 +1,18 @@
/// <reference lib="webworker" />
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<R>({ sql, parameters }: CompiledQuery): QueryResult<R> {
if (!db) throw new Error('Database not open');