Skip to content

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.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

emirror-de/naphtha

Repository files navigation

naphtha

Universal database connection layer

License

Crates.io docs.rs naphtha

Crates.io naphtha-proc-macro

Please checkout the documentation page for more information (also see examples folder in naphtha)

About

This 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.

The models can also be compiled and used without database connection support for better usage on server and client side.

Roadmap

  • Connect to database using a wrapper, defining the base for interchangeable Databases
  • Implement support for diesel::SQLiteConnection
  • Create traits to enable database interaction before and after the execution of the insert, update or remove transactions
  • Implement query_by_{property} for querying models from the database using an exact match of the given property
  • Thread safe sharing of the database connection
  • Integrate barrel crate for writing migrations in Rust, available at runtime
  • Implement support for diesel::MySqlConnection
  • Implement support for diesel::PgConnection
  • Connection pooling?
  • More databases?

Troubleshooting

It 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.

Contributing

Unless explicitly stated, any contribution intentionally submitted for inclusion in this project, as defined in the Apache-2.0 license, shall be dual licensed as below, without any additional terms or conditions.

License

Licensed under either of

at your option.

About

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.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published