Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

SQL with WebAssembly



  • I would like to compile my application for WebAssembly. The animatedtiles example as described in this article https://blog.qt.io/blog/2019/03/05/using-docker-test-qt-webassembly/ works without any problems. In my application I use the sql module. If I want to compile it I get the following error:

    Info: creating stash file /project/build/.qmake.stash
    cd address/ && ( test -e Makefile || /usr/local/Qt-5.13.1/bin/qmake -o Makefile /project/source/address/address.pro ) && make -f Makefile 
    cd user/ && ( test -e Makefile || /usr/local/Qt-5.13.1/bin/qmake -o Makefile /project/source/user/user.pro ) && make -f Makefile 
    cd login/ && ( test -e Makefile || /usr/local/Qt-5.13.1/bin/qmake -o Makefile /project/source/login/login.pro ) && make -f Makefile 
    Project ERROR: Unknown module(s) in QT: sql
    Makefile:50: recipe for target 'sub-address-make_first' failed
    make: *** [sub-address-make_first] Error 3
    make: *** Waiting for unfinished jobs....
    Project ERROR: Unknown module(s) in QT: sql
    Project ERROR: Unknown module(s) in QT: sql
    Makefile:152: recipe for target 'sub-user-make_first' failed
    Makefile:127: recipe for target 'sub-login-make_first' failed
    make: *** [sub-user-make_first] Error 3
    make: *** [sub-login-make_first] Error 3
    

    Why is the sql module not found?


  • Lifetime Qt Champion

    Hi,

    AFAIK, the QtSql module is currently not available for web assembly.

    @lorn-potter might be able to shed some more light on it.



  • @infinity , @SGaist
    I asked this recently See the response I got at https://forum.qt.io/topic/105944/qt-for-webassembly-widget-example-gone/18

    1.I understand about limitations like no local files, no sub-processes. What about MySQL database access via the Qt classes? Do I assume you cannot have your code access SQL db from browser?

    Not at this point. Although someone has now ported sqlite to wasm, which would be the first step.



  • Someone has ported sqlite to wasm...
    https://github.com/fluencelabs/sqlite

    You could start with that.
    I am unclear if any work on the Qt side would be needed to get Qt compiled with support for sqlite.


Log in to reply