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
- Host: GitHub
- URL: https://github.com/commandstring/jsondb
- Owner: CommandString
- Created: 2023-01-31T03:17:58.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-05T17:28:55.000Z (almost 3 years ago)
- Last Synced: 2025-02-16T16:57:58.345Z (10 months ago)
- Language: PHP
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```