Home
Softono
doclite

doclite

Open source MIT PHP
90
Stars
6
Forks
5
Issues
5
Watchers
2 weeks
Last Commit

About doclite

PHP NoSQL database and document store

Platforms

Web Self-hosted

Languages

PHP

DocLite

A powerful PHP NoSQL document store built on top of SQLite.

CI

About

DocLite is a NoSQL document store for PHP built on SQLite. It uses the PHP PDO SQLite library to automatically manage documents organised into named collections, stored as JSON. DocLite takes advantage of the SQLite JSON1 extension to store, parse, index, and query JSON documents — giving you the power of a fully transactional, ACID-compliant NoSQL solution contained entirely within the local filesystem.

DocLite lends itself to a variety of use cases: rapid prototyping, small-to-medium websites and applications, a fast local cache for remote API data, a robust replacement for flat-file stores, and a database for microservices or local web apps. Broadly, it suits the same use cases as SQLite itself, but where a NoSQL document model is preferred.

Install

composer require dwgebler/doclite

Requires PHP 8.1+ and the pdo_sqlite extension.

Upgrading from 1.x? See UPGRADE-2.0.md.

Quick start

use Gebler\Doclite\FileDatabase;

$db = new FileDatabase('./data');
$users = $db->collection('users');

$alice = $users->get();
$alice->setValue('name', 'Alice');
$alice->setValue('email', '[email protected]');
$alice->save();

$found = $users->findOneBy(['email' => '[email protected]']);
echo $found->getValue('name'); // Alice

Documentation

License

MIT. See LICENSE.

Reporting bugs

Please raise an issue on GitHub.

Reporting vulnerabilities

See SECURITY.md.