PHPackages                             journey/dblite - 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. journey/dblite

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

journey/dblite
==============

Micro SQLite+PDO wrapper for use in micro-frameworks; written in php

029PHP

Since Jan 3Pushed 9y ago2 watchersCompare

[ Source](https://github.com/journeygroup/dblite)[ Packagist](https://packagist.org/packages/journey/dblite)[ RSS](/packages/journey-dblite/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

DBLite
------

[](#dblite)

Why
===

[](#why)

Small serverless databases can be extremely useful in micro frameworks. SQLite (3) provides an excellent storage engine for these databases, and PDO offers a painless way to query and work with SQL result sets. DBLite simply combines the two in a easy to use wrapper for quick configuration.

Usage
=====

[](#usage)

### Installation

[](#installation)

To add DBLite to your project, just use composer:

```
composer require journeygroup/dblite dev-master

```

### Configuration

[](#configuration)

DBLite only requires 1 configuration option (its not called *lite* for nothing). These are all the possible configuration options:

```
$config = [
    'storage' => 'path/to/storage/dir',             # Required storage path
    'name' => 'your-database.db',                   # (optional) database name
    'tables' => [                                   # (optional) tables to create
        'table_one' => 'CREATE TABLE table_one ...' # (optional) CREATE TABLE sql statement
    ]
];
```

To use them, simply instantiate the database class:

```
$db = new Journey\DBLite($config);
```

*or*

```
# Configure once for your application
Journey\DBLite::config($config);

# Access methods statically
Journey\DBLite::query('SELECT * FROM mytable');
```

**When DBLite is instantiated, it will check for a the presence a database, if it doesn't exist, it will automatically create the database and add the tables in the configuration file.**

### Querying

[](#querying)

Any call to a [PDO method](http://php.net/manual/en/book.pdo.php) is valid, and methods can be called statically or on an instance of DBLite. When called statically, only configuration options of the *first instantiated* database will be used.

```
use Journey\DBLite;

# Example configuration
DBLite::config([
    'storage' => './storage',
    'tables' => parse_ini_file('./tables.ini')
]);

# Example Prepared Insert
DBLite::prepare('INSERT INTO mytable (first, last) VALUES(?, ?)')
    ->execute(['Journey', 'Group']);

# Example Query Statement
foreach (DBLite::query('SELECT * FROM mytable') as $row) {
    var_dump($row);
}
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/db85c379f90173f437183b21df031e20997aaac69c7046fd927c2a3b57663d39?d=identicon)[justin-schroeder](/maintainers/justin-schroeder)

---

Top Contributors

[![justin-schroeder](https://avatars.githubusercontent.com/u/1950463?v=4)](https://github.com/justin-schroeder "justin-schroeder (7 commits)")

### Embed Badge

![Health badge](/badges/journey-dblite/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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