All data in StrataDB is represented by the Value enum — a closed set of 8 variants. There are no extensions and no implicit coercions.

The 8 Variants

VariantDescriptionCLI Example
NullAbsence of valuenull
Booltrue / falsetrue, false
Int64-bit signed integer42, -1
Float64-bit IEEE-754 floating point3.14, 0.7
StringUTF-8 stringhello, "hello world"
BytesRaw binary data(not directly supported in CLI)
ArrayOrdered sequence of values'[1, 2, 3]' (JSON)
ObjectString-keyed map (JSON object)'{"key":"value"}' (JSON)

Type Rules

StrataDB enforces strict typing with no surprises:

RuleDescriptionExample
VAL-1Exactly 8 types, no moreNo Timestamp, Decimal, or custom types
VAL-2No implicit coercionsStoring an integer doesn’t create a float
VAL-3Different types are never equalInt(1) != Float(1.0)
VAL-4Bytes are not stringsBytes(b"hello") != String("hello")
VAL-5IEEE-754 float equalityNaN != NaN, -0.0 == 0.0

CLI Type Detection

The CLI auto-detects types from input format. You rarely need to think about types:

$ strata --cache
strata:default/default> kv put name Alice
(version) 1
strata:default/default> kv put age 30
(version) 1
strata:default/default> kv put score 95.5
(version) 1
strata:default/default> kv put active true
(version) 1
strata:default/default> state set counter 0
(version) 1

Detection Rules

Input FormatDetected Type
true, falseBool
Digits only (e.g., 42, -1)Int
Digits with decimal (e.g., 3.14)Float
nullNull
JSON object '{...}'Object
JSON array '[...]'Array
Everything elseString

Reading Values

The CLI displays values in a readable format:

$ strata --cache
strata:default/default> kv put name Alice
(version) 1
strata:default/default> kv get name
"Alice"
strata:default/default> kv put count 42
(version) 1
strata:default/default> kv get count
42
strata:default/default> kv get missing
(nil)

Values that don’t exist return (nil).

Accessor Table

TypeCLI Display
Booltrue / false
Int42
Float3.14
String"Alice"
Nullnull
Array[1, 2, 3]
Object{"key":"value"}

JSON Interop

The CLI accepts JSON strings for complex values:

$ strata --cache
strata:default/default> json set config $ '{"key":42,"nested":[1,2,3]}'
(version) 1
strata:default/default> json get config
{"key":42,"nested":[1,2,3]}

Edge Cases in JSON Conversion

ValueTo JSONNotes
Float(NaN)nullLossy
Float(Infinity)nullLossy
BytesBase64 stringLossy round-trip
Int(i64::MAX)NumberLossless

The Bytes → JSON → Value round-trip is lossy: bytes become a base64 string, and converting back produces a String, not Bytes.

Event Log Payloads

Event log payloads must be JSON objects. Pass them as JSON strings:

$ strata --cache
strata:default/default> event append tool_call '{"tool":"search"}'
(seq) 1
strata:default/default> event append tool_call '{"tool":"search","results":10}'
(seq) 2

Next