aarondb/fact
Types
pub type Attribute =
String
pub type AttributeConfig {
AttributeConfig(
unique: Bool,
component: Bool,
retention: Retention,
cardinality: Cardinality,
check: option.Option(String),
composite_group: option.Option(String),
layout: StorageLayout,
tier: StorageTier,
eviction: EvictionPolicy,
)
}
Constructors
-
AttributeConfig( unique: Bool, component: Bool, retention: Retention, cardinality: Cardinality, check: option.Option(String), composite_group: option.Option(String), layout: StorageLayout, tier: StorageTier, eviction: EvictionPolicy, )
pub type Cardinality {
One
Many
}
Constructors
-
One -
Many
pub type EntityId {
EntityId(Int)
}
Constructors
-
EntityId(Int)
pub type EvictionPolicy {
AlwaysInMemory
LRU(Int)
LruToDisk
}
Constructors
-
AlwaysInMemory -
LRU(Int) -
LruToDisk
pub type Operation {
Assert
Retract
}
Constructors
-
Assert -
Retract
pub type Retention {
All
LatestOnly
Last(Int)
}
Constructors
-
All -
LatestOnly -
Last(Int)
pub type StorageLayout {
Row
Columnar
}
Constructors
-
Row -
Columnar
pub type StorageTier {
Memory
Disk
}
Constructors
-
Memory -
Disk
pub type Transaction =
Int
Values
pub fn compare(v1: Value, v2: Value) -> order.Order
pub fn decode_compact(
bits: BitArray,
) -> Result(#(Value, BitArray), Nil)
pub fn decode_datom(
bits: BitArray,
) -> Result(#(Datom, BitArray), Nil)
pub fn deterministic_uid(data: a) -> Eid
Create a deterministic Entity ID based on a hash of the data. This enables idempotent transaction semantics.
pub fn eid_to_integer(eid: EntityId) -> Int
pub fn encode_compact(v: Value) -> BitArray
pub fn encode_datom(d: Datom) -> BitArray
pub fn event_uid(event_type: String, timestamp: Int) -> Eid
Create a unique, deterministic Entity ID for an event based on its type and timestamp. This ensures that the same event instance (e.g. from retries) always gets the same ID.
pub fn integer_to_eid(i: Int) -> EntityId
pub fn new_datom(
entity entity: EntityId,
attribute attribute: String,
value value: Value,
tx tx: Int,
tx_index tx_index: Int,
operation operation: Operation,
) -> Datom
Create a new Datom with default valid_time = 0.
pub fn phash2(data: a) -> Int