PHPackages                             murage/sqlddl - 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. murage/sqlddl

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

murage/sqlddl
=============

Simple SQL Query builder. Worry less about the database connections and queries..

2.1.3(6y ago)3102[1 issues](https://github.com/murageyun/sqlQueryuilder/issues)MITPHPPHP &gt;=7.1

Since Mar 12Pushed 6y ago1 watchersCompare

[ Source](https://github.com/murageyun/sqlQueryuilder)[ Packagist](https://packagist.org/packages/murage/sqlddl)[ RSS](/packages/murage-sqlddl/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (14)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/55996760aa90e3ff74af46feaf275021ac0668a71c7f69948feeb1397b2d92e6/68747470733a2f2f706f7365722e707567782e6f72672f6d75726167652f73716c64646c2f762f737461626c65)](https://packagist.org/packages/murage/sqlddl)[![Total Downloads](https://camo.githubusercontent.com/b31b21f8ae6cfdeeaf9158d18e7b436bf03795dcea6565ad8f8adf311b0b8076/68747470733a2f2f706f7365722e707567782e6f72672f6d75726167652f73716c64646c2f646f776e6c6f616473)](https://packagist.org/packages/murage/sqlddl)[![License](https://camo.githubusercontent.com/ae0f71078b9c9e4c6797370d6a9eeff08e4a7cd9482035040a6e432947acab22/68747470733a2f2f706f7365722e707567782e6f72672f6d75726167652f73716c64646c2f6c6963656e7365)](https://packagist.org/packages/murage/sqlddl)[![Coverage Status](https://camo.githubusercontent.com/70e340ba43e3f999f7f0faf5405ae6e7250be45ac02ae096175e867bd19dca52/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d696d69646f7473757365722f73716c517565727975696c6465722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/mimidotsuser/sqlQueryuilder?branch=master)

**Installation**
================

[](#installation)

First ensure the PHP version is greater or equal to 7

To include the library in an existing project using [composer](https://getcomposer.org/)

```
composer require murage/sqlddl

```

or in composer.json add as dependency

"murage/sqlddl" : "^2.1.0"

This library is dependent on [PHP dotenv](https://github.com/vlucas/phpdotenv) and requires .env file at root of the project (env file does not have file name only extension .env; an example is provided). To get started include the following ENV variables to be able to get started (change as per your database connection)

```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_NAME=mydatabase
DB_USERNAME=secret
DB_PASSWORD=secret

```

where
`DB_NAME`=your database name

`DB_USERNAME`=your database username

`DB_PASSWORD`=your database password

[Usages](manual.md)
===================

[](#usages)

The library utilizes nesting of functions, and does not require instantiating the Builder class. Start each query using :-

```
Builder::table( "provide the table name here")

```

Every query returns a json encoded response in format

```
{ "status": "either error or success",
  "response : "the response from the server",
  "code":"response code"
}

```

The code depends on the query being executed but on successful query, a code of 200 is returned. Where data is being fetched from the database, an array of records is returned in the response body e.g. **:**

```
{"status":success;
"response":
   [
    {"id":5, "colum1":"valueX"},
    {"id":6, "colum1":"valueK"}
    ],
 "code":200
}

```

Other response codes are [here](ReturnCodes.md). All queries that normally do not fetch any value from the database on successful execution will return

```
{"status":success;
"response": "success",
 "code":200
}

```

To perform a basic select from table test

```
Builder::table('test')
    ->get();

```

or to just select everything in the table

```
Builder::table('test')
      ->all();

```

To select only fifty records

```
 Builder::table('test')
        ->get(50);

```

To select only 3 columns

```
    Builder::table('test)
        ->select('column1','column2','column3')
        ->get()

```

To select *column1* but alias as *name*

```
Builder::table('test)
            ->select('column1 as name','column2','column3')
            ->get()

```

To select using where condition

- where column1 equals numbers

```
Builder::table ('test')
    ->where('column1','=','numbers')
    ->get()

```

- or this can be simplified as

    Builder::table ('test') -&gt;where('column1','numbers') -&gt;get()

allowed conditions include for where clause include

```
< , > ,  , != , = , =, IS, IS NOT,

```

To perform an insert

```
Builder::table('test)
        ->insert('data1','data2','data3')
        ->into('column1','column2','column3')

```

To truncate table test

```
Builder::table('test')
->truncate();

```

To drop table test

```
Builder::table('test')
->drop();

```

##### An up-to date documentation is cooking 🍴

[](#an-up-to-date-documentation-is-cooking--)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity65

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

Recently: every ~1 days

Total

13

Last Release

2472d ago

Major Versions

1.5.0 → 2.0.02019-07-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e75c395496d5461446e6361aad7a560bec1d499aa503845a7f0f7b49a1cdb4c?d=identicon)[illegalbot](/maintainers/illegalbot)

---

Tags

php-libraryphp7sql-queryweb-sql-database

### Embed Badge

![Health badge](/badges/murage-sqlddl/health.svg)

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

PHPackages © 2026

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