Download the PHP package meita/jsonbolt without Composer
On this page you can find all versions of the php package meita/jsonbolt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package jsonbolt
JSONBolt (DBE)
JSONBolt is a fast file-based JSON database engine for PHP. It stores collections as JSON files, provides CRUD, a fluent query builder, relationships, and caching. It works in any PHP framework and includes optional Laravel integration.
Composer package: meita/jsonbolt. PHP namespace: Meita\\JsonBolt.
Features
- JSON file storage with atomic writes and file locks
- CRUD operations and bulk inserts
- Fluent query builder with common operators
- Relationships: hasOne, hasMany, belongsTo, belongsToMany
- PSR-16 caching with built-in FileCache and ArrayCache
- Framework-agnostic core with optional Laravel service provider and facade
Requirements
- PHP 8.0+
- ext-json
Installation
Quick start
Data layout
Each collection is stored as a single JSON file:
data/users.jsondata/orders.json
Metadata is stored in data/.dbe.meta.json for ID counters and cache versions.
Configuration options
ID strategies
increment(default): auto-increment integer IDs per collectionrandom: 16 hex chars fromrandom_bytes
CRUD operations
Query builder
Supported operators
=,==,!=,<>,>,>=,<,<=in,not incontains(arrays or substring in strings)starts_with,ends_withbetween(array with [min, max])like(SQL-style % and _ wildcards)
Bulk updates and deletes
Relationships
Define relations in the database options:
Pivot collection example:
Use with() for eager loading:
Nested relations are supported:
Tip: For best results, always set foreignKey and localKey explicitly. The
default key guessing is intentionally simple.
Caching
JSONBolt uses PSR-16 caching. You can use any adapter. Built-in caches:
Meita\JsonBolt\Cache\ArrayCache(in-memory)Meita\JsonBolt\Cache\FileCache(fast disk cache)Meita\JsonBolt\Cache\NullCache(disable caching)
Cache keys are automatically versioned per collection, so writes invalidate old query caches without clearing the entire cache store.
Full example
Laravel integration (optional)
1) Require Laravel support:
2) Register the service provider and facade:
3) Publish config (optional):
Example in Laravel:
Notes and limitations
- This is a file-based engine; it loads a collection into memory on read.
- Writes replace the entire collection file (with locks and atomic rename).
- For very large datasets, consider a dedicated database server.
License
MIT