Expand description
Rust SDK for the MarpleDB API.
The SDK provides async helpers for checking API health, managing streams, listing datasets, uploading files, waiting for imports, and fetching pre-signed download links.
§Quickstart
use marple_db::{ImportStatus, MarpleDB, PushFileOptions};
use serde_json::json;
use std::time::Duration;
let db = MarpleDB::new(
"https://db.marpledata.com/api/v1",
"mdb_your_token_here",
)?;
let stream = db.get_stream("runs").await?;
let dataset = db
.push_file(
stream.id,
"run.csv",
PushFileOptions::builder()
.metadata([("source", json!("example"))])
.build(),
)
.await?;
let dataset = db
.wait_for_import(stream.id, dataset.id, Duration::from_secs(180))
.await?;
assert_eq!(dataset.import_status, ImportStatus::Finished);§Core Types
MarpleDBis the API client.PushFileOptionsconfigures uploads.ImportStatusdescribes dataset import state.Erroris the structured SDK error type.ProgressReporterreceives transfer progress updates.
§Errors
match db.get_stream("runs").await {
Ok(stream) => println!("stream id: {}", stream.id),
Err(marple_db::Error::StreamNotFound { name }) => {
eprintln!("missing stream: {name}");
}
Err(error) => return Err(error),
}This crate is async and does not install a runtime. The examples use Tokio,
but callers can use any runtime supported by reqwest.
Structs§
- Dataset
- Dataset metadata returned by the MarpleDB API.
- Health
Response - Health response returned by the MarpleDB API.
- MarpleDB
- Client for the MarpleDB API.
- MarpleDB
Builder - Builder for
MarpleDB. - Noop
Progress - Progress reporter that ignores all updates.
- Push
File Options - Options for uploading a file.
- Push
File Options Builder - Builder for
PushFileOptions. - Stream
- MarpleDB stream metadata.
Enums§
- Error
- Error type returned by the MarpleDB SDK.
- Import
Status - Dataset import lifecycle status.
- Stream
Type - MarpleDB stream type.
- Upload
Mode Override - Upload mode preference for
MarpleDB::push_file.
Traits§
- Progress
Reporter - Receives byte-position updates from long-running transfers.