API Reference InfluxElixir v#0.1.40

Copy Markdown View Source

Modules

Elixir client library for InfluxDB v3 with v2 compatibility.

v2 bucket CRUD operations for backwards compatibility.

v3 database CRUD operations via /api/v3/configure/database.

Health and ping checks for InfluxDB instances.

InfluxDB 3 token management, by token name.

OTP Application entry point for InfluxElixir.

Behaviour defining the InfluxDB client contract.

Production InfluxDB client implementation using Finch.

In-memory InfluxDB client for fast, isolated testing.

Reads a write request's body as the engine does before it parses a line (verified against InfluxDB 3 Core and InfluxDB 2.7).

InfluxDB 3's rules for database names and counts, as Client.Local applies them to create_database/3, to a write that creates its database and to start/1 (all verified against InfluxDB 3 Core).

The Flux subset InfluxElixir.Client.Local answers, with InfluxDB 2's semantics (verified against influxdb:2.7; see docs/design/2026-09-24_local-flux-pipeline.md).

Answers a query's format: option for InfluxElixir.Client.Local as Client.HTTP answers it from InfluxDB 3 (verified against Core)

The InfluxQL SELECT subset InfluxElixir.Client.Local answers, shaped the way InfluxDB 3 answers it (verified against the engine; see docs/design/2026-09-23_local-influxql.md).

The aggregates of a SQL select list for InfluxElixir.Client.Local, over the points of one group, as InfluxDB 3 computes them (verified against Core).

Binds the $name placeholders of a parsed query.

The engine's failure on a WHERE that leaves a numeric column no value (verified against InfluxDB 3 Core).

CAST(expr AS type) as DataFusion performs it (verified against InfluxDB 3 Core).

The GROUP BY and ORDER BY clauses of a SQL text, as DataFusion reads them (verified against InfluxDB 3 Core).

Evaluates a parsed WHERE against a point for InfluxElixir.Client.Local with SQL's three-valued logic and DataFusion's comparison semantics (verified against InfluxDB 3 Core).

The error maps InfluxElixir.Client.Local answers a SQL query with: the engine's own words under the engine's status, and the Client.Local: refusal for what the double declines to model.

Evaluates a SQL expression (InfluxElixir.Client.Local.SQLExpr) against one point, with the engine's number types (see InfluxElixir.Client.Local.SQLNumber): a UInt64 column ({:uint_col, name}, which InfluxElixir.Client.Local.SQLTyping puts where the store registered one) reads as a UInt64, so u / 2 is the decimal division the engine makes of it.

The arithmetic expressions of a SQL text: a column, a literal, a $name placeholder, an operation, a unary minus, a CAST or a call of one of InfluxElixir.Client.Local.SQLFunctions. They stand in an aggregate's argument, a projection, a WHERE operand and an ORDER BY term.

What the engine's optimizer finds when it folds the constants of a SQL query, for InfluxElixir.Client.Local (verified against InfluxDB 3 Core).

