making things suck less mattr's blog

29Dec/094

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

Comments (4) Trackbacks (0)
  1. Persistence != ORM

  2. 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

  3. @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!

  4. 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


Leave a comment


No trackbacks yet.

Calendar

December 2009
S M T W T F S
« Nov   Jan »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Meta