Hello,
here is an example using
SQLDBRestBridgeIn attachment a zip file with two projects and a sqlite3 database
to compile the projects you must install
lazsqldbrest and
weblaz packages. To use the sqlite3 database you must have the sqlite client library installed.
The first project
restreadonly launch a rest api server on port 3000. This server is connected to the sqlite3 database . The connection to the database is here in the code :
begin
// Or set in code.
// C.ConnectionType:=TPQConnectionDef.TypeName;
// C.DatabaseName:='fpctest';
// C.HostName:='localhost';
// C.UserName:='user';
// C.Password:='secret';
C.ConnectionType:=TSQLite3ConnectionDef.TypeName;
C.DatabaseName:='selzig.db3';
// C.HostName:='localhost';
// C.UserName:='user';
// C.Password:='secret';
end;
The second project
jsonclient is used to connect to the rest Api server and get data in json format.
the two projects come from fpcsource and lazarus.
Friendly, J.P