PHPackages                             pinoox/devdb - 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. pinoox/devdb

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

pinoox/devdb
============

Development-only JSON/SQLite database driver for Pinoox apps

1.4.7(1mo ago)1274—1.4%2MITPHPPHP ^8.2

Since Jul 2Pushed 1mo agoCompare

[ Source](https://github.com/pinoox/devdb)[ Packagist](https://packagist.org/packages/pinoox/devdb)[ Docs](https://www.pinoox.com/)[ RSS](/packages/pinoox-devdb/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (12)Versions (7)Used By (2)

DevDB
=====

[](#devdb)

DevDB is a development-only database component for PHP projects. It gives you a small local database with a raw SQL translator for common development queries, so you can build and test features without installing MySQL, PostgreSQL, or SQLite.

DevDB uses SQLite when available and automatically falls back to a zero-dependency JSON database when it is not.

DevDB is designed for local development, prototypes, tests, demos, package examples, and single-user tooling. It is not a production database.

Why DevDB?
----------

[](#why-devdb)

Use DevDB when you want a project to run immediately on a developer machine, CI job, demo environment, or package example without asking people to install and configure a database server first.

DevDB is useful for:

- local development without MySQL, PostgreSQL, or SQLite setup
- package examples and documentation demos
- quick prototypes and throwaway experiments
- tests that need simple persistent data
- single-user developer tools
- importing simple MySQL-style schema dumps for local inspection
- trying application flows before choosing the final database

DevDB is not meant for:

- production applications
- multi-user or high-concurrency workloads
- large datasets
- strict relational integrity
- full SQL compatibility
- performance benchmarking
- replacing SQLite, MySQL, PostgreSQL, or SQL Server in deployed systems

The short version: DevDB removes setup friction during development. Use it to start fast, test ideas, and keep examples portable. Switch to SQLite or a real database when correctness, scale, concurrency, or production reliability matters.

Table of Contents
-----------------

[](#table-of-contents)

- [Why DevDB?](#why-devdb)
- [Features](#features)
- [Installation](#installation)
- [Normal PHP Usage](#normal-php-usage)
- [PDO and mysqli-like Adapters](#pdo-and-mysqli-like-adapters)
- [Using DevDB in Pinoox](#using-devdb-in-pinoox)
- [Using DevDB in Laravel](#using-devdb-in-laravel)
- [Storage Format](#storage-format)
- [Compatibility Matrix](#compatibility-matrix)
- [Raw SQL Support](#raw-sql-support)
- [Schema SQL Support](#schema-sql-support)
- [Snapshots and Change Manifests](#snapshots-and-change-manifests)
- [Standalone API](#standalone-api)
- [Laravel-Compatible Connection](#laravel-compatible-connection)
- [CLI Commands](#cli-commands)
- [Troubleshooting](#troubleshooting)
- [Performance Expectations](#performance-expectations)
- [Limitations](#limitations)
- [Package Structure](#package-structure)
- [Development](#development)
- [License](#license)

Features
--------

[](#features)

- JSON-backed local database storage.
- SQLite-first local storage with automatic JSON fallback.
- Engine abstraction for SQLite and JSON storage backends.
- No external database service required.
- File-based schema, data, migrations, and sequence metadata.
- File locking for JSON writes.
- Auto-increment sequences.
- Named snapshots for quick save and restore during development.
- Change manifests for detecting external JSON file changes.
- Common CRUD query support.
- Raw SQL translator for common `SELECT`, `INSERT`, `UPDATE`, `DELETE`, and `TRUNCATE` statements.
- Multi-statement SQL dump execution for common MySQL exports.
- Lightweight `EXPLAIN` output for debugging translated queries.
- Strict development checks for `NOT NULL`, `ENUM`, `UNIQUE`, and simple foreign keys.
- PDO-like and mysqli-like adapters for plain PHP projects.
- SQL functions such as `DATE`, `LOWER`, `COALESCE`, `CONCAT`, `ROUND`, and more.
- A standalone PHP API through `Pinoox\DevDB\DevDatabase`.
- A Laravel-compatible connection class through `Pinoox\Component\Database\Connections\DevDbConnection`.
- Development-only by design.

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

[](#installation)

```
composer require --dev pinoox/devdb
```

Normal PHP Usage
----------------

[](#normal-php-usage)

Use `Pinoox\DevDB\DevDatabase` when you want DevDB as a standalone component outside any framework.

```
