7 releases (stable)

4.0.0 Mar 18, 2024
3.1.0 Nov 23, 2023
3.0.0 Sep 22, 2023
2.1.3 Jan 4, 2023
0.0.1 Aug 4, 2022

#303 in Database interfaces

Download history 3/week @ 2023-12-18 12/week @ 2023-12-25 65/week @ 2024-01-01 37/week @ 2024-02-05 1/week @ 2024-02-12 85/week @ 2024-02-26 17/week @ 2024-03-04 93/week @ 2024-03-11 138/week @ 2024-03-18 24/week @ 2024-03-25 101/week @ 2024-04-01

360 downloads per month

Apache-2.0

210KB
4.5K SLoC

QuestDB Client Library for Rust

Official Rust client for QuestDB, an open-source SQL database designed to process time-series data, faster.

The client library is designed for fast ingestion of data into QuestDB via the InfluxDB Line Protocol (ILP).

Getting Started

To start using questdb-rs add it to your Cargo.toml:

[dependencies]
questdb-rs = "4.0.0"

Docs

See documentation for the ingress module to insert data into QuestDB via the ILP protocol.

Example

use questdb::{
    Result,
    ingress::{
        Sender,
        Buffer,
        TimestampNanos}};

fn main() -> Result<()> {
   let mut sender = Sender::from_conf("http::addr=localhost:9000;")?;
   let mut buffer = Buffer::new();
   buffer
       .table("sensors")?
       .symbol("id", "toronto1")?
       .column_f64("temperature", 20.0)?
       .column_i64("humidity", 50)?
       .at(TimestampNanos::now())?;
   sender.flush(&mut buffer)?;
   Ok(())
}

Crate features

This Rust crate supports a number of optional features.

For example, if you want to work with ILP/HTTP and work with Chrono timestamps, use:

cargo add questdb-rs --features ilp-over-http chrono

Default-enabled features

  • tls-webpki-certs: Use the webpki-roots crate for TLS cert verification.

Optional features

These features are opt-in as they bring in additional downstream dependencies.

  • ilp-over-http: Enables ILP/HTTP support via the ureq crate.
  • tls-native-certs: Supports validating TLS certificates against the OS's certificates store.
  • insecure-skip-verify: Allows skipping TLS validation.
  • chrono_timestamp: Allows specifying timestamps as chrono::Datetime objects.

C, C++ and Python APIs

This crate is also exposed as a C and C++ API and in turn exposed to Python.

Community

If you need help, have additional questions or want to provide feedback, you may find us on Slack.

You can also sign up to our mailing list to get notified of new releases.

Dependencies

~8–20MB
~347K SLoC