Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. generate table sql schema from QSql* classes

generate table sql schema from QSql* classes

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 311 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MajidKamali
    wrote on last edited by
    #1

    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 :-)

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      There is no support for such stuff, but some of your information can be gathered:

      • PK: QSqlDatabase::primaryIndex()
      • Column types: QSqlDatabase::record()

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved