Skip to content

Commit 6b525bd

Browse files
committed
fix: align local database defaults
1 parent 0c6ee1e commit 6b525bd

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎drizzle.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ export default defineConfig({
1414
out: './drizzle/d1',
1515
dialect: 'sqlite',
1616
dbCredentials: {
17-
url: process.env.DATABASE_URL || 'file:data/local.db',
17+
url: process.env.DATABASE_URL || 'file:data/workspace.db',
1818
},
1919
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import assert from 'node:assert/strict';
2+
import { readFileSync } from 'node:fs';
3+
import test from 'node:test';
4+
5+
test('Drizzle and the runtime use the same default local SQLite database', () => {
6+
const runtimeConfig = readFileSync(
7+
new URL('./index.ts', import.meta.url),
8+
'utf8'
9+
);
10+
const drizzleConfig = readFileSync(
11+
new URL('../../drizzle.config.ts', import.meta.url),
12+
'utf8'
13+
);
14+
15+
assert.match(runtimeConfig, /file:data\/workspace\.db/);
16+
assert.match(drizzleConfig, /file:data\/workspace\.db/);
17+
assert.doesNotMatch(drizzleConfig, /file:data\/local\.db/);
18+
});

0 commit comments

Comments
 (0)