Can't use PostgreSQL with CodeIgniter4. It seems pgsql module is not installed.
bash-5.1$ php spark migrate
CodeIgniter v4.1.8 Command Line Tool - Server Time: 2022-02-14 18:24:13 UTC-06:00
Running all new migrations...
[CodeIgniter\Database\Exceptions\DatabaseException]
Unable to connect to the database.
Main connection [Postgre]: Call to undefined function CodeIgniter\Database\Postgre\pg_connect()
Kool version and environment
kool version 1.16.0
macOS 10.15.7
Kool Version 1.16.0
Kool Bin Path: /usr/local/bin/kool
Docker version 20.10.12, build e91ed57
Docker Bin Path: /usr/local/bin/docker
Docker Compose version v2.2.3
Docker Compose Bin Path: /usr/local/bin/docker-compose
Environment Variables of Interest:
KOOL_NAME=ci4-kool-postgres
KOOL_GLOBAL_NETWORK=kool_global
KOOL_ASUSER=501
To Reproduce
Setup codeigniter and PostgreSQL
Create a controller to connect to the database
<?php
namespace App\Controllers;
class Home extends BaseController
{
public function index()
{
$db = db_connect();
$db->query('select now()');
}
}
CodeIgniter\Database\Exceptions\DatabaseException #8
Unable to connect to the database.
Main connection [Postgre]: Call to undefined function CodeIgniter\Database\Postgre\pg_connect()
Describe the bug
Can't use PostgreSQL with CodeIgniter4. It seems pgsql module is not installed.
Kool version and environment
To Reproduce
You will see:
Expected behavior
Can connect to the database.