Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. SQL is still not supported?
Forum Updated to NodeBB v4.3 + New Features

SQL is still not supported?

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
9 Posts 4 Posters 1.1k 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.
  • 1 Offline
    1 Offline
    1XU7
    wrote on last edited by
    #1

    Hi!.. excuse me my ignorance regarding to my question.. i dont know the reason to think SQL is not supported for Qt Assembly, will it be availble in the future or will it remains is this state?

    Im just speculating, i dont know if this is even possible, but i think a tricky solution is to create a console Qt program that receive as input a Sql QString to be called, this process should be made from this terminal program, then from your Sandbox Web you call somehow the terminal program with the argument.... i think it can work when you want to write to DB, but read from... i cant find a way ..

    1 Reply Last reply
    0
    • lorn.potterL Offline
      lorn.potterL Offline
      lorn.potter
      wrote on last edited by
      #2

      Indeed, it is still not supported. SQL is a filesystem based database, and WebAssembly does not have access to local filesystems.

      https://bugreports.qt.io/browse/QTBUG-70505

      Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
      Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

      D 1 Reply Last reply
      2
      • lorn.potterL lorn.potter

        Indeed, it is still not supported. SQL is a filesystem based database, and WebAssembly does not have access to local filesystems.

        https://bugreports.qt.io/browse/QTBUG-70505

        D Offline
        D Offline
        dzmad
        wrote on last edited by
        #3

        @lorn-potter said in SQL is still not supported?:

        Indeed, it is still not supported. SQL is a filesystem based database, and WebAssembly does not have access to local filesystems.

        https://bugreports.qt.io/browse/QTBUG-70505

        Why blazor C# can do it ?

        JonBJ 1 Reply Last reply
        0
        • D dzmad

          @lorn-potter said in SQL is still not supported?:

          Indeed, it is still not supported. SQL is a filesystem based database, and WebAssembly does not have access to local filesystems.

          https://bugreports.qt.io/browse/QTBUG-70505

          Why blazor C# can do it ?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @dzmad
          I think that is to do with it doing the SQL server-side from an application? E.g. https://stackoverflow.com/a/70835571/489865

          You would need a Db with an HTTP based API but then be very aware that your credentials will be public. A Web based Client is not secure.

          This is why all SPA apps that need a backend Database use an API server for Db access. Take a look at the Blazor Wasm + Hosted template, see if that works for you.

          And in a comment on that page

          No, the issue is that SqlClient is in principle not supported in Blazor webassembly.

          https://github.com/dotnet/SqlClient/issues/599#issuecomment-648471541

          ?

          D 1 Reply Last reply
          1
          • JonBJ JonB

            @dzmad
            I think that is to do with it doing the SQL server-side from an application? E.g. https://stackoverflow.com/a/70835571/489865

            You would need a Db with an HTTP based API but then be very aware that your credentials will be public. A Web based Client is not secure.

            This is why all SPA apps that need a backend Database use an API server for Db access. Take a look at the Blazor Wasm + Hosted template, see if that works for you.

            And in a comment on that page

            No, the issue is that SqlClient is in principle not supported in Blazor webassembly.

            https://github.com/dotnet/SqlClient/issues/599#issuecomment-648471541

            ?

            D Offline
            D Offline
            dzmad
            wrote on last edited by
            #5

            @JonB yes, but I am talking about SQLite :
            https://www.youtube.com/watch?v=ZeJISZgy-FM
            https://github.com/JeremyLikness/SqliteWasmHelper
            https://docs.microsoft.com/en-us/answers/questions/725826/blazor-pwa-with-sqlite.html

            1 Reply Last reply
            0
            • lorn.potterL Offline
              lorn.potterL Offline
              lorn.potter
              wrote on last edited by
              #6

              I am not sure how much sense it makes to have a local filesystem database in the browser, seeing as the file systems are limited space, and only IDBFS would be persistent (which is not mounted by default)

              What is your use case?

              All you need to do is edit (in Qt6) configure.cmake and remove the NOT WASM from the stanza on sql, then reconfigure with -feature-thread. It will use the included 3rd party sqlite. Tested the books sql example and seems to work.

              But it is possible. :) Just not supported.

              Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
              Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

              D 1 Reply Last reply
              2
              • lorn.potterL lorn.potter

                I am not sure how much sense it makes to have a local filesystem database in the browser, seeing as the file systems are limited space, and only IDBFS would be persistent (which is not mounted by default)

                What is your use case?

                All you need to do is edit (in Qt6) configure.cmake and remove the NOT WASM from the stanza on sql, then reconfigure with -feature-thread. It will use the included 3rd party sqlite. Tested the books sql example and seems to work.

                But it is possible. :) Just not supported.

                D Offline
                D Offline
                dzmad
                wrote on last edited by
                #7

                @lorn-potter I would like to create a demo of an existing application where we can test directly in the browser, since it's a demo it doesn't matter that the storage is limited.

                1 Reply Last reply
                0
                • lorn.potterL Offline
                  lorn.potterL Offline
                  lorn.potter
                  wrote on last edited by
                  #8

                  In Qt 6.4.0, sqlite will be available.

                  Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
                  Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

                  1 Reply Last reply
                  1
                  • D Offline
                    D Offline
                    dzmad
                    wrote on last edited by
                    #9

                    SQLite 3.40 is now available with official support for Wasm

                    1 Reply Last reply
                    0

                    • Login

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