On Sun, 6 Nov 2022, duilio foschi wrote:
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?
Normally the server has this info, and the primary key is retrieved when exposing a database. It is part of fieldinfo, but not yet exposed in the metadata, I think. I will add it, this is easy to do.
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?
Yes, but you need to program this yourself. Michael. -- _______________________________________________ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus