#1 2017-02-06 23:38:36

ericgarcia
Member
Registered: 2015-06-11
Posts: 9

Create a Restmodel from an existing Oracle database Schema

Hello,

I 'm newbie in the mormot world, and I successfully tried some samples, that I modified to work with Oracle in native OCI mode.
everything works well and I m impressed by the response time!!!!
my questions are the following:

1/ How to retrieve a global existing database and create the corresponding RestModel.  I tried SynDBExplorer and manually select some tables then it asks me to manage the joined file.
After I  generates thru the "To Object" button the Type model. seems to be work,  but I don't see see how it manages the joined information requested previously .
Maybe it s not the right way to generate a whole database to use SynDBExplorer ?


2/ I 'd like to publish this RestModel, as  a  webservice CRUD  to get or post Data in Json format. This is for external tool such as mobile application , or html5 + JS app wants to collect
and update datas . what is the best way or which sample can I use to derive from.

3/ In each Tsqlrecord, can i add some validation rules. So what is the best way , do we have some classes provided with the framework?


Thank for all  your  recommendation

eric fg

Offline

#2 2017-02-07 13:03:44

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

Re: Create a Restmodel from an existing Oracle database Schema

1/ There is no way to let joined information be part of the TSQLRecord generated by SynDBExplorer.

2/3/ You may start from sample 28.
But you may consider using a method-based service or an interface-based service instead, to have some custom SQL statements, and validation rules.
Note that TSynValidate classes registered the model are not run explicitly on the server side. So you can run them on a method-based service.

Offline

Board footer

Powered by FluxBB