Skip to main content

Module metadata

Module metadata 

Source
Expand description

Type-Aware Metadata Storage

Provides efficient, normalized metadata storage inspired by ChromaDB’s approach of using separate columns for each data type.

§Type-Aware Pattern

Instead of a single variant column that wastes space:

| id | key | string_val | int_val | float_val | bool_val |
| 1  | "name" | "Alice" | NULL | NULL | NULL |
| 1  | "age" | NULL | 25 | NULL | NULL |

We store in type-specific B-trees:

string_values: (entity_id, key) → String
int_values: (entity_id, key) → i64
float_values: (entity_id, key) → f64
bool_values: (entity_id, key) → bool

Benefits:

  • No NULL storage overhead
  • Type-specific indexing (range queries on ints)
  • Efficient filtering

Structs§

Metadata
Metadata for an entity (key-value pairs)
MetadataStorage
Type-aware metadata storage

Enums§

MetadataFilter
Metadata filter operations
MetadataType
Metadata type enumeration
MetadataValue
Metadata value types
RefTarget
Reference target for metadata cross-links
TypedColumn
Type-specific column for efficient storage