generate table sql schema from QSql* classes
Unsolved
General and Desktop
-
Hi.
Is it possible to generate a sql schema from QSqlRecord and QSqlField classes? I use these classes because they are x-platform and work with any database that Qt supports.PS1: AFAIK there is no direct support for primary key and foreign key detection in qt. how can I implement this?
PS2: The result schema should change based on selected sql driver. Does Qt handles this or I should create a class hierarchy for this based on sql driver?Thanks :-)
-
There is no support for such stuff, but some of your information can be gathered:
- PK: QSqlDatabase::primaryIndex()
- Column types: QSqlDatabase::record()