DatabaseBootstrap
in package
Database bootstrap utility class.
Provides static methods for establishing the database connection and initializing the required global state.
Tags
Table of Contents
Methods
- bootstrap() : void
- Bootstrap the database connection.
- loadConfiguration() : array{server: string, userid: string, passwd: string, dbname: string, socket: string}
- Load database configuration from .env file or environment variables.
Methods
bootstrap()
Bootstrap the database connection.
public
static bootstrap() : void
This method:
- Loads configuration from .env
- Establishes the database connection
- Registers connection with Globals
- Runs database migrations if needed
loadConfiguration()
Load database configuration from .env file or environment variables.
public
static loadConfiguration() : array{server: string, userid: string, passwd: string, dbname: string, socket: string}
Configuration sources (in order of priority):
- .env file values (if file exists)
- Environment variables (for Docker deployments)
- Default values