PHPackages                             hilmanrdn/pirlo-db - 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. hilmanrdn/pirlo-db

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

hilmanrdn/pirlo-db
==================

Simple class to work with database

5494PHP

Since Nov 28Pushed 9y ago6 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

\#Pirlo\_DB :: PDO Abstract Class

Abstract database class using PDO, the end syntax inspired by Eloquent from laravel but more basic implementations \[Eloquent Laravel\] (). Not much tested yet, it made for my own learning purpose but feel free to use it on your project, and let me know if there are any bugs or anything i can improve.

\##Install

```
composer require "hilmanrdn/pirlo-db: dev-master"

```

\##Todo

- show error, success or fail
- return as JSON
- join
- other relations

\##Usage Example

- Load database

    ```
    use PirloDB\Database;

    require_once 'vendor/autoload.php';

    $test = Database::getInstance($server, $user, $pass, $db_name);
    $test->setTable($tableName);

    ```
- Select and retrieve data

Always use select!

Select() can be blank to select all columns, or specify column(s) name in one string.

There are two possibilities, use all() to get an array, or first() for only one data

```
 $test->select()->all();
 $test->select()->first();
 $test->select('username, id')->first();

```

- Where

    Where() has 3 parameters (column, sign and value)

    It can be used multiple times to use 'AND', or use orwhere() to use 'OR'

    ```
    $test->where('username', '=', 'name')->first();
    $test->select('username')->where('username', '=', 'name')->all();
    $test->where('username', '=', 'hilman')->where('password', '=', 'password')->all();
    $test->where('username', '=', 'name1')->orWhere('username', '=', 'name2')->all();

    ```
- Insert

Use create() and associatve array which formatted by column\_name =&gt; column\_value

```
$test->create([
  'username' => 'name',
  'password' => 'pass',
]);

```

- Update

    Use where() to select which row want to be entered

```
$test->where('username', '=', 'name')->update([
  'username' => 'newName',
  'password' => 'newPass',
]);

```

- Delete

    Use where() to select which row want to be deleted

    ```
    $test->where('username', '=', 'name')->delete();

    ```
- orderBy

    orderBy() has two parameter (column and type\[DESC or ASC\])

    ```
    $test->select()->orderBy('username', 'DESC')->all();

    ```
- take

    take to limit the result, put the number as parameter, if chained with orderBy(), orderBy() must be used first

    ```
    $test->select()->orderBy('username', 'DESC')->take(3)->all();

    ```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/88d71a003d6c4c8373a42da2fc06cb104e155538d07810e5b49675dbb8172068?d=identicon)[hilmanrdn](/maintainers/hilmanrdn)

### Embed Badge

![Health badge](/badges/hilmanrdn-pirlo-db/health.svg)

```
[![Health](https://phpackages.com/badges/hilmanrdn-pirlo-db/health.svg)](https://phpackages.com/packages/hilmanrdn-pirlo-db)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/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)
