[Lazarus] SQLDBRestBridge
duilio foschi
octopushole at gmail.com
Sun Nov 6 20:59:32 CET 2022
Hi Michael,
I am digging into your SQLDBRestBridge component. Very useful code.
I could fix and run both the server part and the client part (I used
the BufDataset client).
My code (with very few changes applied to the original one) can be
downloaded from this link:
https://mega.nz/file/Gxx3FBya#LbvDvuFnH5rUDVAdPoGyuUCnkNE761A62SZ1MYX8oFQ
I hope it be helpful for somebody.
I have 2 questions:
1. the client needs to know the name of the primary key (PK) of each
table. Is there a way to ask the server for the name of the PK of
table A? Or to have the PK listed in the metadata?
2. the client needs to periodically refresh the visible rows in the
event that another client applied changes to the DB. How is this done?
I reckon that the client will remember the last command
like
BASEURL/resourcename?limit=10&Offset=50
and reissue it. Right?
Thank you
Peppe
On Fri, Nov 4, 2022 at 9:05 AM Michael Van Canneyt
<michael at freepascal.org> wrote:
>
>
>
> On Thu, 3 Nov 2022, duilio foschi wrote:
>
> >> Please look at the intercept example
> >
> > could you please expand on this?
>
> In the http request router, you can register global handlers which are executed
> for every request. You can choose if the handler is executed before or after
> the normal handler for the request.
>
>
> >
> > Where do I find the intercept example?
>
> https://gitlab.com/freepascal.org/fpc/source/-/blob/main/packages/fcl-web/examples/intercept/simpleserver.pas
>
> This example shows both kind of handlers, before and after request. The
> before request handler just logs the URL, just what you need.
>
> Michael.
More information about the lazarus
mailing list