The scalar math functions Client.Local evaluates in SQL expressions, wherever an expression stands (WHERE, the select list, ORDER BY, an aggregate's argument), as InfluxDB 3 does (verified against Core)

The engine's check that a projected plain column of an aggregate query is grouped (verified against InfluxDB 3 Core): planning fails otherwise, and its message lists what does satisfy the requirement, the GROUP BY terms and then the aggregates in select order, each as the planner prints it. The double refuses by name a query whose terms it cannot print.

DataFusion's identifier rules, applied to a SQL text before InfluxElixir.Client.Local.SQLParser reads it (verified against InfluxDB 3 Core)

FROM a CROSS JOIN b for InfluxElixir.Client.Local: every left point paired with every right point, the right side's columns merged in as fields. Rows are the left side's measurement and timestamp.

Reads a SQL text as the engine's tokenizer does, before InfluxElixir.Client.Local.SQLParser looks at it (verified against InfluxDB 3 Core)

LIMIT n and OFFSET m, in either order, end a statement. A clause is the keyword followed by a value, so a column called offset (an operator or keyword follows it) stays a column. The engine's answers (verified): a name is its schema error (500), a number with a fraction, a string or a boolean the type_coercion error naming the clause and the type, a negative number the optimizer's error, 0 and NULL are fine. Planning comes before optimizing, and LIMIT before OFFSET; a negative OFFSET is reported by push_down_limit when a LIMIT is present and by eliminate_limit when it is not. A $name is checked the same way once InfluxElixir.Client.Local.SQLBind knows its value.

The ends of the engine's integer and float types, in one place for the SQL modules of InfluxElixir.Client.Local.

The literals and names of a SQL text, as DataFusion reads them (verified against InfluxDB 3 Core)

Reads quoted text out of the way. Every clause of a SQL text is located by a regular expression, and a string literal can hold anything: a comma, >, limit 5, from t. So the text is masked first — the body of each '...' or "..." becomes filler, byte for byte, the quotes stay — the expression runs over the mask, and what it found is cut out of the original at the same offsets.

The numbers a SQL expression computes with in InfluxElixir.Client.Local, typed as the engine types them (verified against InfluxDB 3 Core).

The type errors the engine finds when it plans a SQL query, for InfluxElixir.Client.Local, whether or not any row would reach the expression (verified against InfluxDB 3 Core).

Flattens a parsed WHERE into its conjuncts, pushing a NOT in as the engine's optimizer does, for the modules that reason about what a filter leaves (InfluxElixir.Client.Local.SQLBounds for a numeric column, InfluxElixir.Client.Local.SQLRange for time).

What a WHERE leaves of a scan's ranges, for InfluxElixir.Client.Local: the failures the engine raises while planning the scan (verified against InfluxDB 3 Core).

How a stored point's columns read in a SQL query of InfluxElixir.Client.Local: the value a column has, and the value a point sorts, groups and picks on.

The schema errors of a SQL query for InfluxElixir.Client.Local: a column the query names that no row has — in SELECT, an aggregate, WHERE, GROUP BY, ORDER BY or DISTINCT — is the engine's schema error ("No field named prod. Valid fields are ..."), not an empty or unsorted result. The usual cause is a typo or a forgotten pair of quotes around a string literal. With no rows the schema is unknown, so nothing is checked.

The select list of an aggregate or grouped query: DATE_BIN(...) AS alias, AGG(expr) AS alias, the selectors, first_value / last_value, constants and grouping columns (all verified against InfluxDB 3 Core).

The ordering of values and rows for InfluxElixir.Client.Local's SQL, as the engine orders them (verified against InfluxDB 3 Core): DateTimes chronologically, numbers by InfluxElixir.Client.Local.SQLNumber (a UInt64 or a decimal by its value, an infinity beyond every finite float), nulls last when ascending and first when descending unless the query says NULLS FIRST / NULLS LAST; it is not term order, which puts a nil before every string and between false and true.

What a time comparand is, as InfluxDB 3 reads it (verified against Core)

Gives a SQL query's expressions the types the engine gives them, for InfluxElixir.Client.Local.

The WHERE clause of a SQL text: a boolean expression over predicates (verified against InfluxDB 3 Core).

The ETS store behind InfluxElixir.Client.Local: the one module that knows the key layout.

The params: of a SQL query, as both clients send and read them.

Connection configuration validation and defaults.

Named connection manager for InfluxDB instances.

Per-connection supervisor using :rest_for_one strategy.

Arrow Flight gRPC client for high-throughput query transport.

Minimal FlatBuffer binary reader for Arrow IPC metadata.

Protobuf message definitions for the Apache Arrow Flight protocol.

A chunk of Arrow IPC data streamed from a DoGet call.

Describes how to locate or identify a Flight (a named dataset or query).

A Ticket paired with a list of Locations that can serve the data.

Metadata returned by GetFlightInfo, describing a result set.

gRPC service definition for the Arrow Flight protocol.

Generated gRPC client stub for FlightService.

Initial client message in the Handshake RPC.

Server response in the Handshake RPC.

A URI identifying where a Flight service is available.

An opaque bytes token identifying a result set.

Arrow IPC record batch decoder for Arrow Flight query results.

v2 Flux query executor for backwards compatibility.

v3 InfluxQL query executor for legacy query compatibility.

Parses InfluxDB query responses in JSON, JSONL, InfluxDB 3 CSV and Flux annotated CSV formats, and passes Parquet bodies through untouched.

v3 SQL query builder and executor.

Streaming JSONL query results as a lazy Elixir Stream.

Raised while consuming a streaming query result when the request cannot produce rows.

Top-level supervisor for InfluxElixir.

Telemetry event emission for write and query operations.

Test setup helpers for consuming applications.

GenServer-based batch writer with configurable flush intervals, batch sizes, retry with exponential backoff, and backpressure.

Encodes Point structs into InfluxDB line protocol format.

Point struct representing a single InfluxDB data point.

Direct single-request write to InfluxDB.