PHPackages                             gooddaykya/pdobase - 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. gooddaykya/pdobase

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

gooddaykya/pdobase
==================

PDOBase. Wrapper for PDO

v1.2.1-stable(7y ago)0160[1 issues](https://github.com/gooddaykya/pdobase/issues)MITPHPPHP &gt;=5.3CI failing

Since Jan 12Pushed 7y agoCompare

[ Source](https://github.com/gooddaykya/pdobase)[ Packagist](https://packagist.org/packages/gooddaykya/pdobase)[ RSS](/packages/gooddaykya-pdobase/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (12)Used By (0)

PDOBase
=======

[](#pdobase)

[![Latest Stable Version](https://camo.githubusercontent.com/de91ebf646bab268b931843221a7d73c39cacc545e27b4e09b19bceed426c3c7/68747470733a2f2f706f7365722e707567782e6f72672f676f6f646461796b79612f70646f626173652f762f737461626c65)](https://packagist.org/packages/gooddaykya/pdobase) [![Total Downloads](https://camo.githubusercontent.com/dfe75fd19e3b368d2ad2f386826b030d69e2708e6cd6371fd81f058df7e6d3cd/68747470733a2f2f706f7365722e707567782e6f72672f676f6f646461796b79612f70646f626173652f646f776e6c6f616473)](https://packagist.org/packages/gooddaykya/pdobase) [![License](https://camo.githubusercontent.com/3c97324cca6a5e817d97f1d2272083a7546b5969fbe124b5ef4f2c4c900a316b/68747470733a2f2f706f7365722e707567782e6f72672f676f6f646461796b79612f70646f626173652f6c6963656e7365)](https://packagist.org/packages/gooddaykya/pdobase)

### Wrapper for PDO

[](#wrapper-for-pdo)

---

Description
-----------

[](#description)

### What it is?

[](#what-it-is)

**PDOBase** is a lightweight and easy-to-config wrapper for PDO. It hides most of routine under boilerplate, thus a developer can focus on *what* should be done instead of *how* it should be done.

### What it is not?

[](#what-it-is-not)

**PDOBase** is not a query builder and doesn't include one.

Two reasons for this:

1. Supporting every SQL feature will add complexity to existing class.
2. Query builder, separated from specific database adaptor, becomes reusabe with another adaptors, that use SQL.

---

### Using

[](#using)

##### Instantiating

[](#instantiating)

```
    require '../vendor/autoload.php';

    $requisites = array(
        'host' => 'localhost',
        'user' => 'root',
        'charset' => 'utf8',
        'dbname'  => 'test_base',
        'password' => ''
    );

    $db = new \gooddaykya\components\PDOBase($requisites);

```

Or, by passing array from external file

```
    require '../vendor/autoload.php';

    $db = new \gooddaykya\components\PDOBase(require '../requisites.php');

```

##### Getting data from database

[](#getting-data-from-database)

```
    $result = $db->execQuery('SELECT * FROM const_table')('fetchAll');

```

##### Using prepared statements

[](#using-prepared-statements)

```
    $request = 'SELECT val, textval FROM const_base WHERE id = :id';
    $bindParams = array(
        ':id' => 1
    );

    $result = $db->execQuery($request, $bindParams)('fetch');

```

##### ACID example

[](#acid-example)

```
    $primeRequest = 'INSERT INTO main_table (val) VALUES (:val)';
    $dependentReq = 'INSERT INTO dep_table (id, val) VALUES (:id, :val)';

    try {
        $db->beginTransaction();
        $insertedId = $db->execQuery($primeRequest,
            array(':val' => 'Independent value')
        )('lastInsertId');

        $result = $db->execQuery(
            $dependentReq,
            array(
                ':id' => $insertedId,
                ':val' => 'Dependent value'
            )
        )('rowCount');

        $db->commit();
    } catch (\PDOException $e) {
        $db->rollback();
    }

```

---

### Testing

[](#testing)

##### Testing tables

[](#testing-tables)

const\_table**id**: unsigned int, not null, primary, AI**val**: unsigned int, not null**textval**: varchar(20)1021one31One42Two513Trirteen642Universal answermain\_table**id**: unsigned int, not null, primary, AI**val**: unsigned int, not nulldep\_tableforeign key(main\_table.id)**id**: unsigned int, not null, primary**val**: unsigned int, not null---

### ToDo List

[](#todo-list)

\[ \] separate current test cases into transaction and non transaction suites.

\[ \] retrieve expected results directly from database.

---

### EOF

[](#eof)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity65

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

Total

5

Last Release

2650d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/84ca8663d1d49002d3f8957ac6c616a67552a2a290ae7ca6b17e0315fe0d6588?d=identicon)[gooddaykya](/maintainers/gooddaykya)

---

Top Contributors

[![gooddaykya](https://avatars.githubusercontent.com/u/28677782?v=4)](https://github.com/gooddaykya "gooddaykya (75 commits)")

---

Tags

mysqlsqlpdodatabase wrapper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gooddaykya-pdobase/health.svg)

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

###  Alternatives

[doctrine/dbal

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

9.7k578.4M5.6k](/packages/doctrine-dbal)[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.5M69](/packages/ifsnop-mysqldump-php)[aura/sqlquery

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

4572.9M34](/packages/aura-sqlquery)[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[ezsql/ezsql

Advance database access library. Make interacting with a database ridiculously easy. An universal interchangeable CRUD system.

86946.7k](/packages/ezsql-ezsql)[jv2222/ezsql

Advance database access library. Make interacting with a database ridiculously easy. An universal interchangeable CRUD system.

87311.3k2](/packages/jv2222-ezsql)

PHPackages © 2026

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