mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-26 08:56:40 -05:00
fix: remove db driver imports
This commit is contained in:
@@ -6,8 +6,6 @@ import {
|
||||
SqliteDialect,
|
||||
} from "kysely";
|
||||
import type { BetterAuthOptions } from "../../types";
|
||||
import Database from "better-sqlite3";
|
||||
import { Pool as PostgresPool } from "pg";
|
||||
|
||||
export const createKyselyAdapter = async (config: BetterAuthOptions) => {
|
||||
const db = config.database;
|
||||
@@ -26,7 +24,7 @@ export const createKyselyAdapter = async (config: BetterAuthOptions) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (db instanceof Database) {
|
||||
if ("aggregate" in db) {
|
||||
dialect = new SqliteDialect({
|
||||
database: db,
|
||||
});
|
||||
@@ -40,7 +38,7 @@ export const createKyselyAdapter = async (config: BetterAuthOptions) => {
|
||||
databaseType = "mysql";
|
||||
}
|
||||
|
||||
if (db instanceof PostgresPool) {
|
||||
if ("connect" in db) {
|
||||
dialect = new PostgresDialect({
|
||||
pool: db,
|
||||
});
|
||||
|
||||
@@ -5,8 +5,6 @@ import type { OAuthProviderList } from "./provider";
|
||||
import type { SocialProviders } from "../social-providers";
|
||||
import type { RateLimit } from "./models";
|
||||
import type { Adapter } from "./adapter";
|
||||
import type Database from "better-sqlite3";
|
||||
import type { Pool } from "mysql2";
|
||||
import type { BetterSqlite3Database, MysqlPool } from "./database";
|
||||
|
||||
export interface BetterAuthOptions {
|
||||
|
||||
Reference in New Issue
Block a user