If you have MBS, its SQLDatabaseMBS can connect from iOS to MSSQL (I know this is not what you’re asking for). MBS do have the mysql-8.4.4-macos15-arm64 drivers for macOS, but I’m not sure if this works for iOS. PostgreSQL is not available for iOS through SQLDatabaseMBS.
Christian has mentioned he is open for people to pay him to bring the C++ MySQL and PostgreSQL drivers to iOS (I’m not sure of the time/cost). I haven’t tried SQLDatabaseMBS from Android, but I don’t think Christian can provide any SQL drivers for Android until he gets a Xojo SDK kit for Android (not coming according to Xojo) or possibly the new Libraries feature for Xojo, which Xojo have said includes Android.
My understanding is, that literally nobody should consider direct access to a sql database from a mobile device, which connects thru the open internet. Because of security concerns and open ports needed. Middleware on a server is used for this, via REST for example.
That’s an industry standard. A mobile app should contact external DBs using some sort of protected API, reading/writing what they need without keeping an active connection.
The preferred design to connect a mobile app to a database service such as MySQL is to do so via a web service. The service connects to the DB and the mobile app connects to the web service. This would typically be a REST design and is far more reliable, secure and better for mobile device resources.
You can learn more about web services and find a video about how to build a database web service in the docs: Accessing Web Services
react/next.js running on node.js? it have server side actions with direct access.
you could make a entire web app based on java script / type script divided into server and client side. (Editor WebStorm or VS Code) similar to xojo web app then.
the database itself could also output json
SELECT json_object('name', name, 'phone', phone)
FROM person;
I’m not a world class expert in Xojo, but I’ve connected a few databases in my time. No mobile database client I know of can create a direct connection to an external database server like MySQL. You can do this by accessing a web page which has a MySQL back end, or create/adopt a web service. Client connections like ODBC and ADO won’t cut it. I suppose creating a web view in your IOS app would be the most direct way.
As an essentially lazy person, I would opt for doing a web page and using Mobile Safari. But if you’re wedded to the IOS app premise, embed a web view.
If you actually want to do work (unlike myself), try this:
Phones are built for intermittent cellular connections and protocols like HTTP were tailor made for systems like that. Desktops with an OS that can handle gigabit ethernet and ADO and such are simply more robust and offer you more options than you can squeeze into a phone. Client server on a desktop is predicated on the assumption of a continual connection with constant two way communication. That can’t be assumed on a phone out in the wild, whether you’re using wifi or cellular.
Internet is a wild place. There are hackers actively scanning vulnerabilities there as a DB door exposed, and will try to gain access to it. Many times they will.
If you implement a good middleware, or it will get listed as an “unknown” port by the scanner, or some sort of HTTP whatever they maybe are not interested in trying to explore.
i think the phone network is not the issue.
it is more the concept and mind set of apple or google if they will support all this databases (via driver software)
or people need their cloud services.
object serialization is more welcome than this relational database from my point of view.
about network connection to a database we have digital certificate, a hacker will not have success without.
Keep in mind that there are always unintended vulnerabilities and exposing a database directly to the internet is a great invitation for someone to try and find one. Unless you’ll be keeping up and installing patches for every zero day hack that comes out, it’s still best to protect a database with an API. not to mention that it also allows you to do things like throttling if someone decides to abuse the server in some way.