You are not logged in.
Hi,
I am working on a client server application. I have a REST Model which has more than one TSQL Record class for accessing many tables. For now, I can share one data model between client and server.
Problem:
Now I need to access more than one table between client and server at the same time. I don't know how to access many shared data models at a time.
Question:
How do I access multiple tables in the Client Server Application? Any examples available?
Thanks in advance.
Offline
???
What do you mean "I need to access more than one table between client and server at the same time"?
Are you talking about JOIN?
See http://synopse.info/files/html/Synopse% … l#TITLE_83
See also this link - http://synopse.info/forum/viewtopic.php … 488#p13488
My answer introduces the "data sharding" concept.
Online
I mean, at the runtime if I need to fetch data from a different table for different purpose.
I didn't mean JOIN, anyhow I need to use JOIN function for later purposes. Thanks for your references, I will also look into those links.
Example Server side source code:
aModel := fetchModel; // TSQL Record Class for fetching data from 'Row1' table.
VirtualTableExternalRegister(aModel, TRow, aProps, 'Row1');
aModel.Props[TRow].ExternalDB.MapField('ID','IDNo');
try
aRestServer := TSQLRestServerDB.Create(aModel,':memory:',false);
In the above code, I am using a 'fetchModel' TSQLRecord Class for fetching data from a 'Row1' table. If I need to use another TSQLRecord Class like 'createModel' from a 'Package1' table for different purpose, what I need to do?
Kindly let me know, if I am not clear with my question.
Thanks in advance.
Last edited by aruncs08 (2014-11-10 11:56:06)
Offline
By design, there is one model per rest instance.
But you can redirect one table to another rest/model.
See http://synopse.info/files/html/Synopse% … ml#TITL_93
Online
Thanks ab. I will look into it.
Offline