PHPackages                             wallrio/deskdb - 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. wallrio/deskdb

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

wallrio/deskdb
==============

A small embedded database, based on JSON format.

1.0.5(4y ago)052MITPHP

Since Jun 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/wallrio/deskdb)[ Packagist](https://packagist.org/packages/wallrio/deskdb)[ RSS](/packages/wallrio-deskdb/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (13)Used By (0)

DeskDB
======

[](#deskdb)

A small embedded database, based on JSON format.

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

[](#installation)

It's recommended that you use [Composer](https://getcomposer.org/) to install Directly.

```
$ composer require wallrio/deskdb "*"
```

#### Instantiate a collection class

[](#instantiate-a-collection-class)

```
use deskdb\Collection as Collection;

$deskdb = new Collection(COLLECTION_NAME,DRIVER);
```

- Example

```
use deskdb\drivers\JSON as JSON;
use deskdb\Collection as Collection;

$collection = new Collection('users',new JSON(__DIR__.'/mybase/'));
```

> JSON, is the class responsible for effectively carrying out operations.

> JSON, if the contractor's value is omitted, then the system's temporary directory will be used.

#### Create a document

[](#create-a-document)

```
use deskdb\Document as Document;

$user = new Document();
$user->name = "Fulano da Silva";
$user->username = "fulano";
$user->password = md5("fulano");

$collection->post($user);
```

> [Another examples](help/another-examples.md)

#### Search all documents in the collection

[](#search-all-documents-in-the-collection)

```
$result = $collection->get();
```

#### Search for a document

[](#search-for-a-document)

```
$result = $collection->get(KEY,VALUE,OPERATOR);
```

- **KEY**: can be any document key
- **VALUE**: can be any document value, partial or whole
- **OPERATOR**: reference value to perform the search
    - **==:** search for a similar value
    - **!=:** search for different value
    - **===:** search by identical value
    - **!==:** look for exactly different value
    - **like**: look for a similar value (type soundex)
    - **!like**: search for unlike value (type soundex)
    - **contain**: search by value part
    - **!contain**: search for part of non-existent value

#### Search for the first document occurrence

[](#search-for-the-first-document-occurrence)

```
$result = $collection->getFirst(KEY,VALUE,OPERATOR);
```

#### Delete document

[](#delete-document)

```
$result = $collection->get();

$collection->delete($result);
```

> the value \*\* delete \*\* accepts an array of results

#### Update document

[](#update-document)

```
$result = $collection->getFirst();

$result->name="ANOTHER NAME";
$result->age="34";

$collection->put($result);
```

> the \*\* put \*\* value accepts an array of results

Recomendations
--------------

[](#recomendations)

It is explicitly recommended to use the code below to block the viewing of your JSON directories and documents.

Below example of script for blocking

##### APACHE

[](#apache)

Create an .htaccess file in your application's main directory

```
# Block directory list view
Options -Indexes

# Block the visualization of document JSON

Order Allow,Deny
Deny from all

```

##### NGINX

[](#nginx)

Insert the excerpt below into your server's nginx.conf file.

```
location ~ \.*_deskdb.json {
        deny all;
    }
```

License
-------

[](#license)

The DeskDB is licensed under the MIT license. See [License File](LICENSE) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~41 days

Recently: every ~32 days

Total

12

Last Release

1702d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8528598?v=4)[Wallace Rio](/maintainers/wallrio)[@wallrio](https://github.com/wallrio)

---

Top Contributors

[![wallrio](https://avatars.githubusercontent.com/u/8528598?v=4)](https://github.com/wallrio "wallrio (20 commits)")

### Embed Badge

![Health badge](/badges/wallrio-deskdb/health.svg)

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

###  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)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

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

Reliese Components for Laravel Framework code generation.

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

PHPackages © 2026

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