2 releases
| 0.0.2 | Oct 2, 2025 |
|---|---|
| 0.0.1 | Jul 30, 2025 |
#2712 in Database interfaces
127 downloads per month
1.5MB
31K
SLoC
term-guard
Core library for the Term data validation framework.
Overview
term-guard is the main library crate that provides all the data validation functionality for Term. It includes:
- Constraints - Over 30 built-in validation rules
- Validation Engine - High-performance constraint evaluation
- Data Sources - Support for files, cloud storage, and databases
- Query Optimization - Intelligent constraint batching
- Telemetry - Built-in observability with OpenTelemetry
Documentation
Usage
Add to your Cargo.toml:
[dependencies]
term-guard = "0.0.1"
Basic example:
use term_guard::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
let ctx = SessionContext::new();
ctx.register_csv("data", "data.csv", CsvReadOptions::new()).await?;
let suite = ValidationSuite::builder("validation")
.check(
Check::builder("quality")
.is_complete("id")
.is_unique("email")
.build()
)
.build();
let results = suite.run(&ctx).await?;
Ok(())
}
Features
default- Core functionality with file supportcloud-storage- AWS S3, Google Cloud Storage, Azure Blob supporttelemetry- OpenTelemetry integrationtest-utils- Utilities for testing (TPC-H data generation)
Project Structure
term-guard/
├── src/
│ ├── constraints/ # Validation constraints
│ ├── core/ # Core types (Suite, Check, Result)
│ ├── formatters/ # Result formatting
│ ├── sources/ # Data source connectors
│ └── lib.rs # Library entry point
├── tests/ # Integration tests
└── benches/ # Performance benchmarks
Development
Run tests:
cargo test
Run benchmarks:
cargo bench
License
MIT License - see LICENSE for details.
Dependencies
~74–100MB
~2M SLoC