Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Build Postgresql driver for Webassembly

    Qt for WebAssembly
    3
    6
    756
    Loading More Posts
    • 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.
    • Y
      YasserFathy last edited by

      Hello all and thanks for your suppot,

      I was working on a QT application and intended to try to build it for webassembly.

      I followed the instructions here "https://doc.qt.io/qt-5/wasm.html" and was able to build qt using emscripten.

      Since my application uses Postgresql, I have to build the drivers for webassembly as well, this is where things got confusing, I tried to follow the instructions here "https://doc.qt.io/qt-5/sql-driver.html":

      "cd $QTDIR/qtbase/src/plugins/sqldrivers
      qmake -- PSQL_INCDIR=/usr/include/pgsql
      make sub-psql"

      where "qmake" is the one resulting from the emscripten build

      but running "make sub-psql" results in a message:
      "Project ERROR: No module claims plugin type 'sqldrivers'
      Makefile:44: recipe for target 'sub-psql' failed"

      Appreciate your help.

      Best Regards,

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        I haven't used that module yet but the first thing I would check is whether PostgreSQL has libraries for WASM.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • Y
          YasserFathy last edited by

          Hello SGaist,

          Thanks for your response.

          Let me make sure I understand, the commends :
          qmake -- PSQL_INCDIR=/usr/include/pgsql
          make sub-psql"

          builds the SQL library of Qt, but it requires the driver APIs to be compatible, but what I did is that I provided PostgreSQL include path that is a desktop build not emscripten, so the qmake script recognized that and failed ?

          If that's the case, would building PostgreSQL using emscripten be an alternative ? I looked online for a ready build but couldn't find something that seemed mature.

          Appreciate your help.

          BR.

          1 Reply Last reply Reply Quote 0
          • Y
            YasserFathy last edited by

            Let me ask another question, is there a different SQL database solution that would allow me to port my application to WASM with minimal overhead ?

            Thanks.

            JonB 1 Reply Last reply Reply Quote 0
            • JonB
              JonB @YasserFathy last edited by JonB

              @YasserFathy
              So far as I understood, QtSql is not supported (yet?) in WASM, that would include even SQLite. @lorn-potter would be your expert, if he happens to see this.

              1 Reply Last reply Reply Quote 0
              • Y
                YasserFathy last edited by

                Thanks Jon, hope he sees it.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post