First version of QtPersistence released
So, awhile back, I asked about an ORM framework for Qt. I didn't find much else in that category, and nobody else had any thing that was feasible either. I appreciated the suggestions about QDataStream, the XML stuff the Kadu folks are doing, etc, but I really wanted a database - perhaps because I'm crazy like that.
Anyways, I spent about 6 weeks of spare time, and started the QtPersistence project - which is releasing it's first version today - and because I'm blogging about it, it's now official.
The release notes are here and the tarball is here. I'll probably do another release in about two weeks that does a better job of setting up various bits of project infrastructure but I got something that works passes its test suite, so I'm putting it out there. As always, constructive feedback is welcome.
Update: I left out the most important thing! The source code repository is on Gitorious at http://www.gitorious.org/qtpersistence
December 30th, 2009 - 17:14
Persistence != ORM
December 31st, 2009 - 09:02
Nice to see you working on this! By the way, I took a look at the code and do you plan tu support object relations? If so, I think you’ll find the .save() function in persistent objects is not the most appropiate way to handle them. That’s why I used a manager and commit() and rollback() functions in Kandau.
Also, you may be interested in Wt::Dbo, which has been released recently:
http://www.webtoolkit.eu/wt#/blog/2009/11/26/wt__dbo__an_orm__c___style/more
December 31st, 2009 - 13:00
@Jay: exactly right. Not such a great name, but the name can always be changed. I suck at naming things, so I’d love to see any suggestions.
@Albert: eventually, yes. I’m sure there will be a refactoring that will need to be done to support those, and the necessary evils around them.
I just saw Wt::Dbo the other day in fact, and intend to look at it more soonish.
Thanks for the comments everybody!
January 2nd, 2010 - 03:35
Hi,
IMHO that’s a very cool project! I have some questions:
1 Do you intend to support already existing databases, which includes fine graned control over QtPersistence?
1a E.g., IMHO it would be useful to have an option for telling QtPersistence, that all columns in all tables which name is USER_ID can be looked up in a table named USER.
1b Would also be useful if one could control e.g. the format of dates (e.g. already existing databases may not use the rdbms’ builtin date format, but only some kind of string representation).
2 Do you think that some time in the future it will possible of supporting non-database backend, e.g. saving data in-memory, using Qt-objects only?
3 I have never managed to understand Qt’s Interview framework as soon as it comes to QAbstractItemModel. Do you plan to make it possible of “abusing” QtPersistence as a workaround for that? I mean, instead of creating a new class which inherits from QAbstractItemModel one could use QtPersistence? I know that it is already possible to manipulate or view one single database table using Interview, but a table is not a tree…
Regards
Mario