Instream v0.12.0 Instream.Encoder.InfluxQL

Encoder module for InfluxQL.

Summary

Functions

Converts a query builder struct to InfluxQL

Quotes an identifier if necessary

Quotes a value in a query

Functions

encode(query)

Converts a query builder struct to InfluxQL.

quote_identifier(ident)

Specs

quote_identifier(String.t) :: String.t

Quotes an identifier if necessary.

Examples

iex> quote_identifier("unquoted")
"unquoted"

iex> quote_identifier("_unquoted")
"_unquoted"

iex> quote_identifier("100quotes")
"\"100quotes\""

iex> quote_identifier("quotes for whitespace")
"\"quotes for whitespace\""

iex> quote_identifier("dáshes-and.stüff")
"\"dáshes-and.stüff\""
quote_value(value)

Specs

quote_value(any) :: String.t

Quotes a value in a query.

Examples

iex> quote_value(100)
"100"

iex> quote_value(:foo)
"foo"

iex> quote_value("stringy")
"'stringy'"