9 stable releases (3 major)

4.0.3 Jul 12, 2024
4.0.1 Apr 26, 2024
4.0.0 Mar 18, 2024
3.1.0 Nov 23, 2023
0.0.1 Aug 4, 2022

#178 in Database interfaces

Download history 894/week @ 2024-07-25 893/week @ 2024-08-01 667/week @ 2024-08-08 615/week @ 2024-08-15 588/week @ 2024-08-22 594/week @ 2024-08-29 698/week @ 2024-09-05 618/week @ 2024-09-12 653/week @ 2024-09-19 733/week @ 2024-09-26 718/week @ 2024-10-03 623/week @ 2024-10-10 574/week @ 2024-10-17 616/week @ 2024-10-24 444/week @ 2024-10-31 468/week @ 2024-11-07

2,175 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).

Quick Start

To start using questdb-rs, add it as a dependency of your project:

cargo add questdb-rs

Then you can try out this quick example, which connects to a QuestDB server running on your local machine:

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(())
}

Docs

Most of the client documentation is on the ingress module page.

Crate features

This Rust crate supports a number of optional features, in most cases linked to additional library dependencies.

For example, if you want to work with Chrono timestamps, use:

cargo add questdb-rs --features chrono_timestamp

Default-enabled features

  • ilp-over-http: Enables ILP/HTTP support via the ureq crate.
  • tls-webpki-certs: Supports using the webpki-roots crate for TLS certificate verification.

Optional features

These features are opt-in:

  • chrono_timestamp: Allows specifying timestamps as chrono::Datetime objects.
  • tls-native-certs: Supports validating TLS certificates against the OS's certificates store.
  • insecure-skip-verify: Allows skipping server certificate validation in TLS (this compromises security).

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–18MB
~338K SLoC