#1 2014-11-10 09:57:28

aruncs08
Member
Registered: 2014-10-13
Posts: 27

Accessing multiple tables in the Client Server Application!

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

#2 2014-11-10 10:00:37

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

Re: Accessing multiple tables in the Client Server Application!

???
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.

Offline

#3 2014-11-10 11:15:09

aruncs08
Member
Registered: 2014-10-13
Posts: 27

Re: Accessing multiple tables in the Client Server Application!

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

#4 2014-11-10 13:51:12

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

Re: Accessing multiple tables in the Client Server Application!

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

Offline

#5 2014-11-10 14:27:00

aruncs08
Member
Registered: 2014-10-13
Posts: 27

Re: Accessing multiple tables in the Client Server Application!

Thanks ab. I will look into it.

Offline

Board footer

Powered by FluxBB