Greetings,
I find that PostgreSQL appears to be natively supported with Lazarus, here:
https://wiki.freepascal.org/postgresThat is absolutely fantastic!
Background first: I have learned a number of SQL RDBMS's so far. First was IBM DB2. Then added MySQL around 1999 when web database applications were taking off. In 2011, I added MS SQL Server by specific request of a client. Then I have added Oracle, for another client's transition from DB2 to Oracle.
My first favorite was DB2. I much prefer that for ETL operations. Its proprietary export / import format, for me, worked flawlessly. (Compared with SQL Server, the same operations one had to use CSV, and there was a fight with Microsoft tools that some tools put quotes around the values in CSV and other Microsoft tools do not. What a non-standard mess!)
My favorite SQL RDBMS for developing SQL Stored Procedures was SQL Server 2008 with its SSMS tool.
Questions about that support:1) With Lazarus + PostgreSQL, is it solidly supported to develop prepared SQL? That is where placeholders are put into the SQL code to indicate where host variables will appear, then separately provide all the variables, then the SQL engine executes the request. This is a good way to harden again SQL Injection Attacks.
My favorite so far has been front-end coding in MS Access VBA with ADO.Command and ADO.Parameter objects.
Essentially what I am asking is does Lazarus + PostgreSQL support something similar to VBA ADO.Command and ADO.Parameter objects.
2) Does Lazarus + PostgreSQL support SQL Stored Procedures? That is, publishing to PostgreSQL the SQL, then having the Lazarus simply call the Stored Procedure by name, supplying the needed Parameters.
I never got my mind around how DB2 supported Stored Procedures.... seemed like (back on DB2 version 2) that the Stored Procedures needed to be written in a compiled language such as C, and then that C code would interact with the DB2 database engine. I greatly enjoyed developing SQL Stored Procedures in SQL Server 2008 vis SSMS. THAT made perfect sense to me. SQL is to talk to the back-end, front-end is what ever tool is being used (Lazarus), but then to require a THIRD language since you dare to say "Stored Procedure"? That just seemed non-intuitive back on DB2. I do not want to need a third language.
3) About the warning on the above mentioned page about PostgreSQL in Lazarus:
"Note: The libpq C client contains some memory leaks (at least up till version 9.3 of Postgres) when a library is repeatedly loaded/unloaded. SQLDB loads the library when the first connection is made, and unloads it when the last connection closes."Does that mean that if a program loads the PostgreSQL driver as mandatory at start of the Lazarus program and leaves it loaded the entire time it is running, only cleans up the connection at the very end then problems would be avoided?
My use of MS SQL Server, now that I think of it, was in fact to build a brand new ADO.Connection object for each individual SQL call the front-end needed to make to the back-end. That design was robust through the front-end being put into sleep mode, woken back up, and the expectation being that continued use should work flawlessly. At first, I thought to obtain the ADO.Connection object and keep it alive within a VBA class. That worked perfectly while on Windows XP and Office 2007. But when client machines were upgraded to Windows 7 and Office 2010, THEN suddenly that combination seemed to power save / sleep even deeper, and the ADO.Connection object would not survive. So then I had to update my VBA class to create and destroy the ADO.Connection object each time a request was made to receive the ADO.Connection object, not return the same ADO.Connection object that has existed since the application came up. So sounds like I will encounter this libpq C client memory leaks issue, correct?
I am thankful,