mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-30 16:21:39 +00:00
18 lines
600 B
TypeScript
18 lines
600 B
TypeScript
import type { DatabaseType } from "@/types/database";
|
|
import { supportsDriverManagement } from "./databaseCapabilities";
|
|
|
|
export interface AgentDriverInstallState {
|
|
db_type: string;
|
|
installed: boolean;
|
|
}
|
|
|
|
export function showAgentDriverInstallHint(
|
|
dbType: DatabaseType | undefined,
|
|
drivers: readonly AgentDriverInstallState[],
|
|
driverProfile?: string,
|
|
): boolean {
|
|
if (!supportsDriverManagement(dbType)) return false;
|
|
const driverKey = dbType === "oracle" && driverProfile ? driverProfile : dbType;
|
|
return drivers.find((driver) => driver.db_type === driverKey)?.installed !== true;
|
|
}
|