You are not logged in.
Pages: 1
Hi!
Create a small program (based on 27 - CrossPlatform Clients). Server run on Windows 10 PC, client run Android 6.01, FireMonkey.
Connection is successfully.
Question:
- What kind of server to connect with Crossplatform TSQLRestClientHTTP client?
- Is feasible: Crossplatform TSQLRestClientHTTP client edirect execute a SQL statement, like TSQLDBSQLite3ConnectionProperties.Execute('SELECT * FROM table1')
Thanks, Csaba
Offline
You should not execute a SQL statement from the client side.
The SQL logic should remain on the server.
Do not think 2-Tier, think multi-Tier!
See http://synopse.info/files/html/Synopse% … #TITLE_115
To retrieve all items, you need to use the corresponding ORM methods, like TSQLRecord.FillPrepare().
For more complex queries, define your high-level SOA service, returning the information you need.
Offline
OK, I understand that.
From client side (FireMonkey, Android) can I connect to server via interface for not ORM server?
server side:
Props := TSQLDBSQLite3ConnectionProperties.Create('data.db3','','','');
HttpServer := TSQLDBServerHttpApi.Create(Props,'syndbremote','8092','user','pass');
client side:
client := TSQLRestClientHTTP.Create('????', 8092, TSQLModel.Create([]));
What is the connection string <server address>, or this way is not compatible ?
Csaba
Offline
No, the SynDBRemote feature is not cross-platform yet.
It is not meant to be run from a cross-platform client.
This is on purpose, for the reasons I wrote in my previous reason: it would be a 2-Tier architecture, which is a wrong design for mobile clients.
Define SOA interface-based services for remote access from an Android or iOS client instead.
Never put your SQL on the mobile side!
Offline
OK, this is a wrong way.
What is your recommendation?
Have a legacy project with SQLite database, Dephi standalone client.
My plan: SQLite database (external for first time, ORM later step by step), one backend server with interface-based service.
-Local net the fastest data transfer (many data manipulation, many user), only Delphi
-Mobil client only data read. Delphi or Android java.
Make I two server one for local and one for mobile or one server for both?
Which kind of server? TSQLRestServerDB or TSQLRestServerFullMemory?
Thank, Csaba
Offline
For a pure SOA server, TSQLRestServerFullMemory is enough.
TSQLRestServerDB has the advantage of being able to directly connect to your SQlite3 database, with all the remote RESTful access, and the ORM features for your SOA server.
So I would use TSQLRestServerDB from the beginning.
Switching to ORM as soon as possible, since I do not see any benefit of plain SQL over our ORM, for most use cases.
Offline
Pages: 1