{"id":15567002,"url":"https://github.com/emirror-de/naphtha","last_synced_at":"2025-04-23T23:48:18.461Z","repository":{"id":57643345,"uuid":"357896472","full_name":"emirror-de/naphtha","owner":"emirror-de","description":"Universal database connection layer for your application in Rust. Implements the most common functions insert, update and remove for database connections. Change the database without having to adjust your code. Specific models can be stored in different databases. Query models by property. Migrations in pure Rust and available during runtime.","archived":false,"fork":false,"pushed_at":"2022-09-12T15:15:36.000Z","size":118,"stargazers_count":5,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-23T23:48:12.794Z","etag":null,"topics":["database","database-connector","database-migrations","models","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emirror-de.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["emirror-de"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-04-14T12:24:48.000Z","updated_at":"2022-06-20T23:15:51.000Z","dependencies_parsed_at":"2022-08-27T21:53:01.280Z","dependency_job_id":null,"html_url":"https://github.com/emirror-de/naphtha","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emirror-de%2Fnaphtha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emirror-de%2Fnaphtha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emirror-de%2Fnaphtha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emirror-de%2Fnaphtha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emirror-de","download_url":"https://codeload.github.com/emirror-de/naphtha/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250535098,"owners_count":21446505,"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","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","database-connector","database-migrations","models","rust-lang"],"created_at":"2024-10-02T17:09:33.036Z","updated_at":"2025-04-23T23:48:18.437Z","avatar_url":"https://github.com/emirror-de.png","language":"Rust","funding_links":["https://github.com/sponsors/emirror-de"],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2021 Lewin Probst, M.Sc. \u003cinfo@emirror.de\u003e\n\nSPDX-License-Identifier: MIT OR Apache-2.0\n--\u003e\n\n# naphtha\n\n*Universal database connection layer*\n\n[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-informational?style=flat-square)](COPYRIGHT.md)\n\n[![Crates.io](https://img.shields.io/crates/v/naphtha.svg)](https://crates.io/crates/naphtha) [![docs.rs](https://img.shields.io/docsrs/naphtha?style=flat-square)](https://docs.rs/naphtha) **naphtha**\n\n[![Crates.io](https://img.shields.io/crates/v/naphtha-proc-macro.svg)](https://crates.io/crates/naphtha-proc-macro) **naphtha-proc-macro**\n\nPlease checkout the [documentation page](https://docs.rs/naphtha) for more information (also see examples folder in [naphtha](./naphtha/examples))\n\n\n## About\n\nThis crate is to simplify the creation and usage of models that require a database connection. If applied correct, changing the database type is only a feature flag away.\n\nThe models can also be compiled and used without database connection support for better usage on server and client side.\n\n## Roadmap\n\n- [x] Connect to database using a wrapper, defining the base for interchangeable Databases\n- [x] Implement support for `diesel::SQLiteConnection`\n- [x] Create traits to enable database interaction before and after the execution of the `insert`, `update` or `remove` transactions\n- [x] Implement `query_by_{property}` for querying models from the database using an exact match of the given property\n- [x] Thread safe sharing of the database connection\n- [x] Integrate `barrel` crate for writing migrations in Rust, available at runtime\n- [x] Implement support for `diesel::MySqlConnection`\n- [x] Implement support for `diesel::PgConnection`\n- [ ] Connection pooling?\n- [ ] More databases?\n\n## Troubleshooting\n\nIt is very easy to get a whole bunch of `trait bound not satisfied` error messages when your model is not configured correctly. Make sure that your `schema` module and the containing `table!` definition is in line with your `model` definition and that it uses the correct types defined by [barrel](https://docs.rs/barrel).\n\n## Contributing\n\nUnless explicitly stated, any contribution intentionally submitted\nfor inclusion in this project, as defined in the Apache-2.0 license, shall be\ndual licensed as below, without any additional terms or conditions.\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n  https://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or\n  https://opensource.org/licenses/MIT)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femirror-de%2Fnaphtha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femirror-de%2Fnaphtha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femirror-de%2Fnaphtha/lists"}