Skip to content

Commit 443215b

Browse files
committed
feat(db-sqlite): make drizzle casing configurable
1 parent 8ad22eb commit 443215b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: packages/db-sqlite/src/connect.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export const connect: Connect = async function connect(
2626
}
2727

2828
const logger = this.logger || false
29-
this.drizzle = drizzle(this.client, { logger, schema: this.schema })
29+
const casing = this.casing || 'snake_case'
30+
this.drizzle = drizzle(this.client, { casing, logger, schema: this.schema })
3031

3132
if (!hotReload) {
3233
if (process.env.PAYLOAD_DROP_DATABASE === 'true') {

Diff for: packages/db-sqlite/src/types.ts

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export type Args = {
5050
* To generate Drizzle schema from the database, see [Drizzle Kit introspection](https://orm.drizzle.team/kit-docs/commands#introspect--pull)
5151
*/
5252
beforeSchemaInit?: SQLiteSchemaHook[]
53+
casing?: DrizzleConfig['casing']
5354
client: Config
5455
/** Generated schema from payload generate:db-schema file path */
5556
generateSchemaOutputFile?: string
@@ -139,6 +140,7 @@ export type SQLiteAdapter = {
139140
afterSchemaInit: SQLiteSchemaHook[]
140141
autoIncrement: boolean
141142
beforeSchemaInit: SQLiteSchemaHook[]
143+
casing: DrizzleConfig['casing']
142144
client: Client
143145
clientConfig: Args['client']
144146
countDistinct: CountDistinct

0 commit comments

Comments
 (0)