An SQL-centered ORM for Rust focused on ease of use and type-safe database interactions.
Rustorm is an SQL-centered Object-Relational Mapper (ORM) for the Rust programming language. It simplifies database interactions by focusing on converting database types to appropriate Rust types, ensuring type safety and preventing runtime errors. The library provides ORM conveniences for mapping query results while prioritizing direct SQL usage.
Rust developers working with SQL databases (PostgreSQL, SQLite, or MySQL) who want type-safe database operations without sacrificing SQL expressiveness. It's particularly suitable for developers who prefer writing SQL directly but want convenient result mapping.
Developers choose Rustorm for its SQL-centered design that doesn't hide SQL behind abstractions, combined with strong type safety through accurate database-to-Rust type conversions. Its derive macros (FromDao, ToDao, ToColumnNames, ToTableName) provide ergonomic struct-to-table mapping while maintaining control over SQL queries.
an orm for rust
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Prioritizes direct SQL usage while providing ORM conveniences for mapping results, as shown in examples where developers write raw SQL queries like 'SELECT * FROM actor LIMIT 10' and map them to structs.
Focuses on converting database types to appropriate Rust types using derive macros like FromDao and ToDao, preventing runtime errors by ensuring accurate mapping from SQL results to Rust structs.
Compatible with PostgreSQL, SQLite, and MySQL via feature flags, offering flexibility for different database backends, though MySQL requires separate handling as noted in the examples.
Includes a Pool for efficient database resource management, improving performance in concurrent applications by reusing connections, as demonstrated in the code snippets.
MySQL support has differences in the API compared to PostgreSQL and SQLite, as the README notes 'mysql has a little difference in the api', requiring extra code adjustments and potential confusion.
Lacks built-in support for complex relationships, automatic migrations, or a fluent query builder, focusing primarily on raw SQL and basic mapping, which may increase manual work for sophisticated data models.
While examples are provided, comprehensive documentation for edge cases, error handling, or advanced usage is minimal, relying heavily on code snippets that might not cover all scenarios.