mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-29 08:11:06 +00:00
13 lines
443 B
TypeScript
13 lines
443 B
TypeScript
import type { ConnectionConfig } from "@/types/database";
|
|
|
|
export function resolveDefaultDatabase(connection: Pick<ConnectionConfig, "database">, options: string[]): string {
|
|
return connection.database || options[0] || "";
|
|
}
|
|
|
|
export function isDefaultDatabase(
|
|
connection: Pick<ConnectionConfig, "database"> | undefined,
|
|
database: string,
|
|
): boolean {
|
|
return !!connection?.database && !!database && connection.database === database;
|
|
}
|