fix docs and todo
This commit is contained in:
24
README.md
24
README.md
@@ -3,7 +3,7 @@
|
||||
A high-performance, DynamoDB-compatible database server written in Odin, backed by RocksDB.
|
||||
|
||||
```
|
||||
╦╔═╗╦═╗╔╦╗╦ ╦╔╗╔╔╦╗╔╗
|
||||
╦╔═╗╦═╗╔╦╗╦ ╦╔╗╔╔╦╗╔╗
|
||||
║║ ║╠╦╝║║║║ ║║║║ ║║╠╩╗
|
||||
╚╝╚═╝╩╚═╩ ╩╚═╝╝╚╝═╩╝╚═╝
|
||||
DynamoDB-Compatible Database
|
||||
@@ -55,7 +55,7 @@ sudo apt install librocksdb-dev libsnappy-dev liblz4-dev libzstd-dev libbz2-dev
|
||||
# Build the server
|
||||
make build
|
||||
|
||||
# Run with default settings (localhost:8000, ./data directory)
|
||||
# Run with default settings (localhost:8002, ./data directory)
|
||||
make run
|
||||
|
||||
# Run with custom port
|
||||
@@ -70,7 +70,7 @@ make run DATA_DIR=/tmp/jormundb
|
||||
```bash
|
||||
# Create a table
|
||||
aws dynamodb create-table \
|
||||
--endpoint-url http://localhost:8000 \
|
||||
--endpoint-url http://localhost:8002 \
|
||||
--table-name Users \
|
||||
--key-schema AttributeName=id,KeyType=HASH \
|
||||
--attribute-definitions AttributeName=id,AttributeType=S \
|
||||
@@ -78,26 +78,26 @@ aws dynamodb create-table \
|
||||
|
||||
# Put an item
|
||||
aws dynamodb put-item \
|
||||
--endpoint-url http://localhost:8000 \
|
||||
--endpoint-url http://localhost:8002 \
|
||||
--table-name Users \
|
||||
--item '{"id":{"S":"user123"},"name":{"S":"Alice"},"age":{"N":"30"}}'
|
||||
|
||||
# Get an item
|
||||
aws dynamodb get-item \
|
||||
--endpoint-url http://localhost:8000 \
|
||||
--endpoint-url http://localhost:8002 \
|
||||
--table-name Users \
|
||||
--key '{"id":{"S":"user123"}}'
|
||||
|
||||
# Query items
|
||||
aws dynamodb query \
|
||||
--endpoint-url http://localhost:8000 \
|
||||
--endpoint-url http://localhost:8002 \
|
||||
--table-name Users \
|
||||
--key-condition-expression "id = :id" \
|
||||
--expression-attribute-values '{":id":{"S":"user123"}}'
|
||||
|
||||
# Scan table
|
||||
aws dynamodb scan \
|
||||
--endpoint-url http://localhost:8000 \
|
||||
--endpoint-url http://localhost:8002 \
|
||||
--table-name Users
|
||||
```
|
||||
|
||||
@@ -163,15 +163,15 @@ handle_request :: proc(conn: net.TCP_Socket) {
|
||||
arena: mem.Arena
|
||||
mem.arena_init(&arena, make([]byte, mem.Megabyte * 4))
|
||||
defer mem.arena_destroy(&arena)
|
||||
|
||||
|
||||
context.allocator = mem.arena_allocator(&arena)
|
||||
|
||||
|
||||
// Everything below uses the arena automatically
|
||||
// No manual frees, no errdefer cleanup needed
|
||||
request := parse_request() // Uses context.allocator
|
||||
response := process(request) // Uses context.allocator
|
||||
send_response(response) // Uses context.allocator
|
||||
|
||||
|
||||
// Arena is freed here automatically
|
||||
}
|
||||
```
|
||||
@@ -243,7 +243,7 @@ Scan (full table) | 5000 ops | 234.56 ms | 21320 ops/sec
|
||||
### Environment Variables
|
||||
|
||||
```bash
|
||||
JORMUN_PORT=8000 # Server port
|
||||
JORMUN_PORT=8002 # Server port
|
||||
JORMUN_HOST=0.0.0.0 # Bind address
|
||||
JORMUN_DATA_DIR=./data # RocksDB data directory
|
||||
JORMUN_VERBOSE=1 # Enable verbose logging
|
||||
@@ -275,7 +275,7 @@ chmod 755 ./data
|
||||
Check if the port is already in use:
|
||||
|
||||
```bash
|
||||
lsof -i :8000
|
||||
lsof -i :8002
|
||||
```
|
||||
|
||||
### "Invalid JSON" errors
|
||||
|
||||
Reference in New Issue
Block a user