What is CI4's supported database drivers?
Why Interviewers Ask This
Candidates at the intermediate level are expected to not only know this concept but explain the trade-offs involved. Interviewers use this question to see if you can reason about design decisions, not just recall facts.
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.
Common Mistake
Many candidates answer correctly but can't explain the 'why'. Always be prepared to justify your answer with a concrete example or use case from your CodeIgniter experience.
Previous
What is CI4 route filters with arguments?
Next
What is CI4 model findAll() with conditions?