I was looking for a class that works with postgres but doesn't required to create and manage models. Only for transactions.
This class uses the PHP PDO connection, so you have to enable pdo_pgsql
in your php.ini. While I was writing this class I used PHP version 7.2. I recommend this version or a higher one.
It was my first commit to packagist so if some issues are encountered please let me know.
Class | Description |
---|---|
PostgreSQL |
PostgreSQL Class. |
$postgresql = new PostgreSQL('database', 'user', 'password', 'localhost', 5432);
Download latest release and extract it.
Either you include it with include_once (__DIR__ . '/classes/PostgreSQL.php);
or call a use for it use MaHarder\classes\PostgreSQL;
If you change the paths, so use the include
Run
composer require maharder/postgresql-orm
Now you can use the class