ORM for Qt
-
The Best performance was for QDjango, QxOrm and Standard Qt model. All three techniques gave same result in many cases but QxOrm is the best from features prespactive while QDjango is the best from simplicity and rapid usage.
Personally I use QDjango because it fits my needs while I left QxOrm becasue of license issue (actually it's heavy by comparing to QDjango)
-
I am leaning towards QDjango as well, but there are still a few questions left, one of which is about relationships. QxOrm supports them, but I guess I have to implement it myself with QDjango. Do you have experience maintaing relationships with QDjango?
Also, I noticed that QDjango uses API deprecated in Qt5 (I had to specifically enable it to build the lib). Does this bother you at all? -
[quote author="Skh1002" date="1373580970"]I am leaning towards QDjango as well, but there are still a few questions left, one of which is about relationships. QxOrm supports them, but I guess I have to implement it myself with QDjango. Do you have experience maintaing relationships with QDjango? [/quote]
I'm just like you I'm still working on it and I don't know how to connect to relationships with QDjangobq. Also, I noticed that QDjango uses API deprecated in Qt5 (I had to specifically enable it to build the lib). Does this bother you at all?
Which version you're using? I use 0.4 which works in Qt5
P.S. for more info you can join to "QDjango mailing list":http://groups.google.com/group/qdjango
-
I have the same version as you, but in Qt5.1 (with which I compiled it) some of the now deprecated API QDjango uses are removed by default. I don't know in which version of Qt this started. I had to insert something like
@
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040800
@
somewhere in qdjango.pri to compile it properly. -
I have just looked into the test suite bundled with QDjango and there are cases for one-to-many and many-to-many relationships. So, apparently, there is support of such relationships. I will give it a spin to see how convenient it is compared to pure Qt.
-
It appears that there is no relationship support in QDjango, after all. You can only emulate relationships with query sets on foreign keys. Further on, to create a many-to-many relationship between two entities, one must create a third one (equivalent to a separate foreign key table) and then filter query sets based upon that third entity. That's all very much doable, but basically amounts to hand-coding all of relationship management.
QxOrm does provide relationship support, so it may be more convenient to use if you need to maintain many relationships and/or fiddle with them a lot. I think I am still going to try QDjango first and fall back on QxOrm if it does not work out.
Please, let me know of your experience with QDjango. I will post my impressions after I play with it.
-
Hi,
I'm the developer of QxOrm library.
FYI, we have released QxEntityEditor to make easier to work with QxOrm library : now, you can design your data model in few minutes and generate quickly a Qt/C++ project (and the SQL database associated).
More details here : "http://qt-project.org/forums/viewthread/35932/":http://qt-project.org/forums/viewthread/35932/ -
After years of this post, Qt still without a practical open source ORM :(
The only reliable option is QxOrm which is useless without QxEntityEditor because it's complicated without it but QxEntityEditor is commercial product so I'm still using the old way with Qt.
Cheers
-
If anyone is still interested, ORM-Qt is on a MIT license.
https://github.com/victorzhuk/orm-qt -
-
-
I have found Nut https://marketplace.qt.io/collections/all-products/products/nut resp. https://github.com/HamedMasafi/Nut which results actively maintained.
Not sure if the one mentioned in the previous post (CuteEntityManager, https://github.com/Professi/cuteentitymanager) is still alive...