🔥 CodeIgniter Intermediate

What is CI4's supported database drivers?

Answer

CodeIgniter 4 supports multiple database drivers through its Query Builder abstraction. MySQL/MariaDB: the most common choice, supported via MySQLi (default) or PDO. PostgreSQL: full support via the Postgre driver — good choice for complex queries, JSON operations, and full-text search. SQLite3: perfect for development, testing, and small applications with no separate database server. MSSQL (SQL Server): supported via PDO SQLSRV for Microsoft SQL Server databases. OCI8: for Oracle databases in enterprise environments. CUBRID: an open-source relational database. Configure in app/Config/Database.php: set $DBDriver to "MySQLi", "Postgre", "SQLite3", or "SQLSRV". The Query Builder generates database-appropriate SQL automatically — the same PHP code works across all supported drivers without modification.