#1 2015-09-23 15:04:05

toko
Member
Registered: 2015-09-23
Posts: 3

TQuery emulation on iOS

Hello,

I am new to the mormot framework. I came from Datasnap with mobile and i am not satisfied with the performance and stability of Datasnap.

I found the mormot framework and was happy with the TSQLDBServerHttpApi and TSQLDBWinHTTPConnection with TQuery emulation.
Unfortunately i cannot compile the client with iOS. Is it possible in general? (I don't need the TDataset only TQuery-Emulation)

Thank you for advice

regards

Tobias

Offline

#2 2015-09-23 15:13:37

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,269
Website

Re: TQuery emulation on iOS

No, this SynDBRemote feature is only available under Windows with Delphi.
(FPC has more targets, including Android, but I guess you are using Delphi)
It has a proprietary binary format, which is very optimized, but rely on some in-memory structures (e.g. UTF-8 strings), not available in the NEXTGEN compiler.
See http://synopse.info/forum/viewtopic.php … 726#p17726

What is supported (and preferred) about a Mobile/iOS client, is to use Interface-based REST services.
IMHO it is (almost) mandatory to get rid of any SQL within a mobile application.
Put your SQL on your server, then ask for ready-to-be-consumed data via HTTP/REST and JSON.
See http://synopse.info/files/html/Synopse% … ml#TITL_86
This platform is supported via

Offline

#3 2015-09-23 16:59:49

toko
Member
Registered: 2015-09-23
Posts: 3

Re: TQuery emulation on iOS

Hello

thank you for the quick answer. Yes i'm using Delphi.

I looked at the sample project 16 (execute SQL via services).

Is something like the Sample Project16Client (only the Query execution) in iOS possible?
is TSQLTableJSON available in iOS?

Because it's a large legacy project it's not possible to do the client totally without SQL (we're trying to put most SQL on the server but all seems not to be possible)

Sorry for asking again but the documentation is so huge.


Thanks

Tobias

Offline

#4 2015-09-24 12:38:34

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,269
Website

Re: TQuery emulation on iOS

In the cross-platform units, you have the TSQLTableJSON class, defined in SynCrossPlatformREST.pas.
It should work on iOS.

You use regular mORMot.pas on the server side.
And SynCrossPlatform*.pas units on the client side.

See http://synopse.info/files/html/Synopse% … ml#TITL_86

Offline

#5 2015-09-24 14:27:30

toko
Member
Registered: 2015-09-23
Posts: 3

Re: TQuery emulation on iOS

Is there a sample or is it possible to explain me some steps:

I want to use the IRemoteSQL from sample project 16 in a mobile client (iOS).

I created a TSQLModel and a TSQLRestClientHTTP (from SynCrossPlatformREST) to the server from project 16 - this is ok an runs.

But how can i use the IRemoteSQL interface from project16interface.pas to run IRemoteSQL.Connect and IRemoteSQL.GetTables in my mobile application (on iOS).
I don't get a start to implement it?

Thanks

Tobias

Offline

#6 2015-09-24 15:30:10

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,269
Website

Re: TQuery emulation on iOS

You have to generate the client wrapper unit for your service.
See http://synopse.info/files/html/Synopse% … #TITLE_446

Offline

Board footer

Powered by FluxBB