Having the need for ORM, it seems to me that you have some kind of business model for the business / domain that you want to map to the database.
If so, then it seems to me that you are trying to write a business application in the language most suitable for system programming (C). Perhaps you should consider whether this is a good architectural strategy.
In addition, I do not think that ORM will always be suitable for a language that:
- Not object oriented
- It does not have much support for metaprogramming / reflection, which tends to be central to many ORM schemes.
Finally, there are many people who believe that ORM is an anti-pattern anyway. ( example , example , example )
Overall, my suggestion would be either:
- Avoid ORM at all if you plan to continue using C
- Switch to a language / platform where ORM is at least well supported and consistent with a paradigm (most obviously Java)
source share