PHPackages                             effectra/sql-query - 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. effectra/sql-query

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

effectra/sql-query
==================

The Effectra SQL Query package.

v2.0.12(2y ago)2832MITPHP

Since Jun 20Pushed 2y agoCompare

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

READMEChangelog (10)DependenciesVersions (18)Used By (2)

Effectra SqlQuery
=================

[](#effectra-sqlquery)

Effectra/SqlQuery is a powerful database manipulation package for PHP.

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

[](#installation)

You can install this package via Composer. Run the following command:

```
composer require effectra/sql-query
```

Usage
-----

[](#usage)

### Query Example

[](#query-example)

```
use Effectra\SqlQuery\Query;

// Select statement
$query = Query::select('users')->columns(['id','email','password'])->where(['id' => 9841]);

// Print the SQL query
echo $query;

//output
//  SELECT id, email, password FROM users WHERE id = 9841
```

### Table Example

[](#table-example)

```
use Effectra\SqlQuery\Table;
use Effectra\SqlQuery\Charset;
use Effectra\SqlQuery\Driver;
use Effectra\SqlQuery\Engine;

Query::driver(Driver::MySQL);

Query::createTable('users', function (Table $table) {
    $table->autoIncrement();
    $table->username()->unique();
    $table->email()->unique();
    $table->timestamps();
})->engine(Engine::MYSQL_InnoDB)->charset(Charset::MySQL_utf8mb4);
```

output:

```
CREATE TABLE users (
    id BIGINT NOT NULL AUTO_INCREMENT ,
    username VARCHAR (50) NOT NULL UNIQUE CHECK (username REGEXP '^[a-zA-Z0-9_]+$'),
    email VARCHAR (255) NOT NULL UNIQUE CHECK (email REGEXP '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'),
    created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ,
    updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4_0900_ai_ci
```

License
-------

[](#license)

This package is open-source and available under the [MIT License](https://opensource.org/licenses/MIT).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

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 ~9 days

Total

17

Last Release

919d ago

Major Versions

v1.0.3 → v2.0.02023-09-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e6219ae87e98df8783b2f595b013035dd183c0712afd24045a8acf0a40c3bdf?d=identicon)[effectra](/maintainers/effectra)

---

Top Contributors

[![BMTmohammedtaha](https://avatars.githubusercontent.com/u/95439605?v=4)](https://github.com/BMTmohammedtaha "BMTmohammedtaha (34 commits)")

---

Tags

manupulationmysqlphpsqlsql-querysqlitesyntax

### Embed Badge

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

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

###  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)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

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

Reliese Components for Laravel Framework code generation.

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

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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