Global options

These flags sit before the command and apply to all of them. strata --json ./db kv get k and strata ./db --json kv get k are the same line.

Choosing the database

strata ./mydb kv get k
strata --db ./mydb kv get k
strata --cache kv get k

The positional path and --db are the same thing and cannot be combined.

--cache opens an in-memory database instead: nothing is written to disk and nothing survives the process, which is what you want in a test.

STRATA_DB names a default path, so a shell that exports it can drop the argument entirely.

Output formats

Three formats, and the one you get when you ask for nothing is the one meant for a person.

flagforshape
--humana readerlines, tables and one-line receipts
--jsona programone compact JSON document, enveloped and typed
--rawa shellbare values, tab-separated, no header or summary

The same read in each:

strata ./db kv get greeting
strata --raw ./db kv get greeting
strata --json ./db kv get greeting
hello
hello
{"data":{"found":true,"value":{"timestamp":3,"value":"aGVsbG8=","version":3}},"type":"kv_versioned_value"}

A list is where they diverge most. --human draws a table, --raw drops the header so cut and awk work:

strata ./db kv scan --limit 2
KEY  VERSION  VALUE
a          3  1
b          4  2
strata --raw ./db kv scan --limit 2
a	3	1
b	4	2

A write is a receipt in --human, its identity alone in --raw, and the full commit record in --json:

strata ./db kv put c 3
strata --raw ./db kv put d 4
created c
d

--human is worth naming explicitly in one case: a line inside a session that was opened with --json or --raw inherits that session's format, and

--human is how you get a reader's lines back for one command.

--json is the stable contract. It is the format to parse, and the only one whose shape is promised across releases.

Values that are not text

--human marks an encoded value rather than handing you something ambiguous:

strata ./db kv get raw
base64:AAH/

The base64: prefix means a value that happens to read as AAH/ cannot be confused with one that was encoded. For the bytes themselves, ask --raw, which writes them exactly and adds no trailing newline, so the file round trips back through kv put --file:

strata --raw ./db kv get raw > payload.bin

Inside a session or a pipe each answer still ends with a line break. That separator belongs to the stream, not to the value.

Durability and sharing

strata --durability always ./db kv put k v
strata --ipc off ./db kv get k
strata --read-only ./db kv get k

--durability is standard by default, which acknowledges from a buffered write-ahead log and syncs at close or at a threshold. always syncs every commit before acknowledging it.

--ipc decides how a durable database is shared. host, the default, wins the lock and serves a socket other processes broker to; client brokers to an existing owner without hosting one; off opts out of both, for a single process with no socket.

--read-only rejects every write-classified command, enforced by the owner's dispatch gate when brokered and at the connection otherwise.

Defaults for branch and space

strata --branch work ./db kv get k
strata --space analytics ./db kv get k

Both set the default for commands that accept one, so they save repeating the flag. Branches and Spaces cover what they select.

Edit this page · Report an issue