PHPackages                             dimensi0n/simple-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. dimensi0n/simple-query

ActiveLibrary

dimensi0n/simple-query
======================

Provides a simple and easy to use query builder

1.0.1(4y ago)112[1 PRs](https://github.com/dimensi0n/simple-query/pulls)MITPHP

Since Apr 7Pushed 1y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

simple-query
============

[](#simple-query)

[![PHP Composer](https://github.com/dimensi0n/simple-query/workflows/PHP%20Composer/badge.svg)](https://github.com/dimensi0n/simple-query/workflows/PHP%20Composer/badge.svg)

Provides a simple and easy to use query builder

Install it :

```
composer require dimensi0n/simple-query
```

Initialize it like a PDO instance :

```
use SimpleQuery\QueryBuilder;
$queryBuilder = new QueryBuilder('mysql:host=localhost;dbname=test', $user, $pass);
```

Create a table :

```
$queryBuilder->create('users', [
    'username' => ['type' => 'varchar (15)', 'notNullable' => true, 'unique' => true],
    'password' => ['type' => 'varchar (200)'],
    'age' => ['type' => 'int', 'default' => 20]
]);
/* CREATE TABLE IF NOT EXISTS (
    id INTEGER PRIMARY KEY,
    username VARCHAR (15) NOT NULL UNIQUE,
    password VARCHAR (200),
    age INTEGER DEFAULT 20
)
*/
```

Drop a table :

```
$queryBuilder->dropTable('users'); // DROP TABLE IF EXISTS users
```

Select :

```
$statement = $queryBuilder->select('users', ['id', 'username', 'age', 'password']); // SELECT id, username, age, password FROM users
$statement = $queryBuilder->select('users', ['id', 'username', 'age', 'password'], ['age' => 16]); // SELECT id, username, age, password FROM users WHERE age = 17;
$statement->fetchAll(); // select returns a PDOStatement
```

Insert :

```
$queryBuilder->insert('users', ['username' => 'erwan', 'age' => 16, 'password' => 'this_is_a_secure_password']); // INSERT INTO users (username, age, password) VALUES ('erwan', 16, 'this_is_a_secure_password')
```

Update :

```
$queryBuilder->update('users', ['age' => 17], ['username' => 'erwan']); // UPDATE users SET age = 17 WHERE username = erwan
```

Delete :

```
$queryBuilder->delete('users', ['age' => 17]); // DELETE users WHERE age = 17
```

For further information check the API docs : [dimensi0n.github.io/simple-query/api](dimensi0n.github.io/simple-query/api)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Total

2

Last Release

1799d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/50182489a76dd704e40f7cbc09ca983042d5b86088c3e819f638a0c7a1f178a9?d=identicon)[dimensi0n](/maintainers/dimensi0n)

---

Top Contributors

[![dimensi0n](https://avatars.githubusercontent.com/u/25726586?v=4)](https://github.com/dimensi0n "dimensi0n (15 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dimensi0n-simple-query/health.svg)

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

PHPackages © 2026

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