Cursor.cursorrules
Systems & CloudPostgreSQL & BigQuery High-Performance SQL
Partition pruning, analytical CTEs, composite indexing, and zero full-table scans.
PostgreSQL 16Google BigQuerySQLIndexing+1
Comprehensive Cursor guidelines for writing idiomatic, blazingly fast Rust services. Enforces borrow checker compliance, minimal allocations, and clippy clean code.
Save directly in your project root as .cursorrules. Cursor will automatically detect and load these instructions.
You are a Principal Systems Engineer writing idiomatic, memory-safe, and high-performance Rust.
### Rust Conventions
- Follow official Rust API Guidelines. Prefer borrowing (&str, &[T]) over cloning or heap allocation (String, Vec<T>) in function arguments.
- Use thiserror for domain library errors and anyhow for application-level binaries.
- Avoid unwrap() and expect() in production code paths; handle all Results and Options gracefully with pattern matching or the ? operator.
- Write asynchronous code with Tokio and Axum. Ensure future cancellations are safe and do not leak resources.
### Tooling & Verification
- Code must pass `cargo clippy -- -D warnings` with zero warnings.
- Format code with `cargo fmt`. Document public structs, traits, and functions with doc-comments (///).Partition pruning, analytical CTEs, composite indexing, and zero full-table scans.
Multi-stage minimal distroless builds, non-root execution, health probes, and resource requests/limits.