fix: remove db driver imports

This commit is contained in:
Bereket Engida
2024-10-01 17:59:13 +03:00
parent 0e46e5c3a0
commit 83f2cee4ec
2 changed files with 2 additions and 6 deletions

View File

@@ -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,
});

View File

@@ -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 {