PHPackages                             initphp/database - 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. initphp/database

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

initphp/database
================

InitPHP Database — QueryBuilder, DBAL and ORM facade for the InitORM stack, plus a server-side DataTables.js helper.

4.0.0(1mo ago)6243MITPHPPHP ^8.1CI passing

Since Aug 20Pushed 3w ago1 watchersCompare

[ Source](https://github.com/InitPHP/Database)[ Packagist](https://packagist.org/packages/initphp/database)[ Docs](https://github.com/InitPHP/Database)[ RSS](/packages/initphp-database/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (6)Versions (27)Used By (0)

InitPHP Database
================

[](#initphp-database)

A Composer-friendly, batteries-included facade over the [InitORM](https://github.com/InitORM) stack — query builder, DBAL connection, ORM models and entities — plus a server-side helper for [DataTables.js](https://datatables.net/).

[![CI](https://github.com/InitPHP/Database/actions/workflows/ci.yml/badge.svg)](https://github.com/InitPHP/Database/actions/workflows/ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/4dee8bfe662a6a99e938229ee131d6f0811ae57ca272dc1eace77762f33d4b5c/68747470733a2f2f706f7365722e707567782e6f72672f696e69747068702f64617461626173652f76)](https://packagist.org/packages/initphp/database)[![Total Downloads](https://camo.githubusercontent.com/3c66d5f890659b8cba4da21fcce466413ae93c2107ea7921a814ccee99e44bf2/68747470733a2f2f706f7365722e707567782e6f72672f696e69747068702f64617461626173652f646f776e6c6f616473)](https://packagist.org/packages/initphp/database)[![License](https://camo.githubusercontent.com/e18586807e8bc2893cc09d70367da4c1ef908456897b8e2edaaaf6a76f3d30d9/68747470733a2f2f706f7365722e707567782e6f72672f696e69747068702f64617461626173652f6c6963656e7365)](https://packagist.org/packages/initphp/database)[![PHP Version Require](https://camo.githubusercontent.com/a8b9bfafca1fabef6b70fa9044fedc0804807811162d13f50917a5e8e471d061/68747470733a2f2f706f7365722e707567782e6f72672f696e69747068702f64617461626173652f726571756972652f706870)](https://packagist.org/packages/initphp/database)

What is this?
-------------

[](#what-is-this)

`initphp/database` does not reimplement an ORM. It is the InitPHP-branded entry point to the InitORM stack:

You writeYou actually get`InitPHP\Database\DB`A static facade over `InitORM\Database\Database`.`InitPHP\Database\Database`The InitORM Database class.`InitPHP\Database\Model`The InitORM active-record Model.`InitPHP\Database\Entity`The InitORM Entity with accessor / mutator hooks.`InitPHP\Database\Utils\Datatables\Datatables`**Original** server-side DataTables.js helper — the one piece that lives in this package.If a feature is documented for InitORM, it works here under the InitPHP namespace.

Requirements
------------

[](#requirements)

- PHP **8.1** or later
- `ext-pdo` and a PDO driver for your target database (`pdo_mysql`, `pdo_pgsql`, `pdo_sqlite`, …)

Installation
------------

[](#installation)

```
composer require initphp/database
```

Quick start
-----------

[](#quick-start)

```
