dwgebler/doclite
Composer 安装命令:
composer require dwgebler/doclite
包简介
A powerful NoSQL data store built on top of SQLite
README 文档
README
A powerful PHP NoSQL document store built on top of SQLite.
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', 'alice@example.com'); $alice->save(); $found = $users->findOneBy(['email' => 'alice@example.com']); echo $found->getValue('name'); // Alice
Documentation
- Getting started — installation, requirements, your first database
- Collections & documents — CRUD, transactions, schemas, custom class mapping
- Queries — query builder, joins, pagination, aggregation, indexing
- Full-text search — FTS5-powered search
- Advanced — import/export, journal modes, JSONB, PSR-16 cache adapter, logging
- Symfony integration — wiring DocLite into a Symfony app
License
MIT. See LICENSE.
Reporting bugs
Please raise an issue on GitHub.
Reporting vulnerabilities
See SECURITY.md.
统计信息
- 总下载量: 462
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 90
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-02