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

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

jelix/database
==============

Lightweight PHP abstraction layer to access and query SQL databases, with an API to inspect and modify databases schema.

v1.3.2(2y ago)03.3k↑44.6%21LGPL-2.1PHPPHP &gt;=7.2

Since Mar 3Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/jelix/JelixDatabase)[ Packagist](https://packagist.org/packages/jelix/database)[ Docs](https://jelix.org)[ RSS](/packages/jelix-database/feed)WikiDiscussions master Synced 1mo ago

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

Lightweight PHP abstraction layer to access and query SQL databases.

It uses the dedicated PHP API for each database type it supports, not PDO. The API of connectors and result sets are almost the same as in PDO. There is an API to manipulate schemas.

It supports Mysql 5.6+, Postgresql 9.6+, Sqlite 3. It supports partially (Schema API not fully implemented) SQLServer 2012+ and OCI. There is a connector using PDO, so you can use other databases (except with the Schema API).

This library has been extracted from the [Jelix](https://jelix.org) framework 1.7, and has been modernized.

installation
============

[](#installation)

You can install it from Composer. In your project:

```
composer require "jelix/database"

```

Usage
=====

[](#usage)

Quick start:

```
use \Jelix\Database\AccessParameters;
use \Jelix\Database\Connection;

// parameters to access to a database. they can come from a configuration file or else..
$parameters = array(
  'driver'=>'sqlite3',
  "database"=>"/app/tests/units/tests.sqlite3",
);

// verify content of parameters and prepare them for the Connection object.
$accessParameters = new AccessParameters($parameters, array('charset'=>'UTF-8'));

// then you can retrieve a connector
$db = Connection::create($accessParameters);

// let's insert some values
$insertSql = "INSERT INTO ".$db->encloseName('myValues')." (
     ".$db->encloseName('id'). ",
     ".$db->encloseName('value')."
      ) VALUES ";

$value = 'foo';

// insert one value with a classical query
$db->exec($insertSql." (1, ".$db->quote($value).")");

// insert one value with a prepared query
$stmt = $db->prepare($insertSql."(:id, :val)");
$stmt->bindValue('id', 2, \PDO::PARAM_INT);
$myVar = 'bar';
$stmt->bindParam('value', $myVar, \PDO::PARAM_STR);
$stmt->execute();

// retrieve all records
$resultSet = $db->query("SELECT id, value FROM myValues");

// records are always objects
foreach ($resultSet as $record) {
    echo "id=".$record->id."\n";
    echo "value=".$record->value."\n";
}
```

Full documentation : see the [docs](docs/en/index.md) directory.

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance59

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

Every ~167 days

Recently: every ~197 days

Total

14

Last Release

81d ago

Major Versions

v0.1.0 → v1.0.02020-08-03

### Community

Maintainers

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

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

---

Top Contributors

[![laurentj](https://avatars.githubusercontent.com/u/336034?v=4)](https://github.com/laurentj "laurentj (146 commits)")[![mind84](https://avatars.githubusercontent.com/u/20710470?v=4)](https://github.com/mind84 "mind84 (2 commits)")[![nworr](https://avatars.githubusercontent.com/u/43475951?v=4)](https://github.com/nworr "nworr (2 commits)")[![lejoko](https://avatars.githubusercontent.com/u/983680?v=4)](https://github.com/lejoko "lejoko (1 commits)")

---

Tags

schemadatabasemysqlpostgresqlsqlsqlserverociabstract layer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jelix-database/health.svg)

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

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[ezsql/ezsql

Advance database access library. Make interacting with a database ridiculously easy. An universal interchangeable CRUD system.

86946.7k](/packages/ezsql-ezsql)[aura/sqlschema

Provides facilities to read table names and table columns from a database using PDO.

41234.1k4](/packages/aura-sqlschema)[jv2222/ezsql

Advance database access library. Make interacting with a database ridiculously easy. An universal interchangeable CRUD system.

87311.3k2](/packages/jv2222-ezsql)[cycle/database

DBAL, schema introspection, migration and pagination

64690.9k31](/packages/cycle-database)

PHPackages © 2026

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