Qt 5.12 static build for webassembly: cannot configure mysql database
-
I want to access mysql database with Qt for webassembly based application. I followed the instructions mentioned here https://blog.qt.io/blog/2018/11/19/getting-started-qt-webassembly/ and did a static build. I am able to build and make the example projects (e.g: gui, quick controls2 based applications) but I am unable to configure mysql. I am a newbie to Qt and can please suggest me a way forward?
P.s: I am using debian stretch on hyper-v terminal running on windows 10.
-
@Baru said in Qt 5.12 static build for webassembly: cannot configure mysql database:
but I am unable to configure mysql
means in detail?
-
I mean that with the configure option that I use "~/Qt/5.12.0/Src/configure -xplatform wasm-emscripten -nomake examples -prefix $PWD/qtbase" I am only able to get SQLite as the default database.
Ref to:
http://doc.qt.io/archives/qt-4.8/sql-driver.html
which says "Due to the practicalities of dealing with external dependencies, only the SQLite3 plugin is shipped with binary builds of Qt."
But I would like to enable / build mysql database plugin (I think) as it is the one I use for my application. -
@Baru
i see 2 major problems which are highly possible show breakers:- QNetwork mdule isn't ported yet to Qt WebAssembly (QTBUG-63920) - IIRC (server is currently down)
- you would need to compile the mysql lib with emscripten (similar like for Android) and all follow up issues - and there is a high chance that not even all required network API functions are available
So i think it's even easier - and probably saves a lot of headache - to let the hosting server do the DB access. Like you would do for a normal website.
You can use QWebSocket to communicate with the host server. QWebSocket is known to be already working with QtWebAssembly. -
@raven-worx
Thanks a lot. Now, I got a perspective on how I can proceed further. I will try the solution with the QWebSocket and see how that goes.
Cheers!