PostgreSQL driver for FuelPHP

Some kind of intro

I’m currently writing a web app using FuelPHP and hosted this on my web host.
However, I wanted to experiment with web application in the cloud. And I thought of Heroku.

Seeing as how Heroku was free for starting developers, I thought I’d give it a go!
Heroku, by default, gives you a PostgreSQL server that you can use. To be honest, I’ve never used PostgreSQL before, but I read about it. Did some research and decided to try it out in combination with FuelPHP.

FuelPHP can use a PostgreSQL by default, but it uses PDO, so you’re limited to basic database stuff. However if you want to use (more advanced) PostgreSQL specific features, you need a native PostgreSQL driver. Thankfully, someone else had already created one.

Here is the original code: However, his code requires you to “paste” the code in the core functionality of FuelPHP. That’s not how we do things around here. Doing some research ( I thought it would be best to create a package for the native PostgreSQL driver that extends the original FuelPHP core. That way, you can simply load it from the configuration file and you won’t have any trouble when upgrading your FuelPHP core. (Unless FuelPHP makes some drastic changes.)

The actual package

It’s on GitHub, so feel free to contribute!


How to install

  1. Clone this repository
  2. Copy the “fuel-pgsql” folder to Fuel’s package folder
  3. Enable the package in the configuration file
  4. Edit your database configuration to use the PostgreSQL driver ('type' => 'pgsql')

Michiel De Mey

Full-time geek, Full Stack Engineer and Full Metal Hero. NodeJs, AngularJs, API design, WebSockets, WebSec & IoT enthusiast. Former San Francisco resident.

More Posts - Website - Twitter - Facebook - LinkedIn - Google Plus