A simple in-memory database with transaction support and write-ahead logging.
ValoraDB uses a simple JSON configuration file to manage its settings. The configuration file is named config.json and should be located in the same directory as the application executable.
wal: WAL-specific configurationdirectory: Directory where WAL files are stored (default:./data/wal)segmentSize: Maximum size of each WAL segment in bytes (default: 16MB)
{
"wal": {
"directory": "./data/wal",
"segmentSize": 16777216
}
}To start the database:
go run .
Or if you've built the binary:
./valoradb
ValoraDB supports the following commands:
SET key value- Set a key to a valueGET key- Get the value of a keyDEL key- Delete a keyEXISTS key- Check if a key existsTYPE key- Get the type of a key's valueKEYS pattern- Find keys matching a patternBEGIN- Start a transactionCOMMIT- Commit a transactionROLLBACK- Rollback a transactionADD key value- Add a value to a key (numeric only)SUB key value- Subtract a value from a key (numeric only)MUL key value- Multiply a key by a value (numeric only)DIV key value- Divide a key by a value (numeric only)CLEAR- Clear all keys
SET counter 10
ADD counter 5
GET counter # Returns 15
BEGIN
SUB counter 2
GET counter # Returns 13
ROLLBACK
GET counter # Returns 15