Documentation

DatabaseBootstrap

Database bootstrap utility class.

Provides static methods for establishing the database connection and initializing the required global state.

Tags
since
3.0.0

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:

  1. Loads configuration from .env
  2. Establishes the database connection
  3. Registers connection with Globals
  4. 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):

  1. .env file values (if file exists)
  2. Environment variables (for Docker deployments)
  3. Default values
Return values
array{server: string, userid: string, passwd: string, dbname: string, socket: string}

        
On this page

Search results