[Pas2js] SQLDB REST bridge client
    Michael Van Canneyt 
    michael at freepascal.org
       
    Thu Mar  7 10:11:19 CET 2019
    
    
  
Hi,
Recently I added an SQLDB REST Bridge to FPC, to be able to serve database data
easily to a web browser program.
I now coded the client-side of things for pas2js. Basically 2 components:
- TSQLDBRestDataset
- TSQLDBRestConnection
Which can be used simply as follows:
   FConn:=TSQLDBRestConnection.Create(Self);
   FConn.BaseURL:='http://localhost:8080/';
   FConn.Password:='me';
   FConn.UserName:='secret';
   FData:=TSQLDBRestDataset.Create(Self);
   FData.Connection:=FConn;
   FData.ResourceName:='projects';
   FData.Load([]);
It's still rough and I still need to test writing, but the demo (pas2js/demos/restbridge/simple)
already shows how to use it.
Screenshot showing the demo in action in 2 browsers, firefox and Chrome:
https://www.freepascal.org/~michael/restbridgeclient.png
Some fixes for CORS handling were necessary in the server (browsers do not
seem to agree on how to handle CORS and HTTP authorization) so you may need
to update SVN for FPC as well.
If all goes well, it will be demoed during the Dutch pascon/lazarus meetup
coming saturday.
Michael.
    
    
More information about the Pas2js
mailing list