[Qt-interest] Qt5 and SQL
Jason H
scorp1us at yahoo.com
Wed May 18 14:28:57 CEST 2011
While I absolutely despise [N]Hiberbate, it sounds like that is what you are
asking for.
I think a QHibernate could be cool, and we could improve on the hibernate at the
same time. For instance, I despise Hibernate because it violates DRY principals.
It requires a XML definition and a code (object) definition, not to mention the
actual change to the source. If we could use QMetaObject to construct the object
definition at run- or compile- time, then we'd have a less despicable version.
(Basically I imagine a file to have a field type preference and lay out the
relational structure, like the *.hbm.xml files, but we could run it through a
proxy generator or QMetaObject would create a meta type and register it at run
time.)
I also think this gets back to the XML DOM stuff, that is we can create a
relational structure, once we have an instance, we should be able to
automatically serialize between XML and RDBMS, as well as other structural
formats like JSON (NoSQL).
----- Original Message ----
From: Linos <info at linos.es>
To: Jason H <scorp1us at yahoo.com>
Cc: Qt-Interest <qt-interest at trolltech.com>
Sent: Wed, May 18, 2011 7:02:11 AM
Subject: Re: Qt5 and SQL
Well i will post any examples but the list could grow really large:
-Better support for Postgresql, any major upgrade break qt applications because
to detect capabilities of version the driver uses a simple case where unknown
versions get a broken route where sql models don't works, i sent the patch for
9.x versions but clearly this should be handled in a better way, and many great
features like async notifications for update models attached of updated tables
should be integrated in QT.
-QSqlQueryModel should have the option to work asynchronously, when i have a big
query it takes many seconds only to finish the exec of the query, only to later
show the first 15 records in a QTableView.
-in QSqlRelationalModel where a column have a relation set
model->data(model->index(row, column), Qt::EditRole) should give you the mapped
id, now you get the same display value that Qt::DisplayRole returns but
model->SetData works correctly. I have to do get the model and the relation of
the mapped column and use relModel->match(....) for the display value to get the
correct row and get the id from this model, if i have two different ids with
same display value i am out of luck.
-support for custom relations, any times i want to use as display values fields
in a third table or use something like "name || surname", and any times i have a
really big table where i only want to let the user select a small subset (where
filter), use QSqlTableModel like the only way to do the mapping it is not a
sufficient flexible way to do this.
-a simple way to create forms attached to a simple table would be great too, any
times i have a really simple database table, but if the table have any foreign
keys and you want to map to any widgets and such you end with a class that i
think it is too large for how a such a simple task should be.
-give support for QSqlRelationalDelegate to widgets other than QComboBox, for
example i have many read only QLineEdit where i want my users see the display
value.
-give support for QSqlRelationalTableModel and QSqlTableModel to directly set
any columns as readonly, have to subclass only for this don't seems reasonable
to me, many times you have column that the users need to see but should not be
changing.
This is only what i remember just now, i have written any subclasses to do this
work and much more for me (for example i have a huge QSqlQueryModel subclass
with write support where i can use joins and such in the query and the model do
the correct updates or inserts and much more features) but apart from any list
of features wanted the point it is that QtSql seems to be a bit forgotten by QT
developers, the support it is not complete (it can clearly improve) but still
don't get new features from some time ago.
For desktop applications that try to be for companies doing real work with big
normalized databases the support in Qt should be much better that it is now.
Regards,
Miguel Angel.
El 17/05/11 23:24, Jason H escribió:
> Can you clarify what love you would like QtSQL to get?
>
>
>
>
> ----- Original Message ----
> From: Linos<info at linos.es>
> To: Qt-Interest<qt-interest at trolltech.com>
> Sent: Sat, May 14, 2011 12:40:43 PM
> Subject: Re: [Qt-interest] Qt5 and XML DOM
>
> ...
>
> And from me, QtSql need some love too.
>
> Regards,
> Miguel Angel.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list