multibridge
Version:
A multi-database connection framework with centralized configuration
28 lines (27 loc) • 741 B
TypeScript
export interface SQLQuery {
type: "sql";
query: string;
params?: any[];
}
export interface MongoQuery {
type: "mongodb";
collection: string;
method: string;
args?: any[];
}
export interface CassandraQuery {
type: "cassandra";
query: string;
params?: any[];
}
export type Query = string | SQLQuery | MongoQuery | CassandraQuery | {
collection: string;
method: string;
args?: any[];
};
/**
* Executes a query using the connection determined by the tenant context.
* For PostgreSQL and MySQL, the native connection.query is used.
* For MongoDB and Cassandra, corresponding helper functions are invoked.
*/
export declare function executeQuery(query: Query, params?: any[]): Promise<any>;