Lume
A type-safe, ergonomic query builder and ORM for SQL databases, inspired by Drizzle ORM.
Features
- 🚀 Type-safe: Compile-time type checking for all database operations
- 🎯 Ergonomic: Clean, intuitive API inspired by modern ORMs
- ⚡ Performance: Zero-cost abstractions with minimal runtime overhead
- 🔧 Flexible: Support for MySQL, PostgreSQL, and SQLite
- 🛡️ Safe: Parameterized queries by default to prevent SQL injection
- 📦 Lightweight: Minimal dependencies, maximum functionality
Quick Start
Add Lume to your Cargo.toml:
[]
= { = "0.12", = ["mysql"] }
= { = "1.0", = ["macros", "rt-multi-thread"] }
Basic Example
use ;
// Define your database schema
define_schema!
async
Documentation
- Getting Started - Installation and basic usage
- Schema Definition - Defining database schemas
- Queries - Building and executing queries
- Filters - Filtering and conditions
- Inserts & Updates - Inserting and updating data
- Joins - Joining tables
- Advanced Topics - Advanced features and patterns
Supported Databases
Lume supports multiple database backends through feature flags:
- MySQL:
lume = { version = "0.12", features = ["mysql"] } - PostgreSQL:
lume = { version = "0.12", features = ["postgres"] } - SQLite:
lume = { version = "0.12", features = ["sqlite"] }
Type Mapping
Lume automatically maps Rust types to SQL types:
| Rust Type | SQL Type |
|---|---|
String |
VARCHAR(255) |
i8 |
TINYINT |
i16 |
SMALLINT |
i32 |
INT |
i64 |
BIGINT |
u8 |
TINYINT UNSIGNED |
u16 |
SMALLINT UNSIGNED |
u32 |
INT UNSIGNED |
u64 |
BIGINT UNSIGNED |
f32 |
FLOAT |
f64 |
DOUBLE |
bool |
BOOLEAN |
time::OffsetDateTime |
DATETIME |
Contributing
We are not accepting contributions at this time. We will be accepting pull requests in the future, for now you can open an issue to discuss your ideas.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
See CHANGELOG.md for a detailed list of changes and improvements.