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 4mo agoCompare

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

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

21

—

LowBetter than 17% of packages

Maintenance52

Moderate activity, may be stable

Popularity10

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.8k117.8M121](/packages/jdorn-sql-formatter)[backup-manager/backup-manager

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

1.7k1.6M11](/packages/backup-manager-backup-manager)[propel/propel1

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

8351.6M88](/packages/propel-propel1)[insolita/yii2-migration-generator

Set of gii tools for generating files for migration by schema of table , phpdoc or table data

108508.0k5](/packages/insolita-yii2-migration-generator)[xpdo/xpdo

A PDO-based Object/Relational Bridge Library

7088.4k4](/packages/xpdo-xpdo)[voku/session2db

A PHP library acting as a wrapper for PHP's default session handling functions which stores data in a MySQL database, providing both better performance and better security and protection against session fixation and session hijacking.

3220.0k](/packages/voku-session2db)

PHPackages © 2026

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