Skip to content

Commit abffd3e

Browse files
committed
refactor: export drizzle config from package
1 parent e61709b commit abffd3e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/index.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,27 @@ import { drizzle } from 'drizzle-orm/libsql'
22

33
import { MASTER_DB } from './paths'
44
import relations from './relations'
5+
import * as schema from './schema'
6+
7+
export const defaultConfig = {
8+
casing: 'snake_case',
9+
relations,
10+
schema,
11+
} as const
12+
513

614
type Options = {
715
path?: string
816
}
917

1018
const createDatabaseClient = ({ path = MASTER_DB }: Options = {}) =>
1119
drizzle({
12-
relations,
13-
casing: 'snake_case',
20+
...defaultConfig,
1421
connection: {
1522
url: `file:${path}`,
1623
},
1724
})
1825

1926
export default createDatabaseClient
2027

21-
export * from './paths'
22-
export { relations }
28+
export * from './paths'

0 commit comments

Comments
 (0)