refactoring to remove a lot of junk
This commit is contained in:
parent
5318158e59
commit
d858222af7
33 changed files with 505 additions and 367 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue