[Lazarus] demorestbridge
duilio foschi
octopushole at gmail.com
Sun Oct 23 19:49:47 CEST 2022
I am trying to use the demo that I find in directory
C:\lazarus\fpc\3.2.2\source\packages\fcl-web\examples\restbridge
Following the instructions in file readme.txt,
1. I created a firebird database (test.fdb)
2. I run expenses-fb.sql to create the db structure
3. I run expenses-data.sql to insert some data in the tables
Now I read:
<<
You must edit the program to provide the correct database credentials:
look for the ExposeDatabase() call, and edit the username/password.
You must also change the name and location of the database
>>
so I changed the original line
FDisp.ExposeDatabase(TPQConnectionDef.TypeName,'localhost','expensetracker','You','YourSecret',Nil,[foFilter,foInInsert,foInUpdate,foOrderByDesc]);
into
FDisp.ExposeDatabase(TPQConnectionDef.TypeName,'localhost','c:\....\test.fdb','sysadm','masterkey',Nil,[foFilter,foInInsert,foInUpdate,foOrderByDesc]);
(where the database path is of course
C:\lazarus\fpc\3.2.2\source\packages\fcl-web\examples\restbridge\test.fdb
)
However when I compile and run the demo, I get the following error message:
"Can not load PostgreSQL client library "libpq.dll". Check your installation"
I noticed that a library of name libpq.dll is inside the demo
directory. This library was 32 bits, but I compile the demo at 64bits.
I downloaded the 64bit library but still no joy (same error).
A solution is suggested here
https://forum.lazarus.freepascal.org/index.php?topic=43476.0
with several DLLs copied into the working directory but...
who wants Postgres? I only work with Firebird. How do I change the
code so that only Firebird databases are handled (and no Postgres DLL
is needed)?
Also: how does the bridge know about the database type one wants to use?
I could find no explanation re this question in pages
https://wiki.freepascal.org/SQLDBRestBridge
Any help?
Thank you
Peppe
More information about the lazarus
mailing list