GET
Gets a value from memory.
SET
Sets a value with the given key in memory & writes to cache.
DELETE
Deletes a value from memory & removes it from cache.
create_backup
Create a backup in the `/backups` folder asynchronously & export it as either JSON or CSV.
By default, it exports it as JSON. But you can export it as CSV by adding the --csv flag.
A backups directory is created if it doesn't exist where all the backup files will be stored. Make sure you don't modify the names of the files, otherwise the Database won't be able to load backups.
load_backup
Gets/Parses a backup file and replaces the current data in the memory + cache with the backup data.
2023/06/07 13:41:41 Starting Gedis server
2023/06/07 13:41:41 Gedis server listening on port 5000
Enter .exit to stop the server.
gedis> GET hello
<nil>
.
.
.
gedis> SET hello world
gedis> GET hello
world
.
.
.
gedis> DELETE hello
gedis> GET hello
<nil>
.
.
.
gedis> create_backup
Backup created successfully
.
.
gedis> create_backup --csv
Backup created successfully
gedis> ^Z
[1] + 24587 suspended ./gedis
.
$ ls
.cache
backups
gedis
$ ls backups
backup-070623-14:46:35.json
backup-070623-14:46:41.csv
$ fg
[1] + 24587 continued ./gedis
.
gedis> SET hello world
.
gedis> load_backup backup-070623-14:46:35.json
Backup loaded into memory
gedis> GET hello
<nil>