mirror of
https://github.com/better-auth/better-auth.git
synced 2026-06-02 12:26:43 -05:00
update(kysley-adapter): Allow providing debug logs
This commit is contained in:
@@ -15,13 +15,14 @@ exports[`init > should match config 1`] = `
|
||||
"adapterConfig": {
|
||||
"adapterId": "kysely",
|
||||
"adapterName": "Kysely Adapter",
|
||||
"debugLogs": undefined,
|
||||
"debugLogs": false,
|
||||
"supportsBooleans": false,
|
||||
"supportsDates": false,
|
||||
"supportsJSON": false,
|
||||
"supportsNumericIds": true,
|
||||
"usePlural": undefined,
|
||||
},
|
||||
"debugLogs": false,
|
||||
"type": "sqlite",
|
||||
},
|
||||
"update": [Function],
|
||||
|
||||
@@ -30,6 +30,8 @@ export async function getAdapter(options: BetterAuthOptions): Promise<Adapter> {
|
||||
}
|
||||
return kyselyAdapter(kysely, {
|
||||
type: databaseType || "sqlite",
|
||||
debugLogs:
|
||||
"debugLogs" in options.database ? options.database.debugLogs : false,
|
||||
})(options);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import type { Database } from "better-sqlite3";
|
||||
import type { Logger } from "../utils";
|
||||
import type { AuthMiddleware } from "../plugins";
|
||||
import type { LiteralUnion, OmitId } from "./helper";
|
||||
import type { AdapterDebugLogs } from "../adapters";
|
||||
//@ts-ignore - we need to import this to get the type of the database
|
||||
import type { Database as BunDatabase } from "bun:sqlite";
|
||||
|
||||
@@ -92,6 +93,12 @@ export type BetterAuthOptions = {
|
||||
* @default "camel"
|
||||
*/
|
||||
casing?: "snake" | "camel";
|
||||
/**
|
||||
* Enable debug logs for the adapter
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
debugLogs?: AdapterDebugLogs;
|
||||
}
|
||||
| {
|
||||
/**
|
||||
@@ -108,6 +115,12 @@ export type BetterAuthOptions = {
|
||||
* @default "camel"
|
||||
*/
|
||||
casing?: "snake" | "camel";
|
||||
/**
|
||||
* Enable debug logs for the adapter
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
debugLogs?: AdapterDebugLogs;
|
||||
};
|
||||
/**
|
||||
* Secondary storage configuration
|
||||
|
||||
Reference in New Issue
Block a user