mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-23 07:18:56 -05:00
fix: drizzle-adapter failing date transformation (#8289)
This commit is contained in:
@@ -671,10 +671,17 @@ export const drizzleAdapter = (db: DB, config: DrizzleAdapterConfig) => {
|
||||
? true
|
||||
: false,
|
||||
supportsArrays: config.provider === "pg" ? true : false,
|
||||
// not all providers support dates
|
||||
// one such example case is https://github.com/better-auth/better-auth/issues/7819
|
||||
// it's safe to set to `false` without checking for provider, because it it is dates the transformation doesn't apply anyway.
|
||||
supportsDates: false,
|
||||
customTransformOutput: ({ data, fieldAttributes }) => {
|
||||
// not all providers support dates
|
||||
// one such example case is https://github.com/better-auth/better-auth/issues/7819
|
||||
if (fieldAttributes.type === "date") {
|
||||
if (data === null || data === undefined) {
|
||||
return data;
|
||||
}
|
||||
return new Date(data);
|
||||
}
|
||||
return data;
|
||||
},
|
||||
transaction:
|
||||
(config.transaction ?? false)
|
||||
? (cb) =>
|
||||
|
||||
Reference in New Issue
Block a user