Overview
The MTB Backend API supports three database clients: SQLite, MySQL, and PostgreSQL. Database configuration is managed through environment variables defined inconfig/database.ts.
Database Client Selection
Choose your database client using theDATABASE_CLIENT environment variable.
The database client to use. Supported values:
sqlite, mysql, postgresSQLite Configuration
SQLite is the default database client, ideal for development and testing.Environment Variables
The path to the SQLite database file, relative to the project root
SQLite is great for development but not recommended for production deployments with high traffic.
MySQL Configuration
MySQL requires connection credentials and supports SSL configuration.Connection Settings
MySQL server hostname or IP address
MySQL server port number
Name of the database to connect to
MySQL user for authentication
MySQL password for authentication
SSL Configuration
Enable SSL/TLS connection to the database
Path to SSL client key file
Path to SSL client certificate file
Path to SSL certificate authority file
Path to directory containing CA certificates
List of allowed SSL ciphers
Reject connections with invalid SSL certificates
Connection Pool
Minimum number of connections in the pool
Maximum number of connections in the pool
PostgreSQL Configuration
PostgreSQL supports both connection strings and individual parameters.Connection Settings
Full PostgreSQL connection string (alternative to individual parameters)
PostgreSQL server hostname or IP address
PostgreSQL server port number
Name of the database to connect to
PostgreSQL user for authentication
PostgreSQL password for authentication
PostgreSQL schema to use
SSL Configuration
PostgreSQL supports the same SSL configuration options as MySQL:Enable SSL/TLS connection to the database
Path to SSL client key file
Path to SSL client certificate file
Path to SSL certificate authority file
Path to directory containing CA certificates
List of allowed SSL ciphers
Reject connections with invalid SSL certificates
Connection Pool
Minimum number of connections in the pool
Maximum number of connections in the pool
Global Connection Settings
These settings apply to all database clients.Timeout in milliseconds for acquiring a connection from the pool
