GresIQ
GresIQ is the managed data layer for your app — a document store built on PostgreSQL. You store and query JSON documents through a small REST gateway, authenticated with an API key and secret, so there is no database to run yourself.
What you can do
- Store JSON documents in named collections
- Upsert by a natural key, or append documents that get a generated id
- Query a collection with a containment filter, ordering, and a limit
- Run simple counts and group-by aggregates over a collection
How it fits together
Each GresIQ app gets an API key and secret — the data-plane credential — and reaches its data through the document gateway. There is no raw database connection to manage. Documents are grouped into collections, and each document is addressed by a key within its collection. The platform never interprets a document’s shape; what the fields mean lives in your app.
The document gateway
Every request authenticates with the X-Gresiq-Api-Key and
X-Gresiq-Api-Secret headers and targets a collection:
POST /gresiq/v1/collections/<collection>— store a document. Send{ "key": "<id>", "doc": { ... } }to upsert on that key, or omitkeyto append a document with a generated id.GET /gresiq/v1/collections/<collection>— list documents, optionally with afilter(JSON containment), anorder(created_atorupdated_at), and alimit.GET /gresiq/v1/collections/<collection>/<key>— fetch one document.PATCH /gresiq/v1/collections/<collection>/<key>— shallow-merge into a document.DELETE /gresiq/v1/collections/<collection>/<key>— remove one document.POST /gresiq/v1/collections/<collection>/aggregate— count, or group by a single top-level field.
From Rust
The smbcloud-gresiq-sdk crate wraps the gateway. Build a client from your
environment and credentials, then upsert and query documents — the base URL is
resolved from the environment, so you never hardcode a host:
use smbcloud_gresiq_sdk::{DocumentQuery, Environment, GresiqClient, GresiqCredentials};
use serde_json::json;
let client = GresiqClient::from_credentials(
Environment::Production,
GresiqCredentials { api_key: "your-key", api_secret: "your-secret" },
);
// Upsert a document keyed by "device-1".
client
.upsert_document(
"devices",
Some("device-1"),
&json!({ "label": "Edge 1", "status": "online" }),
)
.await?;
// Query the collection — only the documents matching the filter come back.
let online = client
.get_collection::<serde_json::Value>(
"devices",
&DocumentQuery {
filter: Some(json!({ "status": "online" })),
..Default::default()
},
)
.await?;Each returned GresiqDocument carries the stored doc plus its key and
timestamps.
From the CLI
A project has one GresIQ app. Create it from the console, with smb gresiq create, or by creating the project’s first smbCloud Flag.
smb gresiq list --project 38
smb gresiq create --project 38 --credentials-file ./gresiq.env
smb gresiq show 7
smb gresiq rotate-server-key 7 --output ./gqs.key
smb gresiq rotate-ingest-key 7 --output ./gqi.keysmbCloud shows the API secret and each new key only once, so the CLI never
prints them. It writes them to the file you name, created with mode 0600, and
refuses to write over an existing file. Rotating a key revokes the old one, so
--output is required. The MCP server has gresiq_app_list and
gresiq_app_create. Neither returns a secret.
Getting started
- Create a GresIQ app and copy its API key and secret.
- Pick a collection name and POST your first document.
- Read it back with a GET, or reach it from the SDK in your app.