mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Experiment: try switching to deno-sqlite3
This commit is contained in:
parent
a0ebd80c7e
commit
49b056a4bd
3 changed files with 9 additions and 6 deletions
|
|
@ -2,9 +2,9 @@
|
||||||
"$schema": "https://deno.land/x/deno@v1.32.3/cli/schemas/config-file.v1.json",
|
"$schema": "https://deno.land/x/deno@v1.32.3/cli/schemas/config-file.v1.json",
|
||||||
"lock": false,
|
"lock": false,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run --allow-read --allow-write=data --allow-env --allow-net --allow-sys src/server.ts",
|
"start": "deno run -A --unstable src/server.ts",
|
||||||
"dev": "deno run --allow-read --allow-write=data --allow-env --allow-net --allow-sys --watch src/server.ts",
|
"dev": "deno run -A --unstable --watch src/server.ts",
|
||||||
"debug": "deno run --allow-read --allow-write=data --allow-env --allow-net --allow-sys --inspect src/server.ts",
|
"debug": "deno run -A --unstable --inspect src/server.ts",
|
||||||
"test": "DB_PATH=\":memory:\" deno test --allow-read --allow-write=data --allow-env src",
|
"test": "DB_PATH=\":memory:\" deno test --allow-read --allow-write=data --allow-env src",
|
||||||
"check": "deno check src/server.ts",
|
"check": "deno check src/server.ts",
|
||||||
"relays:sync": "deno run -A scripts/relays.ts sync"
|
"relays:sync": "deno run -A scripts/relays.ts sync"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import fs from 'node:fs/promises';
|
import fs from 'node:fs/promises';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
|
|
||||||
import { DenoSqliteDialect, FileMigrationProvider, Kysely, Migrator, Sqlite } from '@/deps.ts';
|
import { DenoSqlite3Dialect, FileMigrationProvider, Kysely, Migrator, Sqlite, DenoSqlite3 } from '@/deps.ts';
|
||||||
import { Conf } from '@/config.ts';
|
import { Conf } from '@/config.ts';
|
||||||
|
|
||||||
interface DittoDB {
|
interface DittoDB {
|
||||||
|
|
@ -56,8 +56,8 @@ interface UnattachedMediaRow {
|
||||||
}
|
}
|
||||||
|
|
||||||
const db = new Kysely<DittoDB>({
|
const db = new Kysely<DittoDB>({
|
||||||
dialect: new DenoSqliteDialect({
|
dialect: new DenoSqlite3Dialect({
|
||||||
database: new Sqlite(Conf.dbPath),
|
database: new DenoSqlite3(Conf.dbPath),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,4 +75,7 @@ export { Machina } from 'https://gitlab.com/soapbox-pub/nostr-machina/-/raw/08a1
|
||||||
export * as Sentry from 'npm:@sentry/node@^7.73.0';
|
export * as Sentry from 'npm:@sentry/node@^7.73.0';
|
||||||
export { sentry as sentryMiddleware } from 'npm:@hono/sentry@^1.0.0';
|
export { sentry as sentryMiddleware } from 'npm:@hono/sentry@^1.0.0';
|
||||||
|
|
||||||
|
export { Database as DenoSqlite3 } from 'https://deno.land/x/sqlite3@0.9.1/mod.ts';
|
||||||
|
export { DenoSqlite3Dialect } from 'https://gitlab.com/soapbox-pub/kysely-deno-sqlite/-/raw/820e58295b70a18086622f25fc3572887d3d4c1b/mod.ts';
|
||||||
|
|
||||||
export type * as TypeFest from 'npm:type-fest@^4.3.0';
|
export type * as TypeFest from 'npm:type-fest@^4.3.0';
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue