Replace separate operational silos with a single transactional engine: OLTP rows, PAX columnar analytics, BM25 full-text search, exact vector & graph retrieval, stored procedures & WebAssembly UDFs, lakehouse federation, OpenTelemetry APM, and an embedded Web Studio.
docker pull nayem7663/spyddb:latestwith nearby as (
catalog | where nearest(embedding, $1, 50) | pick id
)
| catalog
| where id in (nearby | pick id)
and match(description, "wireless mechanical")
and geo_within(coords, 37.60, -122.60, 37.90, -122.20)
and category == "peripherals"
| pick id, title, vector_similarity(embedding, $1) as score
| sort score desc
| take 10-- 1. Train a 3-class softmax GBDT fraud triage model inside SpydDB
triage_train
| agg ml_train_gbdt_multiclass(features, 3, 25, 3) as fraud_model;
-- 2. Score live orders with class probabilities and exact TreeSHAP attribution
models
| join orders on true
| where models.name == "fraud_triage_v2"
| pick orders.id,
ml_class(models.body, orders.amount, orders.velocity, orders.country) as tier,
ml_proba(models.body, orders.amount, orders.velocity, orders.country) as class_probs,
ml_explain(models.body, orders.amount, orders.velocity, orders.country) as shap_json
| sort orders.id desc
| take 10CREATE OR REPLACE PROCEDURE transfer_funds(
IN from_id bigint,
IN to_id bigint,
IN amount numeric(12, 2),
OUT new_from_balance numeric(12, 2)
)
LANGUAGE plpgsql
SECURITY DEFINER
AS $$
BEGIN
IF amount <= 0 THEN
RAISE EXCEPTION 'transfer amount must be positive';
END IF;
SAVEPOINT before_debit;
UPDATE accounts SET balance = balance - amount WHERE id = from_id;
SELECT balance INTO STRICT new_from_balance FROM accounts WHERE id = from_id;
IF new_from_balance < 0 THEN
ROLLBACK TO SAVEPOINT before_debit;
RAISE EXCEPTION 'insufficient funds for account %', from_id;
END IF;
UPDATE accounts SET balance = balance + amount WHERE id = to_id;
END;
$$;-- 1. Multi-hop variable-length Cypher traversal
MATCH p = (src:Account {tier: "vip"})-[e:TRANSFERRED*1..4]->(dst:Account)
WHERE dst.risk_score >= 0.85
RETURN src.id, dst.id, length(p) AS hops, dst.risk_score
ORDER BY hops ASC, dst.risk_score DESC
LIMIT 25;
-- 2. Native SpydQL influence scoring over the same ACID edge collection
transfers
| pagerank damping 0.85 iterations 20 over from_id, to_id
| sort rank desc
| take 10-- Deterministic, zero-import WebAssembly function (1 MiB mem / 1M fuel cap)
create or replace function clamp_discount(bps: i32, max_bps: i32) -> i32
language wasm entry "clamp_discount" as "AGFzbQEAAAABBwFgAn9/AX8DAgEABQMBAAEHIAEMaGVsbG8A...";
-- Before-row trigger normalizes incoming row fields before indexes & constraints run
create trigger normalize_order_discount
before insert on orders for each row as
new | set { discount_bps: clamp_discount(discount_bps, 2500) };BEGIN;
SELECT id, payload
FROM job_queue
WHERE status = 'queued'
ORDER BY id
LIMIT 1
FOR UPDATE SKIP LOCKED;
UPDATE accounts
SET balance = balance_delta(balance, 0, 100000, -250)
WHERE id = 42;
COMMIT;use spyd_rust_driver::orm::{Database, Model};
use spyd_rust_driver::spyd_model;
spyd_model! {
#[collection = "users"]
pub struct User {
#[primary] #[auto_increment] pub id: Option<u64>,
#[not_null] #[unique] #[spyd_type = String(160)] pub email: String,
#[not_null] #[default = Bool(true)] pub active: bool,
}
}
let mut db = Database::connect("spydwire://app:TOKEN@127.0.0.1:5433?tls=1&ca=ca.crt")?;
db.create_all(&[User::schema()])?;
let active = db.query::<User>().filter(User::active().eq(true)?).limit(20).all()?;from decimal import Decimal
from spyddb.orm import AsyncDatabase, Bool, Decimal as DecimalCol, Model, String, UInt64
class Order(Model):
__collection__ = "orders"
id = UInt64(primary=True, auto_increment=True)
customer = String(120, nullable=False)
total = DecimalCol(12, 2, nullable=False)
paid = Bool(default=True)
async with AsyncDatabase.connect("spydwire://127.0.0.1:5433?token_env=SPYD_TOKEN", models=[Order]) as db:
await db.create_all()
async with db.transaction():
await db.create(Order, customer="Ada", total=Decimal("249.50"), paid=True)import { Client, DecimalParam } from "spyddb";
const client = await Client.connect("spydwire://127.0.0.1:5433?token_env=SPYD_TOKEN");
try {
await client.execute(
"orders | insert { id: $1, total: cast($2 as decimal(12, 2)) }",
[18446744073709551000n, new DecimalParam("199.95", 12, 2)],
);
const rows = await client.execute("orders | pick id, total | take 10");
console.log(rows.dicts);
} finally {
await client.close();
}@SpydCollection("orders")
public record Order(
@SpydField(primary = true, autoIncrement = true) Long id,
@SpydField(notNull = true) String customer,
@SpydField(precision = 12, scale = 2) BigDecimal total
) {}
try (SpydDatabase db = SpydDatabase.connect("spydwire://TOKEN@127.0.0.1:5433?tls=true&ca=ca.crt")) {
db.createAll(Order.class);
List<Order> top = db.query(Order.class)
.filter(Col.of("total").gte(new BigDecimal("100.00")))
.orderBy(Col.of("total").desc())
.limit(10).all();
}pool, err := spyddb.NewPool(
"spyddb://app:"+os.Getenv("SPYD_TOKEN")+"@127.0.0.1:5433/default?tls=true&ca=ca.crt",
32, 8,
)
defer pool.Close()
rows, err := pool.Query(ctx, "orders | where total >= $1 | pick id, customer", 100)
for _, r := range rows {
id, _ := r.ValueOf("id").AsUint64()
fmt.Println(id, r.ValueOf("customer"))
}# 1. Execute parameterized SpydQL over HTTPS
curl -fsS --cacert tls/ca.crt https://localhost:8080/v1/query \
-H "Authorization: Bearer $SPYD_TOKEN" -H "Content-Type: application/json" \
-d '{"sql":"orders | where status == $1 | take 10","parameters":[{"String":"paid"}]}'
# 2. Take a cryptographic online base backup without downtime
curl -fsS --cacert tls/ca.crt https://localhost:8080/v1/admin/backups \
-H "Authorization: Bearer $SPYD_ADMIN_TOKEN" -H "Content-Type: application/json" \
-d '{"name":"daily-snapshot"}'Every query path — SpydQL, SQL over PostgreSQL wire, HTTPS/gRPC, Native SDKs, and Web Studio — enforces identical ACID/MVCC isolation, RBAC rules, row filters, and audit logging.
B+ tree rows, PAX columnar segments, schemaless JSON documents, composites, ranges, inet/cidr, arrays, and enums under one MVCC/SSI snapshot.
Transactional stored procedures in SpydQL or PL/pgSQL with OUT/INOUT params, savepoints, fuel-metered WebAssembly UDFs, UDAs, and triggers.
Adjacency graph indexes, 10 built-in graph algorithms (PageRank, Dijkstra, SCC, Brandes, communities), 6 SQL graph TVFs, and Cypher MATCH.
Train regression, binary, and multi-class softmax GBDTs (plus XGBoost/LightGBM import), explain rows with exact TreeSHAP, windows, rollups, and Cranelift JIT.
Combine HNSW dense vectors, SPLADE sparse Block-Max WAND, ColBERT/MUVERA MaxSim multi-vectors, BM25 full-text highlights, and geo_within() in one pipeline.
Query Delta Lake, Apache Iceberg, Hudi, Parquet, CSV, JSON/NDJSON, S3 objects, HTTPS feeds, and Kafka streams with fail-closed validation.
Deny-by-default RBAC, tenant ownership & expiring record grants, row policies, field masks, AES-256-GCM-SIV encryption, SSRF defense, and seccomp.
Stream live row changes over SSE/gRPC/SpydWire alongside OpenTelemetry traces, metrics, logs, synthetic probes, error budgets, and PagerDuty alerts.
Speak PGWire (:5432), binary SPD2 (:5433), HTTPS & gRPC with Multi-Raft chunked snapshots, regional leases, HLC, interactive 2PC, and K8s Operator.
Browse schemas, run BM25 search, profile SpydQL queries, configure RBAC & field masks, and inspect distributed OpenTelemetry traces and SLO burn rates with zero extra containers.
Full scenario examples for connections, TLS/mTLS, SCRAM, CRUD, prepared statements, transactions, pooling, and ORMs across every language.