Quantcast
Channel: TimescaleDB and PostgreSQL - Timescale Community Forum
Viewing all articles
Browse latest Browse all 312

Using Timescale hyperfunctions inside Rust program

$
0
0

Hi,
I am building a read REST API for timescale. It is currently using sqlx crate to run traditionnal SQL queries.
I would like to add downsampling to the queries. Saddly, sqlx can not run timescale specific function like lttb() or asap_smooth().

SELECT (time, value) FROM 
  unnest((
    SELECT lttb(time, <some sensor field>, 100) FROM <some table> WHERE 
      objectId=<some id>
      AND time BETWEEN <start_timestamp> AND <end_timestamp>
  ))

Is there a way to run this kind of query in a Rust API?
Thanks

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 312

Trending Articles