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

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

inglar/sql-builder
==================

1.0.3(9y ago)0254MITPHPPHP &gt;=5.5.3CI failing

Since Sep 23Pushed 3y agoCompare

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

READMEChangelogDependencies (1)Versions (5)Used By (0)

Installation
============

[](#installation)

Composer
--------

[](#composer)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this package:

```
$ composer require inglar/sql-builder
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Supported Adapters
==================

[](#supported-adapters)

SqlBuilder supports the following database adapters:

- MySQL (specify *mysql*)
- PostgreSQL (specify *pgsql*)

Usage
=====

[](#usage)

**Simple select**

```
$builder = new SqlBuilder('pgsql');
$select = $builder->select()
    ->column('*')
    ->from('table')
    ->where('id = :id')
    ->bindParam(':id', 123);

echo $select;
print_r($select->getBindParams());
```

The above example will output:

```
SELECT * FROM "table" WHERE id = :id

Array
(
    [:id] => 123
)

```

**Select with join**

```
$builder = new SqlBuilder('pgsql');
$select = $builder->select()
    ->column('*')
    ->from('table')
    ->join($builder->join('table2', "table2.user_id = table.id")
    ->where('id = :id')
    ->bindParam(':id', 123);

echo $select;
print_r($select->getBindParams());
```

The above example will output:

```
SELECT * FROM "table" JOIN "table2" ON table2.user_id = table.id WHERE id = :id

Array
(
    [:id] => 123
)

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

3442d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/60971712?v=4)[inglar](/maintainers/inglar)[@inglar](https://github.com/inglar)

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M117](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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