| Crates.io | nirv-engine |
| lib.rs | nirv-engine |
| version | 0.1.0 |
| created_at | 2025-12-22 21:08:13.368745+00 |
| updated_at | 2025-12-22 21:08:13.368745+00 |
| description | Universal data virtualization and compute orchestration engine with SQL Server, PostgreSQL, REST API, and file system connectors |
| homepage | https://github.com/nirv/nirv-engine |
| repository | https://github.com/nirv/nirv-engine |
| max_upload_size | |
| id | 2000260 |
| size | 523,198 |
A universal data virtualization and compute orchestration engine written in Rust. NIRV Engine provides a unified interface to query and manipulate data across multiple sources including databases, APIs, and file systems.
🎯 Production Ready Core Features
📊 Test Coverage: 119 tests, 96% passing (114/119) 🚀 Examples: Working SQL Server simulation and integration examples 📚 Documentation: Comprehensive API docs and usage guides
Add NIRV Engine to your Cargo.toml:
[dependencies]
nirv-engine = "0.1.0"
use nirv_engine::connectors::{SqlServerConnector, Connector, ConnectorInitConfig};
use nirv_engine::protocol::{SqlServerProtocol, ProtocolAdapter};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create and configure a SQL Server connector
let mut connector = SqlServerConnector::new();
let config = ConnectorInitConfig::new()
.with_param("server", "localhost")
.with_param("database", "mydb")
.with_param("username", "user")
.with_param("password", "password");
// Connect to the database
connector.connect(config).await?;
// Create a protocol adapter for SQL Server simulation
let protocol = SqlServerProtocol::new();
println!("Connected to SQL Server!");
println!("Connector type: {:?}", connector.get_connector_type());
println!("Protocol type: {:?}", protocol.get_protocol_type());
Ok(())
}
use nirv_engine::connectors::{RestConnector, EndpointMapping};
use reqwest::Method;
let mut connector = RestConnector::new()
.with_auth(AuthConfig::ApiKey {
header: "X-API-Key".to_string(),
key: "your-api-key".to_string(),
})
.with_cache_ttl(Duration::from_secs(300))
.with_rate_limit(RateLimitConfig {
requests_per_second: 10.0,
burst_size: 20,
});
// Add endpoint mapping
connector.add_endpoint_mapping("users".to_string(), EndpointMapping {
path: "/api/users".to_string(),
method: Method::GET,
query_params: HashMap::new(),
response_path: Some("data".to_string()),
id_field: Some("id".to_string()),
});
NIRV Engine follows a modular architecture with clear separation of concerns:
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Query Engine │ │ Connectors │ │ Protocols │
│ │ │ │ │ │
│ • Query Parser │◄──►│ • SQL Server │◄──►│ • TDS Protocol │
│ • Query Planner │ │ • PostgreSQL │ │ • PostgreSQL │
│ • Executor │ │ • REST APIs │ │ • HTTP/REST │
│ • Dispatcher │ │ • File System │ │ • Custom │
└─────────────────┘ └─────────────────┘ └─────────────────┘
NIRV Engine provides comprehensive SQL Server support through:
use nirv_engine::protocol::{SqlServerProtocol, Connection, Credentials};
// Create protocol adapter
let protocol = SqlServerProtocol::new();
// Simulate authentication
let credentials = Credentials::new("sa".to_string(), "master".to_string())
.with_password("password".to_string());
let mut connection = Connection::new(stream, ProtocolType::SqlServer);
protocol.authenticate(&mut connection, credentials).await?;
// Parse TDS packets
let query = protocol.parse_message(&connection, &tds_packet).await?;
println!("Parsed SQL: {}", query.raw_query);
The repository includes comprehensive examples:
examples/sqlserver_simulation.rs) - Complete SQL Server protocol demonstrationRun examples with:
cargo run --example sqlserver_simulation
NIRV Engine includes extensive test coverage:
# Run all tests
cargo test
# Run SQL Server specific tests
cargo test sqlserver
# Run with coverage
cargo test --all-features
NIRV Engine is designed for high performance:
We welcome contributions! Please see our Contributing Guide for details.
Clone the repository:
git clone https://github.com/nirv/nirv-engine.git
cd nirv-engine
Install dependencies:
cargo build
Run tests:
cargo test
Run examples:
cargo run --example sqlserver_simulation
This project is licensed under the MIT License - see the LICENSE file for details.
NIRV Engine - Unifying data access across the modern data landscape 🚀