PHPackages                             prepmock/idiorm - 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. prepmock/idiorm

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

prepmock/idiorm
===============

A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5

v1.0.0(2y ago)011811BSD-2-ClausePHPPHP &gt;=5.2.0

Since Jun 26Pushed 2y agoCompare

[ Source](https://github.com/Prepmock/idiorm)[ Packagist](https://packagist.org/packages/prepmock/idiorm)[ Docs](https://j4mie.github.io/idiormandparis)[ RSS](/packages/prepmock-idiorm/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (1)

Idiorm
======

[](#idiorm)

[![idiorm master branch](https://github.com/j4mie/idiorm/actions/workflows/idiorm-workflow.yml/badge.svg?branch=master)](https://github.com/j4mie/idiorm/actions?query=branch%3Amaster) [![Latest Stable Version](https://camo.githubusercontent.com/7e1f01e4c6c895bcec87d7639a0f9d26438ba089963fd75e6ba986629780f641/68747470733a2f2f706f7365722e707567782e6f72672f6a346d69652f6964696f726d2f762f737461626c652e706e67)](https://packagist.org/packages/j4mie/idiorm) [![Total Downloads](https://camo.githubusercontent.com/49cb23361c2d5f936ce8a22cba7adf2aa9adcfc772ef2d1004ed19d424c6c0a0/68747470733a2f2f706f7365722e707567782e6f72672f6a346d69652f6964696f726d2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/j4mie/idiorm) [![Code Climate](https://camo.githubusercontent.com/688747347893a8b5b2b38ef66262fb64315dd01693c9436d4c2abc79c8b2f2ce/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6a346d69652f6964696f726d2f6261646765732f6770612e737667)](https://codeclimate.com/github/j4mie/idiorm)

---

### In maintenance only mode

[](#in-maintenance-only-mode)

Idiorm and Paris are now considered to be feature complete as of version 1.5.0. Whilst they will continue to be maintained with bug fixes there will be no further new features added from this point on. This means that if a pull request makes breaking changes to the API or requires anything other than a patch version bump of the library then it will not be merged.

**Please do not submit feature requests or API breaking changes as they will be closed without ceremony.**

### Should I use Idiorm/Paris?

[](#should-i-use-idiormparis)

#### If you're starting a new project

[](#if-youre-starting-a-new-project)

It is not recommended that you use either Idiorm or Paris in new projects.

I recommend that you use the [Eloquent database library](https://github.com/illuminate/database) from [Laravel](https://laravel.com) as Taylor based it on Idiorm when he wrote it. This means that many of the same ideas are present there, but it is more actively maintained and has a more modern code style.

#### If you have existing projects based on Idiorm or Paris

[](#if-you-have-existing-projects-based-on-idiorm-or-paris)

You can continue to use both projects as they will continue to receive security patches and bug fixes. It is important to note that future versions of PHP may not be supported if changes they require would break backwards compatibility.

At this point you can either use another database library such as Eloquent from Laravel (see If you're starting a new project above) or you could decide to fork Idiorm and/or Paris to patch them with your own modifications.

### But, why?

[](#but-why)

For further information on the state of this project please see [j4mie#360](https://github.com/j4mie/idiorm/issues/360)

---

A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5 and above.

Tested on PHP 5.2.0+ - may work on earlier versions with PDO and the correct database drivers.

Released under a [BSD license](https://en.wikipedia.org/wiki/BSD_licenses).

**See Also: [Paris](https://github.com/j4mie/paris), an Active Record implementation built on top of Idiorm.**

Features
--------

[](#features)

- Makes simple queries and simple CRUD operations completely painless.
- Gets out of the way when more complex SQL is required.
- Built on top of [PDO](https://php.net/pdo).
- Uses [prepared statements](https://uk.php.net/manual/en/pdo.prepared-statements.php) throughout to protect against [SQL injection](https://en.wikipedia.org/wiki/SQL_injection) attacks.
- Requires no model classes, no XML configuration and no code generation: works out of the box, given only a connection string.
- Consists of one main class called `ORM`. Additional classes are prefixed with `Idiorm`. Minimal global namespace pollution.
- Database agnostic. Currently supports SQLite, MySQL, Firebird and PostgreSQL. May support others, please give it a try!
- Supports collections of models with method chaining to filter or apply actions to multiple results at once.
- Multiple connections supported
- PSR-1 compliant methods (any method can be called in camelCase instead of underscores eg. `find_many()` becomes `findMany()`) - you'll need PHP 5.3+

Documentation
-------------

[](#documentation)

The documentation is hosted on Read the Docs: [idiorm.rtfd.org](https://idiorm.rtfd.org)

### Building the Docs

[](#building-the-docs)

You will need to install [Sphinx](https://sphinx-doc.org/) and then in the docs folder run:

```
make html

```

The documentation will now be in docs/\_build/html/index.html

Let's See Some Code
-------------------

[](#lets-see-some-code)

```
$user = ORM::for_table('user')
    ->where_equal('username', 'j4mie')
    ->find_one();

$user->first_name = 'Jamie';
$user->save();

$tweets = ORM::for_table('tweet')
    ->select('tweet.*')
    ->join('user', array(
        'user.id', '=', 'tweet.user_id'
    ))
    ->where_equal('user.username', 'j4mie')
    ->find_many();

foreach ($tweets as $tweet) {
    echo $tweet->text;
}
```

Tests
-----

[](#tests)

Tests are written with PHPUnit and be run through composer

```
composer test

```

To make testing on PHP 5.2 (Idiorm maintains support back to this version of PHP) there is a Docker setup in `./test/docker_for_php52` - check the readme in there for more.

Changelog
---------

[](#changelog)

#### 1.5.8 - released 2022-07-18

[](#158---released-2022-07-18)

- Update to support PHP 8.1 \[[edlerd](https://github.com/edlerd) and [aaronpk](https://github.com/aaronpk)\] - [issue #370](https://github.com/j4mie/idiorm/pull/370) and [issue #372](https://github.com/j4mie/idiorm/pull/372)
- GitHub actions used to perform unit testing/CI \[[Treffynnon](https://github.com/treffynnon) and [yan12125](https://github.com/yan12125)\]

#### 1.5.7 - released 2020-04-29

[](#157---released-2020-04-29)

- Fix argument order in call to join() \[[CatalinFrancu](https://github.com/CatalinFrancu)\] - [issue #357](https://github.com/j4mie/idiorm/pull/357)

#### 1.5.6 - released 2018-05-31

[](#156---released-2018-05-31)

- Assign `null` to `self::$_db` on `reset_db()` to ensure PDO closes the connections \[[bleakgadfly](https://github.com/bleakgadfly)\] - [issue #338](https://github.com/j4mie/idiorm/issues/338)

#### 1.5.5 - released 2018-01-05

[](#155---released-2018-01-05)

- Add a docker setup for testing with PHP 5.2 (uses PHPUnit 3.6.12, which is the last version released compatible with PHP 5.2) \[[Treffynnon](https://github.com/treffynnon)\]

#### 1.5.4 - released 2018-01-04

[](#154---released-2018-01-04)

- Reset Idiorm state when a cached result is returned \[[fayland](https://github.com/fayland) (and [Treffynnon](https://github.com/treffynnon))\] - [issue #319](https://github.com/j4mie/idiorm/issues/319)
- Fix travis builds for PHP 5.2+ (adding 7.0 and 7.1) and document support for newer PHP versions \[[Treffynnon](https://github.com/treffynnon)\]
- Correct PHPDoc comments for `selectMany()` \[[kawausokun](https://github.com/kawausokun)\] - [issue #325](github.com/j4mie/idiorm/issues/325)
- Add pdo\_sqlite to the composer require-dev dependencies \[[qyanu](https://github.com/qyanu)\] - [issue #328](github.com/j4mie/idiorm/issues/328)

#### 1.5.3 - released 2017-03-21

[](#153---released-2017-03-21)

- Document the `raw_execute()` method and add a note for `get_db()` in the querying documentation - \[[Treffynnon](https://github.com/treffynnon)\]

#### 1.5.2 - released 2016-12-14

[](#152---released-2016-12-14)

- Fix autoincremented compound keys inserts \[[lrlopez](https://github.com/lrlopez)\] - [issue #233](https://github.com/j4mie/idiorm/issues/233) and [pull #235](https://github.com/j4mie/idiorm/pull/235)
- Add @method tags for magic methods \[[stellis](https://github.com/stellis)\] - [issue #237](https://github.com/j4mie/idiorm/issues/237)
- Ensure `is_dirty()` returns correctly when fed null or an empty string \[[tentwofour](https://github.com/tentwofour)\] - [issue #268](https://github.com/j4mie/idiorm/issues/268)
- Adding Code Climate badge to the readme file \[[e3betht](https://github.com/e3betht)\] - [issue #260](https://github.com/j4mie/idiorm/issues/260)
- Typo in navigation \[[leongersen](https://github.com/leongersen)\] - [issue #257](https://github.com/j4mie/idiorm/issues/257)
- Support named placeholders logging and test \[[m92o](https://github.com/m92o)\] - [issue #223](https://github.com/j4mie/idiorm/issues/223)
- `having_id_is()` reference undefined variable `$value` \[[Treffynnon](https://github.com/treffynnon)\] - [issue #224](https://github.com/j4mie/idiorm/issues/224)
- Documentation fix - ORM query output for `where_any_is()` \[[uovidiu](https://github.com/uovidiu)\] - [issue #306](https://github.com/j4mie/idiorm/issues/306)
- Code style fix preventing nested loops from using the same variable names \[[mkkeck](https://github.com/mkkeck)\] - [issue #301](https://github.com/j4mie/idiorm/issues/301)
- Document shortcomings of the built in query logger \[[Treffynnon](https://github.com/treffynnon)\] - [issue #307](https://github.com/j4mie/idiorm/issues/307)
- Add phpunit to dev dependencies, add `composer test` script shortcut and fix PDO mock in test bootstrap \[[Treffynnon](https://github.com/treffynnon)\]
- New test for multiple raw where clauses \[[Treffynnon](https://github.com/treffynnon)\] - [issue #236](https://github.com/j4mie/idiorm/issues/236)
- Remove PHP 5.2 from travis-ci containers to test against (**note** Idiorm still supports PHP 5.2 despite this) \[[Treffynnon](https://github.com/treffynnon)\]

#### 1.5.1 - released 2014-06-23

[](#151---released-2014-06-23)

- Binding of named parameters was broken \[[cainmi](https://github.com/cainmi)\] - [issue #221](https://github.com/j4mie/idiorm/pull/221)

#### 1.5.0 - released 2014-06-22

[](#150---released-2014-06-22)

- Multiple OR'ed conditions support \[[lrlopez](https://github.com/lrlopez)\] - [issue #201](https://github.com/j4mie/idiorm/issues/201)
- `where_id_in()` for selecting multiple records by primary key \[[lrlopez](https://github.com/lrlopez)\] - [issue #202](https://github.com/j4mie/idiorm/issues/202)
- Add compound primary key support \[[lrlopez](https://github.com/lrlopez)\] - [issue #171](https://github.com/j4mie/idiorm/issues/171)
- Add a RAW JOIN source to the query \[[moiseevigor](https://github.com/moiseevigor)\] - [issue #163](https://github.com/j4mie/idiorm/issues/163)
- offsetExists() should return true for null values, resolves [\#181](https://github.com/j4mie/idiorm/issues/181) \[[cainmi](https://github.com/cainmi)\] - [issue #214](https://github.com/j4mie/idiorm/pull/214)
- Custom cache callback functions \[[peter-mw](https://github.com/peter-mw)\] - [issue #216](https://github.com/j4mie/idiorm/pull/216)
- Restrict null primary keys on update/delete, resolves [\#203](https://github.com/j4mie/idiorm/issues/203) \[[cainmi](https://github.com/cainmi)\] - [issue #205](https://github.com/j4mie/idiorm/issues/205)
- Ensure parameters treated by type correctly \[[charsleysa](https://github.com/charsleysa)\] &amp; \[[SneakyBobito](https://github.com/SneakyBobito)\] - [issue #206](https://github.com/j4mie/idiorm/issues/206) &amp; [issue #208](https://github.com/j4mie/idiorm/issues/208)
- Reduce the type casting on aggregate functions to allow characters \[[herroffizier](https://github.com/herroffizier)\] - [issue #150](https://github.com/j4mie/idiorm/issues/150)
- Prevent invalid method calls from triggering infinite recursion \[[michaelward82](https://github.com/michaelward82)\] - [issue #152](https://github.com/j4mie/idiorm/issues/152)
- Add time to query logging - adds query time parameter to external logger callback function \[[AgelxNash](https://github.com/AgelxNash)\] - [issue #180](https://github.com/j4mie/idiorm/issues/180)
- Changed database array access to ensure it's always properly setup \[[falmp](https://github.com/falmp)\] - [issue #159](https://github.com/j4mie/idiorm/issues/159)
- Allow unsetting the db (`ORM::set_db(null)`) to make the test work again \[[borrel](https://github.com/borrel)\] - [issue #160](https://github.com/j4mie/idiorm/issues/160)
- Correct [issue #176](https://github.com/j4mie/idiorm/issues/176): Ensure database setup before building select \[[kendru](https://github.com/kendru)\] - [issue #197](https://github.com/j4mie/idiorm/issues/197)
- Add HHVM to travis-ci build matrix \[[ptarjan](https://github.com/ptarjan)\] - [issue #168](https://github.com/j4mie/idiorm/issues/168)
- Improve where statement precendence documentation \[[thomasahle](https://github.com/thomasahle)\] - [issue #190](https://github.com/j4mie/idiorm/issues/190)
- Improve testing checks \[[charsleysa](https://github.com/charsleysa)\] - [issue #173](https://github.com/j4mie/idiorm/issues/173)

#### 1.4.1 - released 2013-12-12

[](#141---released-2013-12-12)

**Patch update to remove a broken pull request** - may have consequences for users of 1.4.0 that exploited the "`find_many()` now returns an associative array with the databases primary ID as the array keys" change that was merged in 1.4.0.

- Back out pull request/issue [\#133](https://github.com/j4mie/idiorm/pull/133) as it breaks backwards compatibility in previously unexpected ways (see [\#162](https://github.com/j4mie/idiorm/pull/162), [\#156](https://github.com/j4mie/idiorm/issues/156) and [\#133](https://github.com/j4mie/idiorm/pull/133#issuecomment-29063108)) - sorry for merging this change into Idiorm - closes [issue 156](https://github.com/j4mie/idiorm/issues/156)

#### 1.4.0 - released 2013-09-05

[](#140---released-2013-09-05)

- `find_many()` now returns an associative array with the databases primary ID as the array keys \[[Surt](https://github.com/Surt)\] - [issue #133](https://github.com/j4mie/idiorm/issues/133)
- Calls to `set()` and `set_expr()` return `$this` allowing them to be chained \[[Surt](https://github.com/Surt)\]
- Add PSR-1 compliant camelCase method calls to Idiorm (PHP 5.3+ required) \[[crhayes](https://github.com/crhayes)\] - [issue #108](https://github.com/j4mie/idiorm/issues/108)
- Add static method `get_config()` to access current configuration \[[javierd](https://github.com/mikejestes)\] - [issue #141](https://github.com/j4mie/idiorm/issues/141)
- Add logging callback functionality \[[lalop](https://github.com/lalop)\] - [issue #130](https://github.com/j4mie/idiorm/issues/130)
- Add support for MS SQL `TOP` limit style (automatically used for PDO drivers: sqlsrv, dblib and mssql) \[[numkem](https://github.com/numkem)\] - [issue #116](https://github.com/j4mie/idiorm/issues/116)
- Uses table aliases in `WHERE` clauses \[[vicvicvic](https://github.com/vicvicvic)\] - [issue #140](https://github.com/j4mie/idiorm/issues/140)
- Ignore result columns when calling an aggregate function \[[tassoevan](https://github.com/tassoevan)\] - [issue #120](https://github.com/j4mie/idiorm/issues/120)
- Improve documentation \[[bruston](https://github.com/bruston)\] - [issue #111](https://github.com/j4mie/idiorm/issues/111)
- Improve PHPDoc on `get_db()` \[[mailopl](https://github.com/mailopl)\] - [issue #106](https://github.com/j4mie/idiorm/issues/106)
- Improve documentation \[[sjparsons](https://github.com/sjparsons)\] - [issue #103](https://github.com/j4mie/idiorm/issues/103)
- Make tests/bootstrap.php HHVM compatible \[[JoelMarcey](https://github.com/JoelMarcey)\] - [issue #143](https://github.com/j4mie/idiorm/issues/143)
- Fix docblock \[[ulrikjohansson](https://github.com/ulrikjohansson)\] - [issue #147](https://github.com/j4mie/idiorm/issues/147)
- Fix incorrect variable name in querying documentation \[[fridde](https://github.com/fridde)\] - [issue #146](https://github.com/j4mie/idiorm/issues/146)

#### 1.3.0 - released 2013-01-31

[](#130---released-2013-01-31)

- Documentation moved to [idiorm.rtfd.org](http://idiorm.rtfd.org) and now built using [Sphinx](http://sphinx-doc.org/)
- Add support for multiple database connections - closes [issue #15](https://github.com/j4mie/idiorm/issues/15) \[[tag](https://github.com/tag)\]
- Add in raw\_execute - closes [issue #40](https://github.com/j4mie/idiorm/issues/40) \[[tag](https://github.com/tag)\]
- Add `get_last_statement()` - closes [issue #84](https://github.com/j4mie/idiorm/issues/84) \[[tag](https://github.com/tag)\]
- Add HAVING clause functionality - closes [issue #50](https://github.com/j4mie/idiorm/issues/50)
- Add `is_new` method - closes [issue #85](https://github.com/j4mie/idiorm/issues/85)
- Add `ArrayAccess` support to the model instances allowing property access via `$model['field']` as well as `$model->field` - [issue #51](https://github.com/j4mie/idiorm/issues/51)
- Add a result set object for collections of models that can support method chains to filter or apply actions to multiple results at once - issue [\#51](https://github.com/j4mie/idiorm/issues/51) and [\#22](https://github.com/j4mie/idiorm/issues/22)
- Add support for [Firebird](http://www.firebirdsql.org) with `ROWS` and `TO` result set limiting and identifier quoting \[[mapner](https://github.com/mapner)\] - [issue #98](https://github.com/j4mie/idiorm/issues/98)
- Fix last insert ID for PostgreSQL using RETURNING - closes issues [\#62](https://github.com/j4mie/idiorm/issues/62) and [\#89](https://github.com/j4mie/idiorm/issues/89) \[[laacz](https://github.com/laacz)\]
- Reset Idiorm after performing a query to allow for calling `count()` and then `find_many()` \[[fayland](https://github.com/fayland)\] - [issue #97](https://github.com/j4mie/idiorm/issues/97)
- Change Composer to use a classmap so that autoloading is better supported \[[javierd](https://github.com/javiervd)\] - [issue #96](https://github.com/j4mie/idiorm/issues/96)
- Add query logging to `delete_many` \[[tag](https://github.com/tag)\]
- Fix when using `set_expr` alone it doesn't trigger query creation - closes [issue #90](https://github.com/j4mie/idiorm/issues/90)
- Escape quote symbols in "\_quote\_identifier\_part" - close [issue #74](https://github.com/j4mie/idiorm/issues/74)
- Fix issue with aggregate functions always returning `int` when is `float` sometimes required - closes [issue #92](https://github.com/j4mie/idiorm/issues/92)
- Move testing into PHPUnit to unify method testing and query generation testing

#### 1.2.3 - released 2012-11-28

[](#123---released-2012-11-28)

- Fix [issue #78](https://github.com/j4mie/idiorm/issues/78) - remove use of PHP 5.3 static call

#### 1.2.2 - released 2012-11-15

[](#122---released-2012-11-15)

- Fix bug where input parameters were sent as part-indexed, part associative

#### 1.2.1 - released 2012-11-15

[](#121---released-2012-11-15)

- Fix minor bug caused by IdiormStringException not extending Exception

#### 1.2.0 - released 2012-11-14

[](#120---released-2012-11-14)

- Setup composer for installation via packagist (j4mie/idiorm)
- Add `order_by_expr` method \[[sandermarechal](http://github.com/sandermarechal)\]
- Add support for raw queries without parameters argument \[[sandermarechal](http://github.com/sandermarechal)\]
- Add support to set multiple properties at once by passing an associative array to `set` method \[[sandermarechal](http://github.com/sandermarechal)\]
- Allow an associative array to be passed to `configure` method \[[jordanlev](http://github.com/jordanlev)\]
- Patch to allow empty Paris models to be saved (\[[j4mie/paris](http://github.com/j4mie/paris)\]) - [issue #58](https://github.com/j4mie/idiorm/issues/58)
- Add `select_many` and `select_many_expr` - closing issues [\#49](https://github.com/j4mie/idiorm/issues/49) and [\#69](https://github.com/j4mie/idiorm/issues/69)
- Add support for `MIN`, `AVG`, `MAX` and `SUM` - closes [issue #16](https://github.com/j4mie/idiorm/issues/16)
- Add `group_by_expr` - closes [issue #24](https://github.com/j4mie/idiorm/issues/24)
- Add `set_expr` to allow database expressions to be set as ORM properties - closes issues [\#59](https://github.com/j4mie/idiorm/issues/59) and [\#43](https://github.com/j4mie/idiorm/issues/43) \[[brianherbert](https://github.com/brianherbert)\]
- Prevent ambiguous column names when joining tables - [issue #66](https://github.com/j4mie/idiorm/issues/66) \[[hellogerard](https://github.com/hellogerard)\]
- Add `delete_many` method \[[CBeerta](https://github.com/CBeerta)\]
- Allow unsetting of ORM parameters \[[CBeerta](https://github.com/CBeerta)\]
- Add `find_array` to get the records as associative arrays \[[Surt](https://github.com/Surt)\] - closes [issue #17](https://github.com/j4mie/idiorm/issues/17)
- Fix bug in `_log_query` with `?` and `%` supplied in raw where statements etc. - closes [issue #57](https://github.com/j4mie/idiorm/issues/57) \[[ridgerunner](https://github.com/ridgerunner)\]

#### 1.1.1 - released 2011-01-30

[](#111---released-2011-01-30)

- Fix bug in quoting column wildcard. [j4mie/paris#12](https://github.com/j4mie/paris/issues/12)
- Small documentation improvements

#### 1.1.0 - released 2011-01-24

[](#110---released-2011-01-24)

- Add `is_dirty` method
- Add basic query caching
- Add `distinct` method
- Add `group_by` method

#### 1.0.0 - released 2010-12-01

[](#100---released-2010-12-01)

- Initial release

###  Health Score

24

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 51.8% 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

Unknown

Total

1

Last Release

1000d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e40b045cf0df877672003bf22ccc0416ecf24a44f7e1436d46178d1a31963933?d=identicon)[dodul](/maintainers/dodul)

---

Top Contributors

[![treffynnon](https://avatars.githubusercontent.com/u/65215?v=4)](https://github.com/treffynnon "treffynnon (236 commits)")[![j4mie](https://avatars.githubusercontent.com/u/6988?v=4)](https://github.com/j4mie "j4mie (145 commits)")[![charsleysa](https://avatars.githubusercontent.com/u/1219661?v=4)](https://github.com/charsleysa "charsleysa (15 commits)")[![lrlopez](https://avatars.githubusercontent.com/u/547387?v=4)](https://github.com/lrlopez "lrlopez (13 commits)")[![durhamhale](https://avatars.githubusercontent.com/u/621305?v=4)](https://github.com/durhamhale "durhamhale (6 commits)")[![moiseevigor](https://avatars.githubusercontent.com/u/993491?v=4)](https://github.com/moiseevigor "moiseevigor (4 commits)")[![sandermarechal](https://avatars.githubusercontent.com/u/145240?v=4)](https://github.com/sandermarechal "sandermarechal (4 commits)")[![CBeerta](https://avatars.githubusercontent.com/u/746999?v=4)](https://github.com/CBeerta "CBeerta (3 commits)")[![stellis](https://avatars.githubusercontent.com/u/2069140?v=4)](https://github.com/stellis "stellis (2 commits)")[![limenet](https://avatars.githubusercontent.com/u/474329?v=4)](https://github.com/limenet "limenet (2 commits)")[![hellogerard](https://avatars.githubusercontent.com/u/200488?v=4)](https://github.com/hellogerard "hellogerard (2 commits)")[![gsouf](https://avatars.githubusercontent.com/u/3215399?v=4)](https://github.com/gsouf "gsouf (2 commits)")[![m92o](https://avatars.githubusercontent.com/u/140899?v=4)](https://github.com/m92o "m92o (2 commits)")[![aaronpk](https://avatars.githubusercontent.com/u/113001?v=4)](https://github.com/aaronpk "aaronpk (2 commits)")[![Surt](https://avatars.githubusercontent.com/u/48085?v=4)](https://github.com/Surt "Surt (2 commits)")[![falmp](https://avatars.githubusercontent.com/u/94873?v=4)](https://github.com/falmp "falmp (2 commits)")[![uovidiu](https://avatars.githubusercontent.com/u/76910?v=4)](https://github.com/uovidiu "uovidiu (1 commits)")[![e3betht](https://avatars.githubusercontent.com/u/1811561?v=4)](https://github.com/e3betht "e3betht (1 commits)")[![fridde](https://avatars.githubusercontent.com/u/772964?v=4)](https://github.com/fridde "fridde (1 commits)")[![korotin](https://avatars.githubusercontent.com/u/277992?v=4)](https://github.com/korotin "korotin (1 commits)")

---

Tags

ormquery builderidiorm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/prepmock-idiorm/health.svg)

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

###  Alternatives

[j4mie/idiorm

A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5

2.0k1.4M27](/packages/j4mie-idiorm)[cycle/orm

PHP DataMapper ORM and Data Modelling Engine

1.3k811.9k58](/packages/cycle-orm)[nilportugues/sql-query-builder

An elegant lightweight and efficient SQL QueryInterface BuilderInterface supporting bindings and complicated query generation.

425237.5k6](/packages/nilportugues-sql-query-builder)[cycle/database

DBAL, schema introspection, migration and pagination

64665.8k22](/packages/cycle-database)[matchory/elasticsearch

The missing elasticsearch ORM for Laravel!

3057.6k](/packages/matchory-elasticsearch)[tommyknocker/pdo-database-class

Framework-agnostic PHP database library with unified API for MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, and Oracle. Query Builder, caching, sharding, window functions, CTEs, JSON, migrations, ActiveRecord, CLI tools, AI-powered analysis. Zero external dependencies.

815.7k](/packages/tommyknocker-pdo-database-class)

PHPackages © 2026

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