# `Arex.TimeSeries`
[🔗](https://github.com/m/exarcade/blob/v0.1.0/lib/arex/time_series.ex#L1)

Time-series helpers for ArcadeDB TimeSeries types and endpoints.

`Arex.TimeSeries` covers three layers of the ArcadeDB time-series surface:

- SQL-backed DDL and analytical queries
- dedicated JSON and line-protocol HTTP endpoints
- PromQL, Grafana, and Prometheus-compatible HTTP endpoints

The helpers return the same `{:ok, value}` and `{:error, error_map}` shapes as
the rest of Arex. When you need a TimeSeries capability that is not wrapped
here yet, use `Arex.Query.sql/3`, `Arex.Command.sql/3`, or `Arex.Http.request/4`.

Arex treats time-series data as boundary-aware when you use the structured
helpers:

- helper-managed type creation adds `tenant` and `scope` tags when needed
- helper-managed writes stamp active boundaries into rows or line protocol
- wrapped SQL and latest-point helpers apply those boundary tags on read

Raw SQL, raw PromQL, and raw payload helpers remain available when callers
need full control over the underlying ArcadeDB surface.

# `add_downsampling_policy`

Adds one or more downsampling policies to a TimeSeries type.

# `continuous_aggregates`

Lists continuous aggregates from `schema:continuousAggregates`.

# `create_continuous_aggregate`

Creates a continuous aggregate.

# `create_type`

Creates a TimeSeries type with the given timestamp, tags, and fields definition.

# `drop_continuous_aggregate`

Drops a continuous aggregate.

# `drop_downsampling_policy`

Drops all downsampling policies from a TimeSeries type.

# `drop_type`

Drops a TimeSeries type.

# `grafana_health`

Checks the Grafana datasource health endpoint for ArcadeDB TimeSeries.

# `grafana_metadata`

Fetches Grafana metadata for ArcadeDB TimeSeries types.

# `grafana_query`

Executes a Grafana DataFrame-style query.

# `insert`

Inserts a single sample map into a TimeSeries type using SQL `content` syntax.

# `insert_many`

Inserts multiple sample maps into a TimeSeries type in one SQLScript transaction.

# `latest`

Fetches the latest point for a TimeSeries type.

# `prom_label_values`

Lists available values for a PromQL label.

# `prom_labels`

Lists available PromQL label names.

# `prom_remote_read`

Sends a raw Prometheus remote-read payload.

# `prom_remote_write`

Sends a raw Prometheus remote-write payload.

# `prom_series`

Finds series matching one or more PromQL selectors.

# `promql`

Executes a PromQL instant query.

# `promql_range`

Executes a PromQL range query.

# `promql_sql`

Evaluates a PromQL expression through SQL using `promql()`.

# `query_json`

Executes a TimeSeries JSON query against `/api/v1/ts/:db/query`.

# `query_sql`

Executes a SQL query against TimeSeries data.

# `refresh_continuous_aggregate`

Refreshes a continuous aggregate.

# `write_lines`

Writes InfluxDB line protocol samples to `/api/v1/ts/:db/write`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
