UI styling improvements: dashboard headers and navigation
- Restore blue PageHeader on Dashboard (/app-components) - Update homepage (/) with subtle header design without blue bar - Add uniform PageHeader styling to application edit page - Fix Rapporten link on homepage to point to /reports overview - Improve header descriptions spacing for better readability
This commit is contained in:
28
backend/src/services/database/singleton.ts
Normal file
28
backend/src/services/database/singleton.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Database Adapter Singleton
|
||||
*
|
||||
* Provides a shared database adapter instance to prevent multiple connections.
|
||||
* All services should use this singleton instead of creating their own adapters.
|
||||
*/
|
||||
|
||||
import { createDatabaseAdapter } from './factory.js';
|
||||
import type { DatabaseAdapter } from './interface.js';
|
||||
|
||||
let dbAdapterInstance: DatabaseAdapter | null = null;
|
||||
|
||||
/**
|
||||
* Get the shared database adapter instance
|
||||
*/
|
||||
export function getDatabaseAdapter(): DatabaseAdapter {
|
||||
if (!dbAdapterInstance) {
|
||||
dbAdapterInstance = createDatabaseAdapter(undefined, undefined, false); // Don't allow close (singleton)
|
||||
}
|
||||
return dbAdapterInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the singleton (for testing only)
|
||||
*/
|
||||
export function resetDatabaseAdapter(): void {
|
||||
dbAdapterInstance = null;
|
||||
}
|
||||
Reference in New Issue
Block a user