DEV.co
Open-Source Databases · ezSQL

ezsql

ezsql is a PHP library that simplifies database operations across multiple database systems (MySQL, PostgreSQL, SQLite, SQL Server, Oracle) using a unified CRUD interface. It provides object-oriented abstractions and shortcut methods to reduce boilerplate database code.

Source: GitHub — github.com/ezSQL/ezsql
867
GitHub stars
280
Forks
PHP
Primary language
LGPL-3.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryezSQL/ezsql
OwnerezSQL
Primary languagePHP
LicenseLGPL-3.0 — OSI-approved
Stars867
Forks280
Open issues0
Latest release5.1.3 (2026-04-02)
Last updated2026-04-02
Sourcehttps://github.com/ezSQL/ezsql

What ezsql is

ezsql is a PHP database abstraction layer implementing Factory and Dependency Injection patterns, supporting mysqli, PDO, pgsql, sqlsrv, and sqlite3 drivers. It offers method chaining, prepared statement support, and PSR-2/PSR-4/PSR-11 compliance with variadic condition builders for WHERE clauses.

Quickstart

Get the ezsql source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/ezSQL/ezsql.gitcd ezsql# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Multi-database PHP applications

Rapidly switch between database backends (MySQL, PostgreSQL, SQLite, SQL Server) with minimal code changes using the unified Database::initialize() interface.

CRUD-heavy PHP web applications

Reduce boilerplate for common SELECT, INSERT, UPDATE, DELETE operations via fluent shortcut methods like select(), insert(), update(), delete() with built-in WHERE clause builders.

Legacy PHP codebase modernization

Migrate away from procedural database code to OOP patterns while maintaining compatibility with existing driver ecosystems (mysqli, PDO, pgsql).

Implementation considerations

  • Version 5 introduced breaking changes (namespaces for global functions, PSR-1 camelCase properties, method renames); audit existing v4 code before upgrade.
  • Prepared statement support is opt-in via prepareOn()/prepareOff(); ensure consistent decision across codebase to prevent SQL injection inconsistencies.
  • Integration tests are live database tests (not mocked); establish test database fixtures and credentials in CI/CD pipeline.
  • IDE with intellisense recommended; doc-blocks are primary documentation source for method signatures and expected behavior.
  • Table name and prefix can be preset via tableSetup() or setTable() for ingestion methods; design naming conventions early to avoid runtime false returns.

When to avoid it — and what to weigh

  • Complex relational queries required — While joins are supported, the shortcut API may become cumbersome for complex multi-table queries with nested subqueries; consider Doctrine ORM or Eloquent instead.
  • Non-PHP tech stack — ezsql is PHP-only; if your application spans Python, Node.js, Go, or other languages, choose a language-agnostic database abstraction layer.
  • No support for NoSQL databases — ezsql supports only relational databases; MongoDB, Redis, Cassandra, and other NoSQL systems are out of scope.
  • Minimal or no documentation required — README excerpt indicates wiki documentation is incomplete; teams requiring comprehensive, finalized docs should verify coverage against your use cases.

License & commercial use

ezsql is licensed under LGPL-3.0 (GNU Lesser General Public License v3.0). LGPL permits commercial use, modification, and distribution, but requires that derivative works using ezsql remain under LGPL-compatible licenses and provide source code access to users.

LGPL-3.0 allows commercial use. However, if you modify ezsql and distribute the modified library as part of a proprietary product, you must either (1) distribute source code, or (2) use ezsql as a separate, dynamically-linked library. Consult legal review before shipping derivative modifications in a closed-source product. Unmodified ezsql used as-is via Composer carries lower legal risk.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Prepared statement support available but opt-in; ensure prepareOn() is default in new code to mitigate SQL injection. Variadic condition builders (eq, neq, like, etc.) abstract parameterization; code review required to confirm no raw user input bypasses these helpers. SSL/TLS certificate support present for database connections. No mention of audited security review or vulnerability disclosure policy; security posture requires independent assessment.

Alternatives to consider

Doctrine ORM

Enterprise-grade PHP ORM with mature documentation, query builder, lazy loading, and multi-database support; higher learning curve but more power for complex schemas.

Laravel Eloquent

Framework-integrated ORM with fluent query syntax, strong documentation, and tight Laravel ecosystem integration; best if already using Laravel.

Dibi (PHP Database Abstraction Library)

Lightweight PHP DBAL with simpler API; emphasizes simplicity and debuggability; smaller ecosystem but lower barrier to entry than ezsql.

Software development agency

Build on ezsql with DEV.co software developers

ezsql reduces boilerplate CRUD operations across multiple database systems. Start with `composer require ezsql/ezsql` and review the wiki documentation for your use case. For enterprise integrations, consult Devco for architecture guidance.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

ezsql FAQ

Can I use ezsql with Laravel or Symfony?
ezsql is not officially integrated with these frameworks; you would use it independently. Verify it does not conflict with framework-provided database layers (Eloquent, Doctrine). Not recommended if framework ORM is already primary.
Is prepared statement usage automatic or manual?
Manual. Call prepareOn() to enable prepared statements for shortcut SQL methods; default is prepareOff() (vendor escape routine). Audit code to ensure consistent choice.
What PHP versions are supported?
Not explicitly stated in provided data. README mentions v3 required PHP 5.6 and dropped legacy mysql extension; v5 likely requires PHP 7.0+. Verify compatibility for your target PHP version.
How do I run tests locally?
Tests are live database integration tests (not mocked). You must provision actual database instances and set credentials. See phpunit test files for schema/fixture requirements.

Software developers & web developers for hire

From first prototype to production, DEV.co delivers software development services around tools like ezsql. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across open-source databases and beyond.

Ready to Simplify Your PHP Database Code?

ezsql reduces boilerplate CRUD operations across multiple database systems. Start with `composer require ezsql/ezsql` and review the wiki documentation for your use case. For enterprise integrations, consult Devco for architecture guidance.