PHPackages                             depage/db - 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. depage/db

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

depage/db
=========

depage-pdo is a small wrapper around the pdo object which allows late/on demand initializition of the database connection.

1.4.0(12y ago)17221MITPHPPHP  &gt;= 5.3

Since Feb 24Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/depage/depage-db)[ Packagist](https://packagist.org/packages/depage/db)[ RSS](/packages/depage-db/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

depage-db
=========

[](#depage-db)

PDO Wrapper
===========

[](#pdo-wrapper)

A small wrapper around the pdo object which allows late/on demand initialization of the database connection.

Schema
======

[](#schema)

The Schema class imports or updates SQL database schemata. Schemata are described by common SQL files with update instructions in comments. SQL files can also be templates to allow for prefixing/replacement of table identifiers.

Instruction tags
----------------

[](#instruction-tags)

- @@version
    - mandatory, labels the following code with a version identifier
- @@tablename
    - mandatory, declares database tablename to be updated
    - marks table identifier for replacement function
- @@connection
    - marks table identifiers for replacement function

Example
-------

[](#example)

SQL schema file (schema.sql)

```
# @tablename example
# @version 0.1
CREATE TABLE example (
    uid int(10) unsigned NOT NULL DEFAULT '0',
    pid int(10) unsigned NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

# @version 0.2
ALTER TABLE example
ADD COLUMN did int(10) unsigned NOT NULL DEFAULT '0' AFTER pid;
```

Import/update in PHP
--------------------

[](#importupdate-in-php)

```
$schema = new Schema($pdo);
$schema->setReplace(
    function ($tableName) {
        return 'prefix_' . $tableName;
    }
);
$schema->loadFile('schema.sql');
```

License (dual)
--------------

[](#license-dual)

- GPL2:
- MIT:

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance52

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

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

Unknown

Total

1

Last Release

4463d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98fa871aefc695ca207a9972094d72b38a2e49071eb1e3807077b231d4742e77?d=identicon)[jonasjonas](/maintainers/jonasjonas)

---

Top Contributors

[![jonasjonas](https://avatars.githubusercontent.com/u/112114?v=4)](https://github.com/jonasjonas "jonasjonas (40 commits)")

---

Tags

databasepdodb

### Embed Badge

![Health badge](/badges/depage-db/health.svg)

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

###  Alternatives

[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)[envms/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

925511.7k13](/packages/envms-fluentpdo)[lichtner/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

921274.8k6](/packages/lichtner-fluentpdo)[fpdo/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

921244.9k7](/packages/fpdo-fluentpdo)[atlas/query

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

41249.0k7](/packages/atlas-query)[aura/sqlschema

Provides facilities to read table names and table columns from a database using PDO.

41234.1k4](/packages/aura-sqlschema)

PHPackages © 2026

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