class TrailDB

Overview

Load a TrailDB, including metadata and a trails iterator

Defined in:

traildb.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(path : String) #

Load a TrailDB at path (the .tdb extension is optional).


[View source]

Instance Method Detail

def [](uuidish : String | UInt64 | Int32) #

Return a iterator for the given UUID.


[View source]
def create_filter(query : TrailDBEventFilterQuery, set_filter : Bool = false) #

Create TrailDB filter


[View source]
def db : Pointer(Void) #

Raw TrailDB pointer.


[View source]
def event_filter : TrailDBEventFilter? #

The current event filter. Set to nil to remove.


[View source]
def event_filter=(event_filter) #

The current event filter. Set to nil to remove.


[View source]
def field(fieldish : TrailDBField) : TdbField #

Return a field ID for given a field name or field ID.


[View source]
def fields : Array(String) #

Field strings.


[View source]
def finalize #

[View source]
def get_item(fieldish : String, value : String) : TdbItem #

Return the item corresponding to a field ID or a field name and a string value.


[View source]
def get_item_value(item : TdbItem) : String #

Return the string value corresponding to an item.


[View source]
def get_trail_id(uuid : String) #

Return Trail ID given a UUID.


[View source]
def get_uuid(trail_id : UInt64 | Int32, raw = false) : String #

Return UUID given a Trail ID.


[View source]
def get_value(fieldish : TrailDBField, val : TdbVal) : String #

Return the string value corresponding to a field ID or a field name and a value ID.


[View source]
def includes?(uuidish) #

Return true if UUID or Trail ID exists in this TrailDB.


[View source]
def lexicon(fieldish : TrailDBField) #

Return an iterator over values of the given field ID or field name.


[View source]
def lexicon_size(fieldish : TrailDBField) : TdbVal #

Return the number of distinct values in the given field ID or field name.


[View source]
def max_timestamp #

Return the maximum time stamp of this TrailDB.


[View source]
def min_timestamp #

Return the minimum time stamp of this TrailDB.


[View source]
def num_events : UInt64 #

Number of events.


[View source]
def num_fields : UInt64 #

Number of fields.


[View source]
def num_trails : UInt64 #

Number of trails.


[View source]
def parse_timestamp : Bool #

Whether to parse timestamp as a Time, or leave as UInt64


[View source]
def parse_timestamp=(parse_timestamp) #

Whether to parse timestamp as a Time, or leave as UInt64


[View source]
def reuse_cursor : Bool #

Whether to reuse the TrailDB cursor. Enabling this prevents out-of-order access of events in trails, but makes iteration more efficient.


[View source]
def reuse_cursor=(reuse_cursor : Bool) #

Set whether to reuse the TrailDB cursor


[View source]
def time_range #

Return the time range covered by this TrailDB.


[View source]
def trails #

Return a iterator for all trails.


[View source]