Switch main database to Deno SQLite3
This commit is contained in:
parent
6c2c9541be
commit
451b77d6c4
10
deno.json
10
deno.json
|
@ -2,12 +2,12 @@
|
|||
"$schema": "https://deno.land/x/deno@v1.32.3/cli/schemas/config-file.v1.json",
|
||||
"lock": false,
|
||||
"tasks": {
|
||||
"start": "deno run --allow-read --allow-write=data --allow-env --allow-net --allow-sys src/server.ts",
|
||||
"dev": "deno run --allow-read --allow-write=data --allow-env --allow-net --allow-sys --watch src/server.ts",
|
||||
"debug": "deno run --allow-read --allow-write=data --allow-env --allow-net --allow-sys --inspect src/server.ts",
|
||||
"test": "DB_PATH=\":memory:\" deno test --allow-read --allow-write=data --allow-env src",
|
||||
"start": "deno run -A --unstable src/server.ts",
|
||||
"dev": "deno run -A --unstable --watch src/server.ts",
|
||||
"debug": "deno run -A --unstable --inspect src/server.ts",
|
||||
"test": "DB_PATH=\":memory:\" deno test -A --unstable src",
|
||||
"check": "deno check src/server.ts",
|
||||
"relays:sync": "deno run -A scripts/relays.ts sync"
|
||||
"relays:sync": "deno run -A --unstable scripts/relays.ts sync"
|
||||
},
|
||||
"imports": {
|
||||
"@/": "./src/",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
|
||||
import { DenoSqliteDialect, FileMigrationProvider, Kysely, Migrator, Sqlite } from '@/deps.ts';
|
||||
import { DenoSqlite3, DenoSqliteDialect, FileMigrationProvider, Kysely, Migrator } from '@/deps.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
|
||||
interface DittoDB {
|
||||
|
@ -57,7 +57,7 @@ interface UnattachedMediaRow {
|
|||
|
||||
const db = new Kysely<DittoDB>({
|
||||
dialect: new DenoSqliteDialect({
|
||||
database: new Sqlite(Conf.dbPath),
|
||||
database: new DenoSqlite3(Conf.dbPath),
|
||||
}),
|
||||
});
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ 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';
|
||||
export * as dotenv from 'https://deno.land/std@0.198.0/dotenv/mod.ts';
|
||||
export {
|
||||
FileMigrationProvider,
|
||||
|
@ -65,7 +66,7 @@ export {
|
|||
type NullableInsertKeys,
|
||||
sql,
|
||||
} from 'npm:kysely@^0.25.0';
|
||||
export { DenoSqliteDialect } from 'https://gitlab.com/soapbox-pub/kysely-deno-sqlite/-/raw/v1.0.1/mod.ts';
|
||||
export { DenoSqliteDialect } from 'https://gitlab.com/soapbox-pub/kysely-deno-sqlite/-/raw/v1.1.0/mod.ts';
|
||||
export { default as tldts } from 'npm:tldts@^6.0.14';
|
||||
export * as cron from 'https://deno.land/x/deno_cron@v1.0.0/cron.ts';
|
||||
export { S3Client } from 'https://deno.land/x/s3_lite_client@0.6.1/mod.ts';
|
||||
|
|
Loading…
Reference in New Issue