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

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

duncan3dc/sql
=============

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

129PHPCI failing

Since Aug 20Pushed 11mo ago1 watchersCompare

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

READMEChangelogDependenciesVersions (7)Used By (0)

sql
===

[](#sql)

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

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

[![Latest Stable Version](https://camo.githubusercontent.com/91162f092e5a9bab799de5e5ab4b761f4ede77430f434c197f68efc9d222cce5/68747470733a2f2f706f7365722e707567782e6f72672f64756e63616e3364632f73716c2f76657273696f6e2e737667)](https://packagist.org/packages/duncan3dc/sql)[![Build Status](https://camo.githubusercontent.com/346a657ae2971db3e2c173b07ba1d6525fdb5b3bdf9497008c4d820f6a96aa74/68747470733a2f2f7472617669732d63692e6f72672f64756e63616e3364632f73716c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/duncan3dc/sql)[![Coverage Status](https://camo.githubusercontent.com/e03cf8c42c8cd5349aaccdeee074d51ae63c32efbaeb31f18c0034e42394f854/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f64756e63616e3364632f73716c2f62616467652e737667)](https://coveralls.io/github/duncan3dc/sql)

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

[](#installation)

The recommended method of installing this library is via [Composer](//getcomposer.org/).

Run the following command from your project root:

```
$ composer require duncan3dc/sql
```

Getting Started
---------------

[](#getting-started)

```
use duncan3dc\Sql\Sql;
use duncan3dc\Sql\Drivers\Mysql\Server;

require __DIR__ . "/vendor/autoload.php";

$sql = new Sql(new Server($hostname, $username, $password));

$row = $sql->select("table", [
    "field1"    =>  "value1",
]);
print_r($row);
```

*Read more at *

Changelog
---------

[](#changelog)

A [Changelog](CHANGELOG.md) has been available since the beginning of time

Where to get help
-----------------

[](#where-to-get-help)

Found a bug? Got a question? Just not sure how something works?
Please [create an issue](//github.com/duncan3dc/sql/issues) and I'll do my best to help out.
Alternatively you can catch me on [Twitter](https://twitter.com/duncan3dc)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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://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 (7 commits)")

---

Tags

mssqlmysqlodbcphpsql

### Embed Badge

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

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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