Conversion of a SQL model into a standard item model?
-
wrote on 22 Oct 2018, 11:56 last edited by
The development of SQL data models can be useful for some software applications. Some applications might prefer to work still with a standard item model for a while instead.
How often do you see the need to convert database information into the other programming interface by corresponding proxy model classes?
-
The development of SQL data models can be useful for some software applications. Some applications might prefer to work still with a standard item model for a while instead.
How often do you see the need to convert database information into the other programming interface by corresponding proxy model classes?
wrote on 22 Oct 2018, 13:47 last edited by@elfring said in Conversion of a SQL model into a standard item model?:
Some applications might prefer to work still with a standard item model for a while instead
May I ask why?
-
@elfring said in Conversion of a SQL model into a standard item model?:
Some applications might prefer to work still with a standard item model for a while instead
May I ask why?
wrote on 22 Oct 2018, 13:52 last edited byMay I ask why?
- Possible change resistance
- Unclear development efforts (and additional dependencies) for a software transformation to better SQL data models
-
May I ask why?
- Possible change resistance
- Unclear development efforts (and additional dependencies) for a software transformation to better SQL data models
wrote on 22 Oct 2018, 13:58 last edited by@elfring said in Conversion of a SQL model into a standard item model?:
Possible change resistance
Deal with it.
If you mean change in code, by only interacting withQStandardItemModel
via theQAbstractItemModel
interface as I always suggest, makes changing the model a matter of 1 code lineUnclear development efforts (and additional dependencies)
The additional dependency is the SQL module. Hard to get around it if you want to interact with an SQL database
-
@elfring said in Conversion of a SQL model into a standard item model?:
Possible change resistance
Deal with it.
If you mean change in code, by only interacting withQStandardItemModel
via theQAbstractItemModel
interface as I always suggest, makes changing the model a matter of 1 code lineUnclear development efforts (and additional dependencies)
The additional dependency is the SQL module. Hard to get around it if you want to interact with an SQL database
wrote on 22 Oct 2018, 14:07 last edited by… if you want to interact with an SQL database
Unfortunately, the Qt software documentation mentions specific limitations for the class “QSqlTableModel” so far.
-
Do you mean the ones solved by QSqlRelationalTableModel and QSqlRelationalDelegate mentioned in the documentation you are linking to ?
-
Do you mean the ones solved by QSqlRelationalTableModel and QSqlRelationalDelegate mentioned in the documentation you are linking to ?
wrote on 22 Oct 2018, 14:18 last edited byMaybe.
Do both table model classes share still the main restriction on editing from a single database table?
-
It's not a restriction, it's how the class works. QSqlTableModel as it name suggest allows access to one table.
So what exactly are you after ?
Specify a real situation
Specify a real need -
It's not a restriction, it's how the class works. QSqlTableModel as it name suggest allows access to one table.
So what exactly are you after ?
Specify a real situation
Specify a real needwrote on 22 Oct 2018, 14:28 last edited byQSqlTableModel as it name suggest allows access to one table.
Can such classes collaborate also with database views?
-
QSqlTableModel as it name suggest allows access to one table.
Can such classes collaborate also with database views?
wrote on 22 Oct 2018, 14:37 last edited byFrom the article you linked:
If the database system can determine the reverse mapping from the view schema to the schema of the underlying base tables, then the view is updatable. INSERT, UPDATE, and DELETE operations can be performed on updatable views.
Since there's no generic way for a Qt model to know that, it is left to the user to implement using
QSqlQuery
directly -
From the article you linked:
If the database system can determine the reverse mapping from the view schema to the schema of the underlying base tables, then the view is updatable. INSERT, UPDATE, and DELETE operations can be performed on updatable views.
Since there's no generic way for a Qt model to know that, it is left to the user to implement using
QSqlQuery
directlywrote on 22 Oct 2018, 14:44 last edited byWould it be nicer if a table model can determine if it is based on an updatable view?
-
wrote on 22 Oct 2018, 15:09 last edited by VRonin
Yes, but once again
@VRonin said in Conversion of a SQL model into a standard item model?:
there's no generic way for a Qt model to know that
-
Yes, but once again
@VRonin said in Conversion of a SQL model into a standard item model?:
there's no generic way for a Qt model to know that
wrote on 22 Oct 2018, 15:39 last edited byDo full-featured standard item models become a bit more attractive then?
-
Attractive for what ?
-
wrote on 28 Oct 2018, 13:10 last edited by
Would you like to compare the attractiveness of the mentioned data model variants any further?
-
I'll let you start by providing the analysis you want to discuss about.
-
wrote on 29 Oct 2018, 08:49 last edited by
Is there a “development competition” going on between data processing by SQL queries and/or Qt standard items?
-
Is there a “development competition” going on between data processing by SQL queries and/or Qt standard items?
@elfring said in Conversion of a SQL model into a standard item model?:
Is there a “development competition” going on between data processing by SQL queries and/or Qt standard items?
No, there is no competition going on.
@elfring, what is your goal for asking us these questions? Are you trying to get us to write a "software extension" for you?
-
@elfring said in Conversion of a SQL model into a standard item model?:
Is there a “development competition” going on between data processing by SQL queries and/or Qt standard items?
No, there is no competition going on.
@elfring, what is your goal for asking us these questions? Are you trying to get us to write a "software extension" for you?
wrote on 29 Oct 2018, 09:57 last edited byI hope that more software evolution can happen in this area so that the switching between discussed data models might become easier.
-
I hope that more software evolution can happen in this area so that the switching between discussed data models might become easier.
@elfring said in Conversion of a SQL model into a standard item model?:
I hope that more software evolution can happen in this area so that the switching between discussed data models might become easier.
We will not perform this "software evolution" because we cannot see any good reason to provide additional conversion/switching between QSqlTableModel and QStandardItemModel. Furthermore, none of your posts above provide convincing arguments for this conversion/switching.
4/35