PHPackages                             seinopsys/postgresql-database-class - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. seinopsys/postgresql-database-class

ActiveLibrary[Database &amp; ORM](/categories/database)

seinopsys/postgresql-database-class
===================================

PHP wrapper class for PDO-based interaction with PostgreSQL databases, heavily based on ThingEngineer's MysqliDb class

v3.1.1(6y ago)354.9k—0%231GPL-3.0-or-laterPHPPHP &gt;=5.4

Since Apr 14Pushed 6y ago6 watchersCompare

[ Source](https://github.com/SeinopSys/PHP-PostgreSQL-Database-Class)[ Packagist](https://packagist.org/packages/seinopsys/postgresql-database-class)[ RSS](/packages/seinopsys-postgresql-database-class/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (16)Used By (1)

PostgresDb [![Build Status](https://camo.githubusercontent.com/5abc2d88f0da9425fda31278f8ae3f02e14067db312e8c301af4dfdc5b847373/68747470733a2f2f7472617669732d63692e6f72672f5365696e6f705379732f5048502d506f737467726553514c2d44617461626173652d436c6173732e737667)](https://travis-ci.org/SeinopSys/PHP-PostgreSQL-Database-Class) [![Latest Stable Version](https://camo.githubusercontent.com/4f8280ffb029c3bc275973f6c6b471c2ba5a0acf502dbd9dcf24831c803f6083/68747470733a2f2f706f7365722e707567782e6f72672f7365696e6f707379732f706f737467726573716c2d64617461626173652d636c6173732f762f737461626c65)](https://packagist.org/packages/seinopsys/postgresql-database-class) [![Total Downloads](https://camo.githubusercontent.com/473dce08eed49dcfe3222b8572cac91de97d99995ff6cc85c6fcc5281ae2e9da/68747470733a2f2f706f7365722e707567782e6f72672f7365696e6f707379732f706f737467726573716c2d64617461626173652d636c6173732f646f776e6c6f616473)](https://packagist.org/packages/seinopsys/postgresql-database-class) [![License](https://camo.githubusercontent.com/7400da44c8f76277089a9f5b0b9f2228fc07da0ee580caab9b188dfbbea04de9/68747470733a2f2f706f7365722e707567782e6f72672f7365696e6f707379732f706f737467726573716c2d64617461626173652d636c6173732f6c6963656e7365)](https://packagist.org/packages/seinopsys/postgresql-database-class)
================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#postgresdb----)

This project is a PostgreSQL version of [ThingEngineer](https://github.com/ThingEngineer)'s [MysqliDb Class](https://github.com/ThingEngineer/PHP-MySQLi-Database-Class), that supports the basic functionality and syntax provided by said class, tailored specifically to PostgreSQL.

Installation
------------

[](#installation)

This class requires PHP 5.4+ or 7+ to work. You can either place the `src/PostgresDb.php` in your project and require/include it, or use [Composer](https://getcomposer.org) (strongly recommended)

```
composer require seinopsys/postgresql-database-class:^3.0

```

Usage
-----

[](#usage)

```
$db = new \SeinopSys\PostgresDb($database_name, $host, $username, $password);
```

For a more in-depth guide see [USAGE.md](USAGE.md)

Upgrading from `2.x`
--------------------

[](#upgrading-from-2x)

1. **Removed deprecated methods**

    These methods were deprecated in version `2.x` and have been removed in `3.x`. Use the renamed variants as indicated below:

    `2.x``3.x``$db->rawQuery(…);``$db->query(…);``$db->rawQuerySingle(…);``$db->querySingle(…);``$db->pdo();``$db->getConnection();`
2. **Namespace change**

    As of `3.x` - to comply fully with the PSR-2 coding standard - the class now resides in the `SeinopSys` namespace. Here's a handy table to show what you need to change and how:

    `2.x``3.x``$db = new PostgresDb(…);``$db = new \SeinopSys\PostgresDb(…);``$db = new \PostgresDb(…);``$db = new \SeinopSys\PostgresDb(…);````
    use \PostgresDb;$db = new PostgresDb(…);
    ```

    ```
    use \SeinopSys\PostgresDb;$db = new PostgresDb(…);
    ```
3. **Internal code structure changes**

    As of `3.x` all `private`/`protected` methods and properties have dropped the `_` prefix, so be sure to update your wrapper class (if you use one).

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~55 days

Recently: every ~73 days

Total

15

Last Release

2549d ago

Major Versions

v1.1.1 → v2.0.32017-07-17

v2.2.0 → v3.0.02018-10-03

PHP version history (3 changes)v1.0.0PHP &gt;=5.6.0

v2.0.3PHP &gt;=5.6

v2.0.8PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2d904f9a314dc9caef5c1e791eca27050d31c0fb63d3b027e9a106f0b6e4da7?d=identicon)[SeinopSys](/maintainers/SeinopSys)

---

Top Contributors

[![SeinopSys](https://avatars.githubusercontent.com/u/3200580?v=4)](https://github.com/SeinopSys "SeinopSys (72 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/seinopsys-postgresql-database-class/health.svg)

```
[![Health](https://phpackages.com/badges/seinopsys-postgresql-database-class/health.svg)](https://phpackages.com/packages/seinopsys-postgresql-database-class)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
