Recent

Author Topic: Interface to PostGreSQL  (Read 6736 times)

Guest

  • Guest
Interface to PostGreSQL
« on: April 06, 2004, 10:47:32 am »
Hi there !

I've compiled Lazarus under SuSE 9.0. I would like to develop some
programs which accesses the PostgreSQL database server. I've noticed
that after compile I have only a TDataset object and nothing like TTable or
TQuery. For Delphi, Kylix exists a package ZeosDBO which after installing
it adds several non-visual components for accessing PostgreSQL. Can I
have something like that in Lazarus ?

Thanks !

headsman

  • Guest
Interface to PostGreSQL
« Reply #1 on: October 02, 2004, 04:11:24 pm »
I had the same questions... but the only answer I got is to try (of cource, you need to have the time for it) and then share with others what you found.

I had the intention to see if Zeos would work with free pascal, but I think it would not (for the PostgreSQL part only).

Any way, if you have time to find and try, or translate the Lunix PostgreSQL interface into FreePascal, tell me! :)

Lightning

  • Sr. Member
  • ****
  • Posts: 422
Interface to PostGreSQL
« Reply #2 on: October 02, 2004, 04:35:01 pm »
Zeos components can access many database servers including PostgreSQL, but the problem is that they don't have the time to adapt the components for FPC/Lazarus. The Lazarus team has "better" things to do so it's up to us (those that use it and need this functionality).
I adapted some of the Zeos units but it seems that FPC can't work with indexed properties :(
Other people are interested in the Zeos project conversion so maybe a team will be formed :lol: but it seems few people that are good programmers have time these days.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

headsman

  • Guest
Interface to PostGreSQL
« Reply #3 on: October 02, 2004, 04:55:09 pm »
Well, until the day few "good programmers have time" (if I have a Linux project requiring Zeos, I'll work on it for sure); I did fond that there is at least a FPC interface to postgreSQL: http://www.freepascal.org/packages/postgres.html so maybe this will be of help for you. I do not have time to look at it, but this is as I tought: a FPC conversion of the c++ headers. This will do the job for a direct access to PostgreSQL, which is much more powerful and faster than any ODBC connections.

But unfortunately, this is only for the version 6.3.1... that would be nice to have a 7.4.5 and 8.0.

Enjoy! (If you will try!)

Lightning

  • Sr. Member
  • ****
  • Posts: 422
Interface to PostGreSQL
« Reply #4 on: October 02, 2004, 09:13:04 pm »
You could use the zeos low level api interface, without installing comps.
It's also crossplatform.
You only have to add
Code: [Select]

{$IFDEF FPC}
  {$MODE OBJFPC}{$H+}  // or {$MODE DELPHI}
{$ENDIF}

FPC also supports macros that are verry useful for calling convention tricks.
I'm not currently using PostgreSQL because i have to run the server on 9x machines.
I might need it in the future, but for now FireBird is smart enough, light and works also on 9x and many other platforms.

I know version 8 is really powerful, but if you stick to SQL and do not need all the API funcs then maybe older interfaces also work.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!