huge refactor to remove depenencie hell and add typesafe container

This commit is contained in:
Boki 2025-06-24 09:37:51 -04:00
parent 28b9822d55
commit 843a7b9b9b
148 changed files with 3603 additions and 2378 deletions

View file

@ -95,7 +95,7 @@ export class MongoDBClient {
if (this.dynamicPoolConfig?.enabled) {
this.startPoolMonitoring();
}
return;
} catch (error) {
lastError = error as Error;
@ -108,7 +108,7 @@ export class MongoDBClient {
}
this.logger.error(`MongoDB connection attempt ${attempt} failed:`, error);
if (this.client) {
await this.client.close();
this.client = null;

View file

@ -442,15 +442,20 @@ export class PostgreSQLClient {
user: this.config.username,
passwordLength: this.config.password?.length,
passwordType: typeof this.config.password,
passwordValue: this.config.password ? `${this.config.password.substring(0, 3)}***` : 'NO_PASSWORD',
passwordValue: this.config.password
? `${this.config.password.substring(0, 3)}***`
: 'NO_PASSWORD',
});
const poolConfig = {
host: this.config.host,
port: this.config.port,
database: this.config.database,
user: this.config.username,
password: typeof this.config.password === 'string' ? this.config.password : String(this.config.password || ''),
password:
typeof this.config.password === 'string'
? this.config.password
: String(this.config.password || ''),
min: this.config.poolSettings?.min,
max: this.config.poolSettings?.max,
idleTimeoutMillis: this.config.poolSettings?.idleTimeoutMillis,
@ -465,7 +470,7 @@ export class PostgreSQLClient {
}
: false,
};
return poolConfig;
}

View file

@ -430,24 +430,19 @@ export class QuestDBClient {
// Only add user/password if they are provided
if (this.config.user) {
this.logger.debug('Adding user to QuestDB pool config:', this.config.user);
config.user = this.config.user;
} else {
this.logger.debug('No user provided for QuestDB connection');
}
if (this.config.password) {
this.logger.debug('Adding password to QuestDB pool config');
config.password = this.config.password;
} else {
this.logger.debug('No password provided for QuestDB connection');
}
this.logger.debug('Final QuestDB pool config:', {
...config,
password: config.password ? '[REDACTED]' : undefined,

View file

@ -39,7 +39,6 @@ export interface QuestDBConnectionOptions {
*/
export type QuestDBHealthStatus = 'healthy' | 'degraded' | 'unhealthy';
export interface QuestDBMetrics {
queriesPerSecond: number;
insertsPerSecond: number;