mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
22 lines
744 B
TypeScript
22 lines
744 B
TypeScript
import { DittoConf } from '@ditto/conf';
|
|
|
|
import { DittoPostgres } from './DittoPostgres.ts';
|
|
|
|
const conf = new DittoConf(Deno.env);
|
|
const isPostgres = /^postgres(?:ql)?:/.test(conf.databaseUrl);
|
|
|
|
Deno.test('DittoPostgres', { ignore: !isPostgres }, async () => {
|
|
await using db = new DittoPostgres(conf.databaseUrl);
|
|
await db.migrate();
|
|
});
|
|
|
|
// FIXME: There is a problem with postgres-js where queries just hang after the database is closed.
|
|
|
|
// Deno.test('DittoPostgres query after closing', { ignore: !isPostgres }, async () => {
|
|
// const db = new DittoPostgres(conf.databaseUrl);
|
|
// await db[Symbol.asyncDispose]();
|
|
//
|
|
// await assertRejects(
|
|
// () => db.kysely.selectFrom('nostr_events').selectAll().execute(),
|
|
// );
|
|
// });
|