PHPackages                             easysql/easysql - 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. easysql/easysql

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

easysql/easysql
===============

Work more optimally with SQL for Performance, Security and Readability

v0.0.3(8y ago)3247MITPHPPHP &gt;=5.3.0

Since Dec 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/elchris/easysql)[ Packagist](https://packagist.org/packages/easysql/easysql)[ Docs](https://github.com/elchris/easysql)[ RSS](/packages/easysql-easysql/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

EasySQL
=======

[](#easysql)

Work more effectively with SQL for Performance, Security and Code Readability:

- Exposes Simple API - Takes care of PDO and Prepared Statement management so you don't have to
- Strongly-Typed returns on SELECT operations, returning instances of Entity Beans
- Strongly-Typed INSERT operations allowing easy insertion of collections of Entity Beans
- First-Class support for Master and Slave connections, with transparent dispatching of queries to appropriate connection
- Optimal management of PDO Connections and Prepared Statements across an execution context
    - Reusable connections are managed via a shared "Execution Context", allowing you to use and reuse as many "Model" Class instances as convenient without constantly opening-up and tearing-down connections.
    - Each connection keeps track of "Prepared Statements" tied to each new "Query String" it sees. Should the same query be invoked via another method or class later within an Execution Context, the previously-generated Prepared Statement tied to that query will be reused.

[![Test Coverage](https://camo.githubusercontent.com/fb9b45042eadbbbcbfd94b82fe00fe26515c8b475a650668ec6209813ffe6d8d/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f656c63687269732f6561737973716c2f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/elchris/easysql)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c75adbf561e68af2e7cd7fe75c9ebb691977b8305dc5aa75006fa5da97ac4009/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656c63687269732f6561737973716c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/elchris/easysql/?branch=master)[![Code Climate](https://camo.githubusercontent.com/8b65e0da0b4ac54818dc18c7b21c88059643e037d66dcc78fa5054b56d9073ab/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f656c63687269732f6561737973716c2f6261646765732f6770612e737667)](https://codeclimate.com/github/elchris/easysql)[![Build Status](https://camo.githubusercontent.com/920bad3e5c1494e805bbd0c23848b0e8568a127ca683e2c3cf9ed5ba05ca7c0d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656c63687269732f6561737973716c2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/elchris/easysql/build-status/master)

Compliance &amp; Standards
==========================

[](#compliance--standards)

- Built [TDD](http://en.wikipedia.org/wiki/Test-driven_development) in [PhpStorm](https://www.jetbrains.com/phpstorm/) with [SOLID](http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)) principles, 100% code coverage thru Unit and Integration Tests
- [PSR-2](http://www.php-fig.org/psr/psr-2/) coding style
- [PSR-4](http://www.php-fig.org/psr/psr-4/) auto-loading
- [Composer Installation](https://getcomposer.org) from [Packagist](https://packagist.org/packages/easysql/easysql)
- [Semantic Versioning](http://semver.org) will be followed

More Precisely
==============

[](#more-precisely)

- This is not an ORM library. It assumes you'll be writing your own SQL queries.
- By leveraging "Entity Beans" for INSERT and SELECT operations, spend less time juggling untyped associative arrays.
- EasySQLConfig allows you to:
    - Define your PDO-supported driver:
        - [EasySQL::DRIVER\_POSTGRES](https://github.com/elchris/easysql/blob/master/com/github/elchris/easysql/EasySQLConfig.php#L96)
        - [EasySQL::DRIVER\_MYSQL](https://github.com/elchris/easysql/blob/master/com/github/elchris/easysql/EasySQLConfig.php#L95)
    - Define multiple applications
    - Define a Master and a Slave connection for each application

Composer Installation:
======================

[](#composer-installation)

```
{
    "require": {
        "easysql/easysql": "dev-master"
    }
}

```

Sample Usage:
=============

[](#sample-usage)

- [Example "BaseModel" Class](https://github.com/elchris/easysql/blob/master/com/github/elchris/easysql/tests/integration/ExampleBaseModel.php)
- \[Example "WorldModel" Class\] ()

[Purpose](https://github.com/elchris/easysql/blob/master/com/github/elchris/easysql/EasySQL.php#L13)
====================================================================================================

[](#purpose)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Every ~618 days

Total

3

Last Release

2924d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e466e895d683f11be259d3b1d10a69ea1133f7756ab77f465fa0b1edc9f570bd?d=identicon)[chrisholland](/maintainers/chrisholland)

---

Top Contributors

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

---

Tags

TDDmysqlpostgressqlpdoPSR-4PSR-2solidprepared-statementsUncle Bob

### Embed Badge

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

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

###  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)[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)[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.5M69](/packages/ifsnop-mysqldump-php)[aura/sql

A PDO extension that provides lazy connections, array quoting, query profiling, value binding, and convenience methods for common fetch styles. Because it extends PDO, existing code that uses PDO can use this without any changes to the existing code.

5632.5M43](/packages/aura-sql)[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[ezsql/ezsql

Advance database access library. Make interacting with a database ridiculously easy. An universal interchangeable CRUD system.

86946.7k](/packages/ezsql-ezsql)

PHPackages © 2026

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