modified: backend/src/services/DatabasePoolManager.ts
modified: backend/src/services/ScriptExecutor.ts modified: backend/src/types/index.ts modified: frontend/src/components/CodeEditor.tsx modified: frontend/src/components/EndpointModal.tsx deleted: frontend/src/pages/Databases.tsx modified: frontend/src/pages/Settings.tsx modified: frontend/src/types/index.ts
This commit is contained in:
@@ -80,6 +80,38 @@ class DatabasePoolManager {
|
||||
return this.pools.get(databaseId);
|
||||
}
|
||||
|
||||
async getDatabaseConfig(databaseId: string): Promise<DatabaseConfig | null> {
|
||||
try {
|
||||
const result = await mainPool.query(
|
||||
'SELECT * FROM databases WHERE id = $1',
|
||||
[databaseId]
|
||||
);
|
||||
if (result.rows.length === 0) {
|
||||
return null;
|
||||
}
|
||||
const row = result.rows[0];
|
||||
return {
|
||||
id: row.id,
|
||||
name: row.name,
|
||||
type: row.type,
|
||||
host: row.host,
|
||||
port: row.port,
|
||||
database_name: row.database_name,
|
||||
username: row.username,
|
||||
password: row.password,
|
||||
ssl: row.ssl,
|
||||
is_active: row.is_active,
|
||||
aql_base_url: row.aql_base_url,
|
||||
aql_auth_type: row.aql_auth_type,
|
||||
aql_auth_value: row.aql_auth_value,
|
||||
aql_headers: row.aql_headers,
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('Error fetching database config:', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async getAllDatabaseConfigs(): Promise<DatabaseConfig[]> {
|
||||
try {
|
||||
const result = await mainPool.query(
|
||||
|
||||
Reference in New Issue
Block a user