PHPackages                             chanhong/pdolite - 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. chanhong/pdolite

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

chanhong/pdolite
================

database lite classes for mysql, sqlsrv, sqlite, odbc, pdo (mysql, sqlite, sqlsrv)

0141PHP

Since Apr 12Pushed 2mo agoCompare

[ Source](https://github.com/chanhong/pdolite)[ Packagist](https://packagist.org/packages/chanhong/pdolite)[ RSS](/packages/chanhong-pdolite/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

PdoLite
=======

[](#pdolite)

Very lite PDO database class with lite query builder and SIDU (Select, Insert, Delete, Update).

One class file with the size of 22 KB.

You can also use all the native PDO methods:

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

[](#installation)

$ ./composer.phar require chanhong/pdolite 1.0.x-dev

Usage
-----

[](#usage)

Use Case: Use with Slim 3 modify 3 files: settings.php, dependencies.php and index.php
--------------------------------------------------------------------------------------

[](#use-case-use-with-slim-3-modify-3-files-settingsphp-dependenciesphp-and-indexphp)

You can download the sample application of Slim 3 using PdoLite here:

In settings.php

```
    'pdolite' => [
        'dsn' => 'mysql:host=localhost;dbname=bookshelf;charset=utf8',
        'username' => 'user',
        'password' => 'password',
    ],

```

In dependencies.php

use PdoLite\\PdoLite; // Database $container\['pdolite'\] = function ($c) { PdoLite::$cfg = $settings = $c-&gt;get('settings')\['pdolite'\];
$conn = PdoLite::dbConnect($settings\['dsn'\],$settings\['username'\],$settings\['password'\]); return $conn;
};

In your index.php

// Register the database connection with PdoLite $pdolite = $app-&gt;getContainer()-&gt;get('pdolite');

In any of your php file that you want to use PdoLite

```
    return PdoLite::select("authors");

```

Use Case: Use with your own code:
---------------------------------

[](#use-case-use-with-your-own-code)

//Sample dsn

Please see settings-dist.php

// Sample code using New Ojbect call

dbConnect($dsn,$username,$password); print\_r($conn-&gt;dbFetchAssoc($sql)); // Sample code using static call PdoLite::pln(PdoLite::select("authors", \['type'=&gt;'assoc'\]),"select"); $sqlUpdList = \['biography'=&gt;'test'\]; PdoLite::pln(PdoLite::update("authors", \['fl'=&gt;$sqlUpdList, 'where'=&gt;'id=1'\]),"update"); Please see testcase.php for more detail PHPUnit Usage ------------- cd pdolite phpunit test\\PdoLiteTest.php

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance56

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1286631?v=4)[Chanh](/maintainers/chanhong)[@chanhong](https://github.com/chanhong)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/chanhong-pdolite/health.svg)

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198628.3k10](/packages/pgvector-pgvector)

PHPackages © 2026

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