at our hackerspace we have been working tirelessly for the past half year to bring a great new ORM experience to D and Rust. The D side of this ORM can be found at:
It provides a nice D API to directly save data to any database, restore data, list data, etc.
- Declarative table/model definitions from D, with rich UDA annotations
- Command Line Interface to create migrations automatically from the D application, good for checking into the source repository and to distribute with the app
- Migrations allow both users and developers to update the database in their deployed app instances when needed, coming from any (or no) previous version
- High-level APIs both in D and Rust
- Support for MySQL, PostgreSQL and sqlite3 (MySQL and PostgreSQL drivers written in safe Rust)
- Automatic mapping between defined D datatypes and SQL
- Support for slim SQL queries by only using and selecting columns that are needed
- CRUD interface with support for dereferencing foreign keys, embedded structs, advanced SQL conditions that can represent almost any SQL condition using D code that looks similar to regular if statements
- Support for transactions
- Raw SQL API
- Streaming SQL responses (range interface)
- Async support with vibe.d - also works standalone with and without multithreading from the application
- Multithreaded connection pool
Documentation can be found here: https://rorm.rs/ (although very WIP still!)
Minimal sample project:
Bunch of integration tests, that show all the functionality:
Feel free to try it out and open issues! The API will probably still change a bunch in the future. However the current modelling capabilities should already suffice for a wide selection of apps you might want to test this in.
Looking forward to your feedback.