PHPackages                             programster/pgsql-objects - 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. programster/pgsql-objects

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

programster/pgsql-objects
=========================

A library for interfacing with a PostgreSQL database in PHP. Facilitates the creation of objects that represents tables tables. Objects must have id of type UUID.

3.0.6(1mo ago)01.4k↓82.1%[2 issues](https://github.com/programster/package-pgsql-objects/issues)MITPHPPHP &gt;=8.2.0

Since Jul 4Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/programster/package-pgsql-objects)[ Packagist](https://packagist.org/packages/programster/pgsql-objects)[ Docs](https://github.com/programster/package-mysql-objects)[ RSS](/packages/programster-pgsql-objects/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (10)Versions (28)Used By (0)

PostgreSQL Objects Package
==========================

[](#postgresql-objects-package)

This package aims to act as your object-relational-map (ORM) to a PostgreSQL database.

To use this package, we recommend you create two class files for each of your tables. One should end in the word `Table` and represent operations on the table itself. This should ideally extend the `AbstractTable` in the package. If you need to create something rather special, then one can just implement the `TableInterface` interface. Once you have extended the class, all you have to do is fill in all of the abstract methods.

The second class you need to create is for a row/object of the table. This class should extend the `AbstractTableRowObject`. Again, just fill in all of the abstract methods for the package to be able to manage your tables.

### Limitations

[](#limitations)

This package only works with tables that have an `id` column of type `uuid`.

### Key Features

[](#key-features)

- Save/updates objects to the database for you when you want it to.
- implement an automatica local cache, so you don't re-fetch objects when you don't need to. E.g. if you make a call to MyTable::loadAll() before then trying to load a bunch of objects by ID, then the objects will be returned immediately without having to hit the database because they were all loaded into the cache.
- Supports cloning of the objects - will generate a new UUID for the clone and mark it as not being in the database. It will only be persisted if you save it to the database.

Testing
-------

[](#testing)

If you wish to create some changes and run the tests, simply fill in you PostgreSQL host details into the `/testing/settings.php.tmpl` file and rename it to `/testing/settings.php`.

Then run the tests with:

```
php testing/main.php
```

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance90

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity75

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 ~68 days

Recently: every ~176 days

Total

27

Last Release

52d ago

Major Versions

1.1.11 → 2.0.02021-12-16

2.2.0 → 3.0.02024-03-21

PHP version history (3 changes)1.0.0PHP &gt;=8.0.0

2.2.0PHP &gt;=8.1.0

3.0.0PHP &gt;=8.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/64a048ca8be761aced9419279975a21ef679b71c70d8263bc2fc413a87ad381c?d=identicon)[programster](/maintainers/programster)

---

Top Contributors

[![programster](https://avatars.githubusercontent.com/u/5709838?v=4)](https://github.com/programster "programster (31 commits)")

---

Tags

ormpostgresqlpgsqlmodels

### Embed Badge

![Health badge](/badges/programster-pgsql-objects/health.svg)

```
[![Health](https://phpackages.com/badges/programster-pgsql-objects/health.svg)](https://phpackages.com/packages/programster-pgsql-objects)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k605.0M6.8k](/packages/doctrine-dbal)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58825.9M54](/packages/scienta-doctrine-json-functions)[dunglas/doctrine-json-odm

An object document mapper for Doctrine ORM using JSON types of modern RDBMS.

6315.5M13](/packages/dunglas-doctrine-json-odm)[cycle/orm

PHP DataMapper ORM and Data Modelling Engine

1.3k918.0k77](/packages/cycle-orm)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4585.8M4](/packages/martin-georgiev-postgresql-for-doctrine)[aura/sql

A PDO extension that provides lazy connections, array quoting, query profiling, value binding, and convenience methods for common fetch styles. Because it extends PDO, existing code that uses PDO can use this without any changes to the existing code.

5892.7M56](/packages/aura-sql)

PHPackages © 2026

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