Thread overview
DORM - a new D ORM
Nov 24, 2022
WebFreak001
Nov 24, 2022
bauss
Dec 01, 2022
singingbush
Dec 01, 2022
WebFreak001
Dec 02, 2022
singingbush
November 24, 2022

Hello!

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:

https://code.dlang.org/packages/dorm

It provides a nice D API to directly save data to any database, restore data, list data, etc.

Current features:

  • 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:
https://github.com/rorm-orm/dorm/tree/ee221e6c66bf460b77592c208d1620a93a007a66/testapp

Bunch of integration tests, that show all the functionality:
https://github.com/rorm-orm/dorm/tree/ee221e6c66bf460b77592c208d1620a93a007a66/integration-tests

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.

November 24, 2022

On Thursday, 24 November 2022 at 06:19:24 UTC, WebFreak001 wrote:

>

Hello!

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:

https://code.dlang.org/packages/dorm

It provides a nice D API to directly save data to any database, restore data, list data, etc.

Current features:

  • 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:
https://github.com/rorm-orm/dorm/tree/ee221e6c66bf460b77592c208d1620a93a007a66/testapp

Bunch of integration tests, that show all the functionality:
https://github.com/rorm-orm/dorm/tree/ee221e6c66bf460b77592c208d1620a93a007a66/integration-tests

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.

This looks very promising. The embedded feature looks great.

December 01, 2022

On Thursday, 24 November 2022 at 06:19:24 UTC, WebFreak001 wrote:

>

Hello!

at our hackerspace we have been working tirelessly for the past half year to bring a great new ORM experience to D and Rust.

Is there likely to be support for MS-SQL Server and Oracle in the future?

December 01, 2022

On Thursday, 1 December 2022 at 06:53:59 UTC, singingbush wrote:

>

On Thursday, 24 November 2022 at 06:19:24 UTC, WebFreak001 wrote:

>

Hello!

at our hackerspace we have been working tirelessly for the past half year to bring a great new ORM experience to D and Rust.

Is there likely to be support for MS-SQL Server and Oracle in the future?

MS-SQL is possible because the underlying SQL library we use (sqlx) supports it, but we didn't implement the SQL syntax for this yet and we don't really have it on our to-do list right now.

Other than the supported SQLite, MySQL, PostgreSQL and potentially MS-SQL I can't promise any support though.

Oracle MySQL should work or do you mean some other database?

If you have any real use-case for them feel free to open an issue though.

December 02, 2022

On Thursday, 1 December 2022 at 08:04:19 UTC, WebFreak001 wrote:

>

On Thursday, 1 December 2022 at 06:53:59 UTC, singingbush wrote:

>

On Thursday, 24 November 2022 at 06:19:24 UTC, WebFreak001 wrote:

>

Hello!

at our hackerspace we have been working tirelessly for the past half year to bring a great new ORM experience to D and Rust.

Is there likely to be support for MS-SQL Server and Oracle in the future?

MS-SQL is possible because the underlying SQL library we use (sqlx) supports it, but we didn't implement the SQL syntax for this yet and we don't really have it on our to-do list right now.

Other than the supported SQLite, MySQL, PostgreSQL and potentially MS-SQL I can't promise any support though.

Oracle MySQL should work or do you mean some other database?

If you have any real use-case for them feel free to open an issue though.

I mean Oracle's own db such as Oracle Database 19c. In the time I've used and contributed to ddbc I've worked in places that relied on both Oracle and SQL Server so having the option is certainly useful although not my personal choice.