Expand description
Rust client for the smbCloud GresIQ REST gateway.
GresIQ is a managed-database layer inside smbCloud. It sits in front of a PostgreSQL database, adds API-key auth, and exposes a simple REST interface for inserting and querying rows.
This crate handles the HTTP transport and auth headers. Schema knowledge (which tables exist, what the rows look like) lives in the caller.
§Quick start
use smbcloud_gresiq_sdk::{Environment, GresiqClient, GresiqCredentials};
use serde::Serialize;
#[derive(Serialize)]
struct Hit { path: String, status: u16 }
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let client = GresiqClient::from_credentials(
Environment::Dev,
GresiqCredentials {
api_key: "your-key",
api_secret: "your-secret",
},
);
client.insert("hits", &Hit {
path: "/api/chat".into(),
status: 200,
}).await?;
Ok(())
}Structs§
- Gresiq
Client - Talks to the smbCloud GresIQ REST gateway.
- Gresiq
Credentials - API credentials for a GresIQ-managed database.
- OndeApp
- An app registered to the user’s account.
- Onde
Model - A model from the Onde catalog, assignable to an
OndeApp.
Enums§
Functions§
- assign_
model - Assign a catalog model to an app. Creates the record if none exists yet.
- base_
url - Resolve the GresIQ gateway base URL for the given environment.
- create_
app - Create a new app under the authenticated user’s account.
- list_
apps - Fetch all apps for the authenticated user.
- list_
models - Fetch all models in the Onde catalog.
- rename_
app - Rename an existing app.