Is there some convenient ORM library framework for c?

c, database, orm

Solution

Having a need for ORM suggests to me that you have some sort of business / domain object model in mind that you want to map to a database.

If that is the case, then it strikes me that you are trying to write a business application in a language best suited for systems programming (C). You might want to consider whether this is a good architectural strategy.

Furthermore, I don't think ORM is ever likely to be a good fit for a language that:

- Isn't itself object-oriented

- Doesn't have much support for meta-programming / reflection which tends to be central to many ORM schemes

Finally, there are plenty of people who believe that ORM is an anti-pattern in any case. (example, example, example)

Overall, my suggestion would be to either:

- Avoid ORM altogether if you plan to continue using C

- Switch to a language / platform where ORM is at least well supported and fits the paradigm (most obviously Java)

Problem

I use sqlite3 with c language recently. Can anyone tell me some convenient ORM for c? Is there necessay to develop a ORM mechanism for my own projects?

Original source