PHPackages                             duncan3dc/sql-class - 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. duncan3dc/sql-class

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

duncan3dc/sql-class
===================

A simple database abstraction layer, with an on disk caching facility.

1.9.3(1y ago)377.6k11Apache-2.0PHPPHP ^7.2 || ^8.0CI passing

Since May 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/duncan3dc/sql-class)[ Packagist](https://packagist.org/packages/duncan3dc/sql-class)[ Docs](https://github.com/duncan3dc/sql-class)[ RSS](/packages/duncan3dc-sql-class/feed)WikiDiscussions main Synced 4d ago

READMEChangelogDependencies (3)Versions (71)Used By (1)

sql-class
=========

[](#sql-class)

A simple database abstraction layer, with an on disk caching facility.

Full documentation is available at
PHPDoc API documentation is also available at [http://duncan3dc.github.io/sql-class/api/](http://duncan3dc.github.io/sql-class/api/namespaces/duncan3dc.SqlClass.html)

[![Build Status](https://github.com/duncan3dc/sql-class/workflows/.github/workflows/buildcheck.yml/badge.svg?branch=main)](https://github.com/duncan3dc/sql-class/actions/workflows/buildcheck.yml)[![Latest Version](https://camo.githubusercontent.com/930076841d2c2ebf45cf184a6e71397a6c4c7aa60154b18c32ad55315deaea0e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64756e63616e3364632f73716c2d636c6173732e737667)](https://packagist.org/packages/duncan3dc/sql-class)

Examples
--------

[](#examples)

The classes use a namespace of duncan3dc\\SqlClass

```
use duncan3dc\SqlClass\Sql;
```

---

```
$sql = new Sql([
    "mode"      =>  "mysql",
    "hostname"  =>  "localhost",
    "username"  =>  "root",
    "password"  =>  "password",
]);

$row = $sql->select("table_1",[
    "field1"    =>  "one",
    "field2"    =>  "two",
]);

$sql->update("table_1",[
    "field3"    =>  "three",
],[
    "field1"    =>  $row["field1"],
    "field2"    =>  $row["field2"],
])
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance44

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.9% 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 ~60 days

Recently: every ~650 days

Total

66

Last Release

436d ago

Major Versions

1.6.14 → 2.0.x-dev2015-12-21

PHP version history (6 changes)1.0.1PHP &gt;=5.3.0

1.1.4PHP &gt;=5.4.0

1.5.3PHP &gt;=5.5.0

1.6.0PHP &gt;=5.6.0

1.7.1PHP ^5.6|^7.0

1.9.0PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/11dc66042513f11d1c99b1e6763f25dca84a3ff31cdbea3972b9b804a3d3d5e9?d=identicon)[duncan3dc](/maintainers/duncan3dc)

---

Top Contributors

[![duncan3dc](https://avatars.githubusercontent.com/u/546811?v=4)](https://github.com/duncan3dc "duncan3dc (186 commits)")[![david-fairbanks42](https://avatars.githubusercontent.com/u/2654281?v=4)](https://github.com/david-fairbanks42 "david-fairbanks42 (1 commits)")[![regatta-ajd](https://avatars.githubusercontent.com/u/5111140?v=4)](https://github.com/regatta-ajd "regatta-ajd (1 commits)")

---

Tags

mysqlodbcphpsqlabstractiondatabasemysqlsqlitepostgressqlmssqlcacheodbcmysqliredshift

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/duncan3dc-sql-class/health.svg)

```
[![Health](https://phpackages.com/badges/duncan3dc-sql-class/health.svg)](https://phpackages.com/packages/duncan3dc-sql-class)
```

###  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)[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)
