A simplified Rust client for the Metabase API.
[dependencies]
metabase-api-rs = "0.1.0-beta.3"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
serde_json = "1.0"
use metabase_api_rs::{ClientBuilder, api::Credentials, Result};
use std::time::Duration;
#[tokio::main]
async fn main() -> Result<()> {
// Create and authenticate client
let mut client = ClientBuilder::new("https://metabase.example.com")
.timeout(Duration::from_secs(30))
.build()?;
client.authenticate(Credentials::email_password(
"[email protected]",
"password"
)).await?;
// Get a card
let card = client.get_card(123).await?;
println!("Card: {}", card.name);
Ok(())
}
Feature | Description |
---|---|
cache |
Enable in-memory LRU caching |
performance |
Performance optimizations |
query-builder |
MBQL query builder |
full |
Enable all features |
See working examples in the examples/
directory or on docs.rs.
Full API documentation is available on docs.rs.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.