An open API service indexing awesome lists of open source software.

https://github.com/commandstring/jsondb

Build your database with JSONs
https://github.com/commandstring/jsondb

Last synced: 8 months ago
JSON representation

Build your database with JSONs

Awesome Lists containing this project

README

          

# commandstring/jsondb #

A fully customizable JSON Database system structured similarly to MySQL

# Creating a database

```php
yourtable->newRow();

$row->setColumn($db->yourtable::COLUMN_NAME, "") // you can pass a string for the column name but I recommend having constants has mentioned earlier

$row = $row->store(); // returns that same row but this is associated to specific point in the JSON file
```

# Fetching rows

```php
/**
* @var Row[]
*/
$results = $db->yourtable->newQuery()->whereAnd($db->yourtable::COLUMN_NAME, Operators::EQUAL_TO, "")->execute();
```

# Updating rows
```php
$row = $results[0];

$row->setColumn($db->yourtable::COLUMN_NAME, "");

$row->store(); // updated the row
```