feat: add SQL Server support and refactor database layer for multi-database compatibility
- Add SqlServerService integration alongside existing MySQL support - Refactor DAOs (DiscreteMaterialPlanDAO, MaterialsToBeDeletedDAO, BipUsersDAO) to support both MySQL and SQL Server - Update validation handler to dynamically select database service based on DB_TYPE environment variable - Add connection pooling and proper connection management for SQL Server - Update package-lock.json dependency peer flags Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -98,8 +98,9 @@ export class SqlServerService {
|
||||
const result = await request.query(sqlString)
|
||||
|
||||
// Convert recordset to array of objects
|
||||
const columns = result.recordset.columns?.map((col) => col.name) || []
|
||||
const rows = result.recordset as Record<string, unknown>[]
|
||||
// Extract column names from the first row if available
|
||||
const columns = rows.length > 0 ? Object.keys(rows[0]) : []
|
||||
|
||||
return {
|
||||
rows,
|
||||
@@ -137,8 +138,9 @@ export class SqlServerService {
|
||||
const result = await request.query(sqlString)
|
||||
|
||||
// Convert recordset to array of objects
|
||||
const columns = result.recordset.columns?.map((col) => col.name) || []
|
||||
const rows = result.recordset as Record<string, unknown>[]
|
||||
// Extract column names from the first row if available
|
||||
const columns = rows.length > 0 ? Object.keys(rows[0]) : []
|
||||
|
||||
return {
|
||||
rows,
|
||||
|
||||
Reference in New Issue
Block a user