https://github.com/fadhil-riyanto/fdatabase
a key value database base on json and program memory
https://github.com/fadhil-riyanto/fdatabase
json key-value-database
Last synced: 10 months ago
JSON representation
a key value database base on json and program memory
- Host: GitHub
- URL: https://github.com/fadhil-riyanto/fdatabase
- Owner: fadhil-riyanto
- License: mit
- Created: 2021-11-15T11:14:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-17T14:10:42.000Z (over 4 years ago)
- Last Synced: 2025-03-30T19:31:41.257Z (about 1 year ago)
- Topics: json, key-value-database
- Language: Hack
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# how to use
```hack
<<__EntryPoint>>
function main(): noreturn {
require(__DIR__ . "/../src/Utils.hh");
require(__DIR__ . '/../src/main.hh');
$db = new fdatabase("db.fdb", dict[
"set_load_file" => true
]);
$db->set("foUoe", "bare", true);
$db->commit(); // commit to file
echo $db->get("foUoe");
}
```
# method
+ set(key, value, overwritten)
- key is a identifier of value
- value is a content
- overwritten is condition, default is true. turn false if you not overwrite the data
+ del(key)
- key to delete
+ commit()
- for append data from memory to non volatile file
+ get(key)
- getting the key
# note
the file in construct class of fdatabase must be exist!