modified: backend/src/controllers/databaseManagementController.ts

modified:   backend/src/controllers/schemaController.ts
	modified:   frontend/src/pages/DatabaseSchema.tsx
This commit is contained in:
2026-01-28 00:00:15 +03:00
parent c780979b57
commit 4fb92470ce
3 changed files with 39 additions and 11 deletions

View File

@@ -2,6 +2,7 @@ import { Response } from 'express';
import { AuthRequest } from '../middleware/auth';
import { mainPool } from '../config/database';
import { databasePoolManager } from '../services/DatabasePoolManager';
import { generateSchemaForDatabase } from './schemaController';
// Только админы могут управлять базами данных
export const getDatabases = async (req: AuthRequest, res: Response) => {
@@ -92,6 +93,13 @@ export const createDatabase = async (req: AuthRequest, res: Response) => {
// Добавить пул подключений (только для не-AQL баз)
if (dbType !== 'aql') {
await databasePoolManager.reloadPool(newDb.id);
// Generate schema in background for PostgreSQL databases
if (dbType === 'postgresql') {
generateSchemaForDatabase(newDb.id).catch(err => {
console.error('Background schema generation failed:', err.message);
});
}
}
// Не возвращаем пароль