UNPKG

multibridge

Version:

A multi-database connection framework with centralized configuration

32 lines (31 loc) 981 B
/** * Base utilities for ORM adapters */ import { getConnection } from "../connections/connectionManager"; import { ConnectVo } from "../context/tenantContext"; import { DBType, CentralDBConfig } from "../types/dbTypes"; /** * Get the current tenant context or throw if not available */ export declare function requireTenantContext(): ConnectVo; /** * Get connection data for the current tenant */ export declare function getTenantConnection(): Promise<{ tenant: ConnectVo; connectionData: Awaited<ReturnType<typeof getConnection>>; dbType: DBType; }>; /** * Get database configuration for the current tenant * This is useful for ORMs that need connection details */ export declare function getTenantDBConfig(): Promise<{ tenant: ConnectVo; dbConfig: CentralDBConfig; dbType: DBType; }>; /** * Validate that the database type is supported for the ORM */ export declare function validateORMSupport(dbType: DBType, supportedTypes: DBType[]): void;