mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
refactor(test.ts): explain why set DATABASE_URL to sqlite://:memory:
This commit is contained in:
parent
1af229da45
commit
7e965f4ade
1 changed files with 4 additions and 2 deletions
|
|
@ -96,7 +96,10 @@ export const createTestDB = async (databaseUrl?: string) => {
|
|||
let kysely: Kysely<DittoTables>;
|
||||
|
||||
if (dialect === 'sqlite') {
|
||||
Deno.env.set('DATABASE_URL', 'sqlite://:memory:'); // hack, refactor all, 021 migration
|
||||
// migration 021_pgfts_index.ts calls 'Conf.db.dialect',
|
||||
// and this calls the DATABASE_URL environment variable.
|
||||
// The following line ensures to NOT use the DATABASE_URL that may exist in an .env file.
|
||||
Deno.env.set('DATABASE_URL', 'sqlite://:memory:');
|
||||
|
||||
kysely = new Kysely<DittoTables>({
|
||||
dialect: new DenoSqlite3Dialect({
|
||||
|
|
@ -104,7 +107,6 @@ export const createTestDB = async (databaseUrl?: string) => {
|
|||
}),
|
||||
});
|
||||
} else {
|
||||
//kysely = await DittoDB.getInstance();
|
||||
kysely = new Kysely({
|
||||
dialect: {
|
||||
createAdapter() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue