Database support in iOS ?

Will there be full database support on the Xojo iOS platform ?
In fact, will a Xojo iOS App be able to connect to a MySQL or PgSQL database ?

Thank you very much,

Since Xojo for iOS has not been released, no detail specification have been (or like will be) released yet.
So nobody know (and those that do know aren’t allow to talk about it)

As far as I remember first version will only have SQLite.
So I already prepare a session for my conference to show attendees how to write their own middleware to provide database access to MySQL and others via own server software.

Thanks Christian, that’s what I expected. I think they maybe will add it later on …

Competition such as Livecode have SQL support. It would make sense for Xojo to offer that.

Absolutely. It would also make porting Desktop Apps to iOS more painless.

Christian, what about those of us in the US that can’t attend your conference?

I am waiting for iOS support to port several of my OS X apps to iPad. And I rather wait for Xojo to support iOS than to have to rewrite them entirely in another language. Even if the platforms are not directly compatible, I have full confidence that like between web and desktop, good portions of the logic will be simply copy/pasted.

I agree, most of my apps use either MYSQL, SQL Server and CubeSQL and it would be nice if I didn’t have to write those in another language for IOS support

I thought that this was still up in the air for version 1.

Regardless, we will know for sure when it gets released to the alpha and beta testers.

Ken, it’s not a secret. And maybe I can sum it up later in a blog article.

That would be great, thanks Christian

Ken - It’s a fairly simple in concept
Your app talks to a middle layer which then accesses the DB on your apps behalf - your DB is never wide open on the internet and should never be at any rate.

You write a “business” or “logic” layer the app can talk to securely which then can access the DB

And you can update this middle layer without affecting the app on whatever platform as long as you don’t change the basic protocol & API

Thanks Norman, I’m really wanting to do this instead of hitting the DB directly (for obvious reasons). Do you know if anything that’s already been done so I can see an example of how’s it done…?

In Xojo thats publicly available ?
Off the top of my head none that are publicly accessible.
But I do know of Xojo applications that use this configuration but their code is not open for inspection.

Some have used PHP or other languages for the back end but the trick is not so much the language as it is segregating the db access code completely from the rest of the UI code.
So instead of your UI code doing a select directly it sends a request with suitable parameters to this “server” and IT does the request & returns the results
You can do this in a stand alone desktop app and collect all the logic for db access into one module so the rest of the UI never directly accesses the DB or issues selects etc
Now you move that code to some other machine & have to make them talk

Norman, that makes sense…Would a console app or web app be good for this??

This is exactly the approach I’ve taken with my upcoming web application.

I have a web app which simply sits there and accepts database requests via SpecialURLHandler.

The web app accepts a database request and makes the database stored procedure call. The Web App then packages up the results (or errors!) and sends the response back. Also, added in an authentication system so only my applications can use this service.

In effect, I have a database API Web Service(!) Works well.

Should also add that the database will be locked down so the outside world can’t get at it.

Patrick, are you willing to share?

Sorry Ken, No - far too much code/time/money in this to share. I was really trying to emphasise Norman’s point about how this can be done.

Having said that, I have been wondering if this is something I could offer up as some kind of service. As in possible database hosting, coupled with API creation/hosting based on the work I’ve put into my API - not sure how it would work though!