PHPackages                             soupmix/base - 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/base

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

soupmix/base
============

Simple database abstraction layer adapters collection to handle CRUD operations.

0.8(8y ago)2998↓80%3MITPHP ~7.1

Since May 31Compare

[ Source](https://github.com/soupmix/base)[ Packagist](https://packagist.org/packages/soupmix/base)[ Docs](https://github.com/soupmix/base)[ RSS](/packages/soupmix-base/feed)WikiDiscussions Synced 2d ago

READMEChangelog (10)DependenciesVersions (21)Used By (3)

Soupmix
=======

[](#soupmix)

[![Latest Stable Version](https://camo.githubusercontent.com/fe509960df9e1e92fbcdced83eada1b44f1d90b4f2c7635e20c37d6322e6a2f4/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f626173652f762f737461626c65)](https://packagist.org/packages/soupmix/base) [![Total Downloads](https://camo.githubusercontent.com/2b6958313d157767a1866505adf3acc97b9ac38d10ede70a117195b7f958c187/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f626173652f646f776e6c6f616473)](https://packagist.org/packages/soupmix/base) [![Latest Unstable Version](https://camo.githubusercontent.com/7c3ed8a08cd98861158ac8b1fbd0252e293d70bd2fc92fcd8f5010ef073d25f2/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f626173652f762f756e737461626c65)](https://packagist.org/packages/soupmix/base) [![License](https://camo.githubusercontent.com/827955bca5cb89255980f0ecb22292a057fbaaa97058880a978771c5eee7aad9/68747470733a2f2f706f7365722e707567782e6f72672f736f75706d69782f626173652f6c6963656e7365)](https://packagist.org/packages/soupmix/base)

Simple database abstraction layer adapters collection to handle CRUD operations written in PHP. This library does not provide any ORM or ODM.

Adapters
--------

[](#adapters)

- **MongoDB: Exists**
- **Elasticsearch: Exists**
- Couchbase: Planned
- **Doctrine DBAL: Exists**\*\* **MySQL**\*\* **PostgreSQL**\*\* **Microsoft SQL**\*\* **Oracle**\*\* **SQLite**

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

[](#installation)

**This library contains only interface and abstract classes**. To use with a database you have to install the package written for that database. i.e: soupmix/mongodb for MongoDB;

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

```
$ composer require soupmix/base "~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 MongoDB Service
$adapter_config = [];
$adapter_config['db_name'] ='db_name';
$adapter_config['connection_string']="mongodb://127.0.0.1";
$adapter_config['options'] =[];
$config['db_name'] = $adapter_config['db_name];
$client = new \MongoDB\Client($adapter_config['connection_string'], $adapter_config['options']);
$m=new Soupmix\MongoDB($config, $client);

// Connect to Elasticsearch Service
$adapter_config             = [];
$adapter_config['db_name']  = 'indexname';
$adapter_config['hosts']    = ["127.0.0.1:9200"];
$adapter_config['options']  = [];
$config['db_name'] = $adapter_config['db_name];
$client = \Elasticsearch\ClientBuilder::create()->setHosts($adapter_config['hosts'])->build();
$e=new Soupmix\ElasticSearch($config, $client);

// Connect 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",
      "siblings"=> [
        "male"=> [
          "count"=> 1,
          "names"=> ["Jack"]
        ],
        "female"=> [
          "count" => 1,
          "names" =>["Jane"]
		]
      ]
];
$docs[] = [
	"full_name" => "Jack Doe",
      "age" => 38,
      "email"	=> "jackdoe@domain.com",
      "siblings"=> [
        "male"=> [
          "count"=> 1,
          "names"=> ["John"]
        ],
        "female"=> [
          "count" => 1,
          "names" =>["Jane"]
		]
      ]
];

$docs[] = [
	"full_name" => "Jane Doe",
      "age" => 29,
      "email"	=> "janedoe@domain.com",
      "siblings"=> [
        "male"=> [
          "count"=> 2,
          "names"=> ["Jack","John"]
        ],
        "female"=> [
          "count" => 0,
          "names" =>[]
		]
      ]
];

foreach($docs as $doc){
	// insert user into database
	$mongo_user_id = $m->insert("users",$doc);
	$es_user_id = $e->insert("users",$doc);

}
// get user data using id
$es_user_data = $e->get('users', "AVPHZO1DY8UxeHDGBhPT");

$filter = ['age_gte'=>0];
// update users' data that has criteria encoded in $filter
$set = ['is_active'=>1,'is_deleted'=>0];

$e->update("users",$)

$filter = ["siblings.male.count__gte"=>2];

//delete users that has criteria encoded in $filter
$e->delete('users', $filter);

// 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 = $e->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

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

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

Recently: every ~96 days

Total

20

Last Release

3265d ago

PHP version history (3 changes)0.1PHP &gt;=5.5

0.5.1PHP &gt;=5.6

0.8PHP ~7.1

### 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 (27 commits)")

---

Tags

databaseelasticsearchmysqlsqlitepostgresqloraclemongodbadaptersAbstraction Layermicrosoft sql server

### Embed Badge

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

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

###  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)[dg/adminer-custom

Customization for Adminer, the best database management tool written in PHP.

136792.4k16](/packages/dg-adminer-custom)[catfan/medoo

The lightweight PHP database framework to accelerate development

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

Dibi is Database Abstraction Library for PHP

5014.0M131](/packages/dibi-dibi)[dg/adminer

Customization for Adminer, the best database management tool written in PHP.

1343.4k](/packages/dg-adminer)[moharrum/laravel-adminer

Adminer database management tool for your Laravel application.

451.0k](/packages/moharrum-laravel-adminer)

PHPackages © 2026

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