24 lines
No EOL
652 B
TypeScript
24 lines
No EOL
652 B
TypeScript
import { QuestDBClient } from './client';
|
|
import type { QuestDBClientConfig, QuestDBConnectionOptions } from './types';
|
|
|
|
/**
|
|
* Factory function to create a QuestDB client instance
|
|
*/
|
|
export function createQuestDBClient(
|
|
config: QuestDBClientConfig,
|
|
options?: QuestDBConnectionOptions
|
|
): QuestDBClient {
|
|
return new QuestDBClient(config, options);
|
|
}
|
|
|
|
/**
|
|
* Create and connect a QuestDB client
|
|
*/
|
|
export async function createAndConnectQuestDBClient(
|
|
config: QuestDBClientConfig,
|
|
options?: QuestDBConnectionOptions
|
|
): Promise<QuestDBClient> {
|
|
const client = createQuestDBClient(config, options);
|
|
await client.connect();
|
|
return client;
|
|
} |