phasedb v0.0.2 PhaseDB.Insert

Describes an operation to insert a Sample into a series as an abstract syntax for:

Example:

use Calendar
import PhaseDB.Insert
alias PhaseDB.Query

insert
|> value(3.1415927)
|> recorded_at(DateTime.now_utc)
|> tag(:precision, 7)
|> into("database_name", "series_name")
|> Query.execute

Summary

Functions

Create an empty insert query

Add the query target to the query

The time that the value was recorded

Insert a tag along with the value

The value to insert for a given recorded_at time

Types

t :: %PhaseDB.Insert{database_name: term, sample: term, series_name: term}

Functions

insert()

Specs

insert :: t

Create an empty insert query.

into(insert, database_name, series_name)

Specs

into(t, String.t, String.t) :: t

Add the query target to the query.

Params: - insert - an existing insert query created by insert. - database_name - the name of the database to insert into. - series_name - the name of the series to insert into.

recorded_at(insert, timestamp)

Specs

recorded_at(t, PhaseDB.TimeHelpers.utc_usecs | Calendar.DateTime.t) :: t

The time that the value was recorded.

Params: - insert - an existing insert query created by insert. - time - either usecs since 1 Jan 1970 UTC or a Calendar.DateTime.

tag(insert, tag, value)

Specs

tag(t, String.t | atom, String.t | number) :: t

Insert a tag along with the value.

Params: - insert - an existing insert query created by insert. - tag - name of the tag to insert. String or Atom. - value - value of the tag. String or Number.

value(insert, value)

Specs

value(t, number) :: t

The value to insert for a given recorded_at time.

Params: - insert - an existing insert query created by insert. - value - a numeric value to insert.