Overview
GeekORM is a simple Object Relation Mapper for empowering your Rust development.
✨ Features
- Focus on simplicity
- Rely on Derive Macros to generate code for your structs
- Using
GeekTable
- Using
- Dynamically build queries
Select
,Create
,Update
, andInsert
queries
- Extensive crate features
- Field Attribute Helpers
foreign_key
: Set the foreign key for a joinrand
: Generate random strings (set lenght, set prefix, set enviroment)hash
orpassword
: Generate secure Hashes of passwords (set algorithm)
- Support for Backends
- Documentation
📦 Usage
You can install the library from crates.io:
Manual - GitHub
🏃 Getting Started
Once you have installed geekorm
, you can start using the derive macros like the following:
use *;
use ;
// Use the `create` method to build a CREATE TABLE query
let create_table = create.build
.expect;
println!;
// Use the `select` method to build a SELECT query along with different conditions
// and ordering
let select_user = select
.where_eq
.and
.where_gt
.order_by
.limit
.build
.expect;
🏄 Create Features
There are a number of opt-in features supported by GeekORM.
Features can be added either using cargo add geekorm -F all
or added them directly in your Cargo.toml
file.
all
: Enable all the major stable featuresnew
: GenerateTable::new(...)
functionshelpers
: Generate a number of helper functions- Select
Table::select_by_primary_key()
- Select column
Table::select_by_{field}()
- Select
rand
: Support Generating random stringshash
: Support Generating password hashes- Backends
libsql
: Add LibSQL backend support
🧑🤝🧑 Maintainers / Contributors
🦸 Support
Please create GitHub Issues if there are bugs or feature requests.
This project uses Semantic Versioning (v2) and with major releases, breaking changes will occur.
📓 License
This project is licensed under the terms of the MIT open source license. Please refer to MIT for the full terms.