{"id":22308440,"url":"https://github.com/42bytelabs/geekorm","last_synced_at":"2026-02-07T02:08:47.973Z","repository":{"id":232675993,"uuid":"784931152","full_name":"42ByteLabs/geekorm","owner":"42ByteLabs","description":"GeekORM is a simple ORM for empowering your Rust development","archived":false,"fork":false,"pushed_at":"2025-07-08T18:06:16.000Z","size":887,"stargazers_count":14,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-08T19:25:05.910Z","etag":null,"topics":["database","object-relational-mapper","rust","sqlite"],"latest_commit_sha":null,"homepage":"https://docs.rs/geekorm/latest/geekorm","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/42ByteLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-10T21:09:20.000Z","updated_at":"2025-07-08T18:06:18.000Z","dependencies_parsed_at":"2024-05-13T15:43:16.450Z","dependency_job_id":"d9022a47-c71b-4a90-a6a2-9d36671e03fa","html_url":"https://github.com/42ByteLabs/geekorm","commit_stats":null,"previous_names":["42bytelabs/geekorm"],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/42ByteLabs/geekorm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42ByteLabs%2Fgeekorm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42ByteLabs%2Fgeekorm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42ByteLabs%2Fgeekorm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42ByteLabs%2Fgeekorm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/42ByteLabs","download_url":"https://codeload.github.com/42ByteLabs/geekorm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42ByteLabs%2Fgeekorm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267639569,"owners_count":24119780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","object-relational-mapper","rust","sqlite"],"created_at":"2024-12-03T20:14:01.833Z","updated_at":"2026-02-07T02:08:47.944Z","avatar_url":"https://github.com/42ByteLabs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable --\u003e\n\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eGeekORM\u003c/h1\u003e\n\n\u003cimg src=\"./assets/geekorm.png\" width=\"450\" title=\"GeekORM Logo\"\u003e\n\n[![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge\u0026logo=github\u0026logoColor=white)][github]\n[![Crates.io Version](https://img.shields.io/crates/v/geekorm?style=for-the-badge)][crates-io]\n[![Crates.io Downloads (recent)](https://img.shields.io/crates/dr/geekorm?style=for-the-badge)][crates-io]\n[![GitHub Stars](https://img.shields.io/github/stars/42ByteLabs/geekorm?style=for-the-badge)][github]\n[![GitHub Issues](https://img.shields.io/github/issues/42ByteLabs/geekorm?style=for-the-badge)][github-issues]\n[![Licence](https://img.shields.io/github/license/Ileriayo/markdown-badges?style=for-the-badge)][license]\n\n\u003c/div\u003e\n\u003c!-- markdownlint-restore --\u003e\n\n## Overview\n\n[GeekORM][crates-io] is a simple [Object Relation Mapper][docs-orm] for empowering your [Rust][rust-lang] development.\n\n## ✨ Features\n\n- Focus on simplicity\n- Rely on Derive Macros to generate code for your structs\n  - Using `Table`\n  - Using `Data`\n- Dynamically generate functions and corresponding SQL queries\n  - `.save(...)` - Inserting new rows\n  - `.update(...)` - Updating existing rows\n  - `.delete(...)` - Deleting rows\n- Support for Backends Drivers\n  - [`rusqlite`][lib-rusqlite]\n  - [`libsql`][lib-libsql] ([Turso][web-turso])\n- Automatic Migration Generation\n  - `geekorm-cli init` - Setup your migrations\n- [Extensive crate features](#-create-features)\n  - [`rand`][docs-rand]: Generate random strings (set lenght, set prefix, set enviroment)\n  - [`hash` or `password`][docs-hash]: Generate secure Hashes of passwords (set algorithm)\n  - and more...\n- [Documentation][docs]\n\n## 📦 Installation\n\n### 🦀 Library\n\nYou can install the library from [crates.io][crates]:\n\n```bash\ncargo add geekorm\n```\n\n\u003c!-- markdownlint-disable --\u003e\n\u003cdetails\u003e\n\u003csummary\u003eAdd the backend driver you want to use\u003c/summary\u003e\n\n```bash\ncargo add rusqlite\n# OR\ncargo add libsql\n```\n\nAlong with the backend driver for `geekorm`:\n\n```bash\ncargo add geekorm -F rusqlite\n# OR\ncargo add geekorm -F libsql\n```\n\n\u003c/details\u003e\n\u003c!-- markdownlint-restore --\u003e\n\n### 🛠️ CLI\n\nIf you want to manage your models and migrations using `geekorm`, you'll need to install the `geekorm-cli` command line tool.\n\n```bash\ncargo install geekorm-cli\n```\n\n## 🏃 Getting Started\n\nGeekORM is easy to setup and use in your Rust project.\n\n### 🏎️ Setting Up Migrations\n\nThe first thing you'll need to decide is if you want to use the `geekorm-cli` to manage your migrations or if you want to manage them manually.\n\nYou can use the `geekorm-cli` to help you manage your migrations.\n\n```bash\ngeekorm-cli init\n```\n\nThis will prompt you to enter some information about your setup and will generate a `crate` or a `module` for you to use.\nOnce you have setup your project, 2 new commands will be available to you:\n\n```bash\n# Generate a new migration (creates a new folders in your migrations directory)\ngeekorm-cli migrate \n# Validate your migrations (runs from your initial migration to the latest)\ngeekorm-cli test\n```\n\n### 🚀 Writing your first model\n\nOnce you have installed `geekorm`, you can start using the derive macros like the following:\n\n```rust\nuse anyhow::Result;\nuse geekorm::prelude::*;\n\n/// Using the `Table` derive macro to generate the `Users` table\n#[derive(Table, Debug, Default, serde::Serialize, serde::Deserialize)]\nstruct Users {\n    #[geekorm(primary_key, auto_increment)]\n    id: PrimaryKeyInteger,\n    /// Unique username field\n    #[geekorm(unique)]\n    username: String,\n    /// Password field with automatic hashing\n    #[geekorm(hash)]\n    password: String,\n    /// User Type Enum (defaults to `User`)\n    #[geekorm(new = \"UserType::User\")]\n    user_type: UserType,\n}\n\n#[derive(Data, Debug, Default, Clone)]\nenum UserType {\n    Admin,\n    Moderator,\n    #[default]\n    User,\n}\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    // Setup the database and connection\n    let database = ConnectionManager::connect(\":memory:\");\n    let connection = database.acquire().await?;\n\n    // Initialize or migrate the database using the `crate` or `module`.\n    // This is done using the `geekorm-cli` function\n    db::init(\u0026conn).await?;\n    // [OR] You can create the tables manually\n    Users::create_table(\u0026conn).await?;\n\n    // Use the generated `new` function to create a new User\n    // using the default values set in the struct.\n    let mut user = Users::new(\"GeekMasher\", \"ThisIsNotMyPassword\");\n    // Saving the new User in the database\n    user.save(\u0026connection).await?;\n    // Print the Primary Key value set by the database (auto_increment)\n    println!(\"User ID: {:?}\", user.id);\n\n    // Updating the Users account type to Admin\n    user.user_type = UserType::Admin;\n    user.update(\u0026connection).await?;\n\n    // Fetch the Admin Users\n    let admin_users = Users::fetch_by_user_type(\u0026connection, UserType::Admin).await?;\n    println!(\"Admin Users: {:?}\", admin_users);\n\n    // Counts the number of Users in the database\n    let total_users = Users::total(\u0026connection).await?;\n    println!(\"Total Users: {:?}\", total_users);\n\n    Ok(())\n}\n```\n\n### 🏄 Create Features\n\nThere are a number of opt-in features supported by GeekORM.\nFeatures can be added either [using `cargo add geekorm -F all`][docs-cargo-add] or added them directly in your `Cargo.toml` file.\n\n- `all`: Enable all the major stable features\n- [`new`][docs-new]: Generate `Table::new(...)` functions\n- [`helpers`][docs-helpers]: Generate a number of helper functions\n  - Select `Table::select_by_primary_key()`\n  - Select column `Table::select_by_{field}()`\n- [`rand`][docs-rand]: Support Generating random strings\n- [`hash`][docs-hash]: Support Generating password hashes\n- Backends\n  - `libsql`: Add LibSQL backend support\n  - `rusqlite`: Add Rusqlite backend support\n\n## 🧑‍🤝‍🧑 Maintainers / Contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://geekmasher.dev\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/2772944?v=4?s=100\" width=\"100px;\" alt=\"Mathew Payne\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMathew Payne\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#code-GeekMasher\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#review-GeekMasher\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/MsGeekMasher\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/93775622?v=4?s=100\" width=\"100px;\" alt=\"Cale\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eCale\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#design-MsGeekMasher\" title=\"Design\"\u003e🎨\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## 🦸 Support\n\nPlease create [GitHub Issues][github-issues] if there are bugs or feature requests.\n\nThis project uses [Semantic Versioning (v2)][semver] and with major releases, breaking changes will occur.\n\n## 📓 License\n\nThis project is licensed under the terms of the MIT open source license.\nPlease refer to [MIT][license] for the full terms.\n\n\u003c!-- Resources --\u003e\n\n[license]: ./LICENSE\n[crates-io]: https://crates.io/crates/geekorm\n[docs]: https://docs.rs/geekorm/latest/geekorm\n[rust-lang]: https://www.rust-lang.org/\n[semver]: https://semver.org/\n[github]: https://github.com/42ByteLabs/geekorm\n[github-issues]: https://github.com/42ByteLabs/geekorm/issues\n[crates]: https://crates.io\n[docs-orm]: https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping\n[docs-cargo-add]: https://doc.rust-lang.org/cargo/commands/cargo-add.html#dependency-options\n\n[docs-new]: https://docs.rs/geekorm-derive/latest/geekorm_derive/derive.GeekTable.html#generate-new-rows\n[docs-helpers]: https://docs.rs/geekorm-derive/latest/geekorm_derive/derive.GeekTable.html#generated-helper-methods\n[docs-hash]: https://docs.rs/geekorm-derive/latest/geekorm_derive/derive.GeekTable.html#generate-hash-for-storing-passwords\n[docs-rand]: https://docs.rs/geekorm-derive/latest/geekorm_derive/derive.GeekTable.html#generate-random-data-for-column\n\n[lib-libsql]: https://github.com/tursodatabase/libsql\n[lib-rusqlite]: https://github.com/rusqlite/rusqlite\n[web-turso]: https://turso.tech/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42bytelabs%2Fgeekorm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F42bytelabs%2Fgeekorm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42bytelabs%2Fgeekorm/lists"}