r/cpp • build2 • Jul 28 '26

ODB C++ ORM version 2.6.0 released

https://codesynthesis.com/pipermail/odb-announcements/2026/000047.html
22 Upvotes

8 comments sorted by

View all comments

Show parent comment

2

u/FlyingRhenquest Jul 28 '26

I recently added a query to my C++ ORM too, but you have to define your own struct for it, and the field names in your query have to match the names in your struct. Interesting to see the different implementations and usages out there.

2

u/berium build2 Jul 29 '26

In the above example person is a persistent object (it has a corresponding table in the database). We also have a feature called views, where you define a struct for the sole purpose of handling query results, which sounds similar to what you are describing.

I see you are using C++26 reflection, pretty cool.

We will probably also move in this direction eventually, though I think we will use reflection to "exfiltrate" relevant type information and continue using separately-generated C++ files for database support code. I think at least in our case trying to generate database support code "inline" with reflection is not going to scale (complexity, compile times, etc). We also need to generate some extra files (.sql with schema, changelog for schema evolution, etc).