forked from drizzle-team/drizzle-orm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
defineConfig now accepts a promise for a config or function that returns one - fixes drizzle-team#1982
- Loading branch information
1 parent
1dd14ac
commit 78c7c13
Showing
4 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { test as brotest } from '@drizzle-team/brocli'; | ||
import { assert, expect, test } from 'vitest'; | ||
import { exportRaw } from '../src/cli/schema'; | ||
|
||
test('export with async config', async (t) => { | ||
const res = await brotest(exportRaw, ''); | ||
|
||
if (res.type !== 'handler') assert.fail(res.type, 'handler'); | ||
expect(res.options).toStrictEqual({ | ||
dialect: 'postgresql', | ||
schema: './schema.ts', | ||
sql: true, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineConfig } from '../../src'; | ||
|
||
export default defineConfig(async () => ({ | ||
schema: './schema.ts', | ||
dialect: 'postgresql', | ||
dbCredentials: { | ||
url: 'postgresql://postgres:[email protected]:5432/db', | ||
}, | ||
})); |