class TrailDB
- TrailDB
- Reference
- Object
Overview
Load a TrailDB, including metadata and a trails iterator
Defined in:
traildb.crConstructors
-
.new(path : String)
Load a TrailDB at path (the
.tdb
extension is optional).
Instance Method Summary
-
#[](uuidish : String | UInt64 | Int32)
Return a iterator for the given UUID.
-
#create_filter(query : TrailDBEventFilterQuery, set_filter : Bool = false)
Create TrailDB filter
-
#db : Pointer(Void)
Raw TrailDB pointer.
-
#event_filter : TrailDBEventFilter?
The current event filter.
-
#event_filter=(event_filter : Nil | TrailDBEventFilter)
The current event filter.
-
#field(fieldish : TrailDBField) : TdbField
Return a field ID for given a field name or field ID.
-
#fields : Array(String)
Field strings.
- #finalize
-
#get_item(fieldish : String, value : String) : TdbItem
Return the item corresponding to a field ID or a field name and a string value.
-
#get_item_value(item : TdbItem) : String
Return the string value corresponding to an item.
-
#get_trail_id(uuid : String)
Return Trail ID given a UUID.
-
#get_uuid(trail_id : UInt64 | Int32, raw = false) : String
Return UUID given a Trail ID.
-
#get_value(fieldish : TrailDBField, val : TdbVal) : String
Return the string value corresponding to a field ID or a field name and a value ID.
-
#includes?(uuidish)
Return true if UUID or Trail ID exists in this TrailDB.
-
#lexicon(fieldish : TrailDBField)
Return an iterator over values of the given field ID or field name.
-
#lexicon_size(fieldish : TrailDBField) : TdbVal
Return the number of distinct values in the given field ID or field name.
-
#max_timestamp
Return the maximum time stamp of this TrailDB.
-
#min_timestamp
Return the minimum time stamp of this TrailDB.
-
#num_events : UInt64
Number of events.
-
#num_fields : UInt64
Number of fields.
-
#num_trails : UInt64
Number of trails.
-
#parse_timestamp : Bool
Whether to parse timestamp as a Time, or leave as UInt64
-
#parse_timestamp=(parse_timestamp : Bool)
Whether to parse timestamp as a Time, or leave as UInt64
-
#reuse_cursor : Bool
Whether to reuse the TrailDB cursor.
-
#reuse_cursor=(reuse_cursor : Bool)
Set whether to reuse the TrailDB cursor
-
#time_range
Return the time range covered by this TrailDB.
-
#trails
Return a iterator for all trails.
Constructor Detail
Instance Method Detail
Create TrailDB filter
The current event filter. Set to nil to remove.
Return a field ID for given a field name or field ID.
Return the item corresponding to a field ID or a field name and a string value.
Return the string value corresponding to an item.
Return the string value corresponding to a field ID or a field name and a value ID.
Return an iterator over values of the given field ID or field name.
Return the number of distinct values in the given field ID or field name.
Whether to parse timestamp as a Time, or leave as UInt64
Whether to reuse the TrailDB cursor. Enabling this prevents out-of-order access of events in trails, but makes iteration more efficient.