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

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

soupmix/sql
===========

Simple SQL abstraction layer adapter to handle CRUD operations.

0.8.1(8y ago)1140MITPHPPHP ^7.1

Since Jun 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/soupmix/sql)[ Packagist](https://packagist.org/packages/soupmix/sql)[ Docs](https://github.com/soupmix/sql)[ RSS](/packages/soupmix-sql/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (10)Dependencies (6)Versions (22)Used By (0)

Soupmix
=======

[](#soupmix)

[![Build Status](https://camo.githubusercontent.com/a588fc3ea9deb4e98f08134f7917339bdc5d7f259ccea470a622965d4f65a0cc/68747470733a2f2f7472617669732d63692e6f72672f736f75706d69782f73716c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/soupmix/sql) [![Latest Stable Version](https://camo.githubusercontent.com/a5dc31c29e4d7f3f76b404fddb8368117ffb7f4213d5649b2ec2476b2e21235c/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f73716c2f762f737461626c65)](https://packagist.org/packages/soupmix/sql) [![Total Downloads](https://camo.githubusercontent.com/2f6aa7ea12a281d9005b52844a504e15cf14e537f06031aee1b83dc764eb57a1/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f73716c2f646f776e6c6f616473)](https://packagist.org/packages/soupmix/sql) [![Latest Unstable Version](https://camo.githubusercontent.com/c721171f204d532e194b9f5b5d1645c50515e93efb2456d72719ffd2a7338710/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f73716c2f762f756e737461626c65)](https://packagist.org/packages/soupmix/sql) [![License](https://camo.githubusercontent.com/7332590e032c4c59f93f06a4d0599cd1c9059826095d1da5dc9dcc5cc36e1712/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f73716c2f6c6963656e7365)](https://packagist.org/packages/soupmix/sql)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/97acdbd0ddae6ebba724e1de1b1318b97b70f21a367d92ead9247bad12df5c7d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f75706d69782f73716c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/soupmix/sql/) [![Code Coverage](https://camo.githubusercontent.com/8ca7e6dd0c30930c3a06422baf1b8eb53cb1f3f723524faf9e3f20a922ab1241/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f75706d69782f73716c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/soupmix/sql/?branch=master)

Simple SQL abstraction layer adapter to handle CRUD operations written in PHP and built on top of Doctrine/DBAL. This library does not provide any ORM or ODM.

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

[](#installation)

It's recommended that you use [Composer](https://getcomposer.org/) to install Soupmix.

```
$ composer require soupmix/sql "~0.7"
```

This will install Soupmix and all required dependencies. Soupmix requires PHP 5.6.0 or newer.

Documentation
-------------

[](#documentation)

[API Documentation](https://github.com/soupmix/base/blob/master/docs/API_Documentation.md): See details about the db adapters functions:

Usage
-----

[](#usage)

```
// Connect to SQL Service

$config = [
    'dbname'    => 'test',
    'user'      => 'root',
    'password'  => '',
    'host'      => '127.0.0.1',
    'port'      => 3306,
    'charset'   => 'utf8',
    'driver'    => 'pdo_mysql',
];
$client = \Doctrine\DBAL\DriverManager::getConnection($config);
$sql = new \Soupmix\SQL(['db_name'=>$config['dbname']], $client);

$docs = [];
$docs[] = [
    "full_name" => "John Doe",
    "age" => 33,
    "email"    => "johndoe@domain.com"
];
$docs[] = [
    "full_name" => "Jack Doe",
    "age" => 38,
    "email"    => "jackdoe@domain.com"
];

$docs[] = [
    "full_name" => "Jane Doe",
    "age" => 29,
    "email"    => "janedoe@domain.com"
];

foreach($docs as $doc){
    // insert user into database
    $sql_user_id = $sql->insert("users",$doc);
}
// get user data using id
$user_data = $sql->get('users', $sql_user_id);

// user's age lower_than_and_equal to 34 or greater_than_and_equal 36 but not 38
$filter = [[['age__lte'=>34],['age__gte'=>36]],"age__not"=>38];

//find users that has criteria encoded in $filter
$docs = $sql->find("users", $filter);

```

Contribute
----------

[](#contribute)

- Open issue if found bugs or sent pull request.
- Feel free to ask if you have any questions.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Recently: every ~12 days

Total

21

Last Release

3265d ago

### Community

Maintainers

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

---

Top Contributors

[![mkorkmaz](https://avatars.githubusercontent.com/u/585601?v=4)](https://github.com/mkorkmaz "mkorkmaz (69 commits)")

---

Tags

databasemysqlsqlitedoctrinepostgresqldbalsqlmssqloracleadaptersAbstraction Layermicrosoft sql server

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k605.0M6.7k](/packages/doctrine-dbal)[catfan/medoo

The lightweight PHP database framework to accelerate development

5.0k1.6M203](/packages/catfan-medoo)[cycle/database

DBAL, schema introspection, migration and pagination

71777.8k52](/packages/cycle-database)[tommyknocker/pdo-database-class

Framework-agnostic PHP database library with unified API for MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, and Oracle. Query Builder, caching, sharding, window functions, CTEs, JSON, migrations, ActiveRecord, CLI tools, AI-powered analysis. Zero external dependencies.

846.1k](/packages/tommyknocker-pdo-database-class)

PHPackages © 2026

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