PHPackages                             ikitiki/pgdb - 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. ikitiki/pgdb

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

ikitiki/pgdb
============

DB class for working with PostgreSQL

1.0.4(11y ago)239MITPHPPHP &gt;=5.4.0

Since Apr 24Pushed 9y agoCompare

[ Source](https://github.com/ikitiki/pgdb)[ Packagist](https://packagist.org/packages/ikitiki/pgdb)[ Docs](http://github.com/ikitiki/pgdb)[ RSS](/packages/ikitiki-pgdb/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Pgdb
====

[](#pgdb)

[![Travis](https://camo.githubusercontent.com/65a5c84c6bd517ba1eb1480c34d7706bc035f8ae874a7f43004b28e56e54962f/68747470733a2f2f7472617669732d63692e6f72672f696b6974696b692f706764622e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ikitiki/pgdb)

Class for working with PostgreSQL database

\##Usage

Create db instance:

```
$db = new Ikitiki\DB();

$db->setHost('127.0.0.1');
$db->setUsername('postgres');
$db->setDbName('test');
```

\###Make queries:

Single row query:

```
$res = $db->execOne(
	"select id, name from users where email = '%s' and status_id = %d limit 1",
	Ikitiki\DB::quote('john_doe@company.com'),
	1
);
// Executes "select id, email from users where email = 'john_doe@company.com' and status_id = 1"
// $res = [
//   'id' => 1,
//   'name' => 'John Doe'
// ];
```

Key-value queries:

```
$res = $db->exec("select id, name from users")->fetchArray('id', 'name');
// $res = [
//   1 => 'John Doe',
//   2 => 'Richard Roe',
//   3 => 'Mark Moe',
//   ...
// ]
```

or

```
$res = $db->exec("select id, name, department_id from users")->fetchArray('id');
// $res = [
//   1 => ['name' => 'John Doe', 'department_id' => 1],
//   2 => ['name' => 'Richard Roe', 'department_id' => 1],
//   3 => ['name' => 'Mark Moe', 'department_id' => 2]
//   ...
// ];
```

\###Use complex types:

```
$res = $db->exec('select \'{"id":1,"name":"John Doe","department":"Sales"}\'::json as j from users')->fetchArray('j');
//$res = [
//  'id' => 1,
//  'name' => 'John Doe',
//  'department' => 'Sales',
//]
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4064d ago

### Community

Maintainers

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

---

Top Contributors

[![mkabilov](https://avatars.githubusercontent.com/u/5012100?v=4)](https://github.com/mkabilov "mkabilov (24 commits)")

---

Tags

databasepostgresqldb

### Embed Badge

![Health badge](/badges/ikitiki-pgdb/health.svg)

```
[![Health](https://phpackages.com/badges/ikitiki-pgdb/health.svg)](https://phpackages.com/packages/ikitiki-pgdb)
```

###  Alternatives

[doctrine/dbal

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

9.7k595.8M6.4k](/packages/doctrine-dbal)[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k47.9M441](/packages/robmorgan-phinx)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4873.1M37](/packages/aura-sqlquery)[scienta/doctrine-json-functions

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

58825.2M48](/packages/scienta-doctrine-json-functions)[amphp/postgres

Asynchronous PostgreSQL client for Amp.

110557.2k35](/packages/amphp-postgres)[atlas/query

Object-oriented query builders and performers for MySQL, Postgres, SQLite, and SQLServer.

41253.7k7](/packages/atlas-query)

PHPackages © 2026

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