almost working
This commit is contained in:
parent
a07a71d92a
commit
8165994fde
7 changed files with 64 additions and 17 deletions
|
|
@ -37,6 +37,18 @@ export class QuestDBClient {
|
|||
...options,
|
||||
};
|
||||
|
||||
// Debug: log the received config
|
||||
console.log('DEBUG: QuestDB client constructor called with config:', {
|
||||
...config,
|
||||
user: config.user || '[NOT PROVIDED]',
|
||||
password: config.password ? '[PROVIDED]' : '[NOT PROVIDED]'
|
||||
});
|
||||
this.logger.debug('QuestDB client created with config:', {
|
||||
...config,
|
||||
user: config.user || '[NOT PROVIDED]',
|
||||
password: config.password ? '[PROVIDED]' : '[NOT PROVIDED]'
|
||||
});
|
||||
|
||||
this.healthMonitor = new QuestDBHealthMonitor(this);
|
||||
this.influxWriter = new QuestDBInfluxWriter(this);
|
||||
this.schemaManager = new QuestDBSchemaManager(this);
|
||||
|
|
@ -407,12 +419,10 @@ export class QuestDBClient {
|
|||
|
||||
|
||||
private buildPgPoolConfig(): any {
|
||||
return {
|
||||
const config: any = {
|
||||
host: this.config.host,
|
||||
port: this.config.pgPort,
|
||||
database: this.config.database,
|
||||
user: this.config.user,
|
||||
password: this.config.password,
|
||||
connectionTimeoutMillis: this.config.timeouts?.connection,
|
||||
query_timeout: this.config.timeouts?.request,
|
||||
ssl: this.config.tls?.enabled
|
||||
|
|
@ -423,6 +433,29 @@ export class QuestDBClient {
|
|||
min: 2,
|
||||
max: 10,
|
||||
};
|
||||
|
||||
// Only add user/password if they are provided
|
||||
if (this.config.user) {
|
||||
console.log('DEBUG: Adding user to QuestDB pool config:', this.config.user);
|
||||
this.logger.debug('Adding user to QuestDB pool config:', this.config.user);
|
||||
config.user = this.config.user;
|
||||
} else {
|
||||
console.log('DEBUG: No user provided for QuestDB connection');
|
||||
this.logger.debug('No user provided for QuestDB connection');
|
||||
}
|
||||
|
||||
if (this.config.password) {
|
||||
console.log('DEBUG: Adding password to QuestDB pool config');
|
||||
this.logger.debug('Adding password to QuestDB pool config');
|
||||
config.password = this.config.password;
|
||||
} else {
|
||||
console.log('DEBUG: No password provided for QuestDB connection');
|
||||
this.logger.debug('No password provided for QuestDB connection');
|
||||
}
|
||||
|
||||
console.log('DEBUG: Final QuestDB pool config:', { ...config, password: config.password ? '[REDACTED]' : undefined });
|
||||
this.logger.debug('Final QuestDB pool config:', { ...config, password: config.password ? '[REDACTED]' : undefined });
|
||||
return config;
|
||||
}
|
||||
|
||||
private mapDataType(typeId: number): string {
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ export class QuestDBSchemaManager {
|
|||
// Add designated timestamp
|
||||
const timestampColumn = schema.columns.find(col => col.designated);
|
||||
if (timestampColumn) {
|
||||
sql += ` timestamp(${timestampColumn.name})`;
|
||||
sql += ` TIMESTAMP(${timestampColumn.name})`;
|
||||
}
|
||||
|
||||
// Add partition by
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue