15 releases
Uses new Rust 2024
| 0.2.0 | Nov 27, 2025 |
|---|---|
| 0.1.9 | Nov 20, 2025 |
| 0.1.3 | Oct 31, 2025 |
#330 in Geospatial
285KB
6K
SLoC
Embedded spatio-temporal database with 2D/3D indexing, persistence, and lazy TTL support.
Features
- Spatial indexing: 2D/3D points, polygons, bounding boxes with R*-tree spatial indexing
- Persistence: Append-only file (AOF) with configurable sync policies
- Lazy TTL: Expired items are filtered on read, manual cleanup available
- Atomic batches: Group multiple operations atomically
- Temporal queries: Filter by creation time (with
time-indexfeature)
TTL Behavior
TTL is passive/lazy:
- Expired items return
Noneonget()and are skipped in queries - Items remain in storage until overwritten or manually cleaned with
cleanup_expired() - No automatic background cleanup or deletion on insert
Example
use spatio::{Point3d, Spatio};
let db = Spatio::memory()?;
// Spatial example
let point = Point3d::new(-74.0060, 40.7128, 0.0);
db.update_location("cities", "nyc", point.clone(), serde_json::json!({"name": "NYC"}))?;
let nearby = db.query_current_within_radius("cities", &point, 1000.0, 10)?;
Dependencies
~19MB
~260K SLoC