refactoring to remove a lot of junk

This commit is contained in:
Boki 2025-06-22 16:57:08 -04:00
parent 5318158e59
commit d858222af7
33 changed files with 505 additions and 367 deletions

View file

@ -1,29 +0,0 @@
import { PostgreSQLClient } from './client';
import type { PostgreSQLClientConfig, PostgreSQLConnectionOptions, ConnectionEvents } from './types';
/**
* Factory function to create a PostgreSQL client instance
*/
export function createPostgreSQLClient(
config: PostgreSQLClientConfig,
logger?: any,
options?: PostgreSQLConnectionOptions,
events?: ConnectionEvents
): PostgreSQLClient {
return new PostgreSQLClient(config, logger, options, events);
}
/**
* Create and connect a PostgreSQL client
*/
export async function createAndConnectPostgreSQLClient(
config: PostgreSQLClientConfig,
logger?: any,
options?: PostgreSQLConnectionOptions,
events?: ConnectionEvents
): Promise<PostgreSQLClient> {
const client = createPostgreSQLClient(config, logger, options, events);
await client.connect();
return client;
}

View file

@ -33,10 +33,5 @@ export type {
DynamicPoolConfig,
} from './types';
// Factory functions
export {
createPostgreSQLClient,
createAndConnectPostgreSQLClient,
} from './factory';
// Singleton pattern removed - use factory functions instead
// Note: Factory functions removed - instantiate directly with new PostgreSQLClient()
// or use the Awilix DI container (recommended)