[fpc-devel]MySQL component installation

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Mon Jul 26 00:49:29 CEST 2004

On Sun, 25 Jul 2004, Christopher Kirkpatrick wrote:

> > > Can I have some guidance please from the FPC developers?
> > 
> > The problem you point out is an old one. It is the very reason why I don't
> > recommend developing with MySQL in FPC. The API has changed quite often,
> > sometimes even a minor release would break FPC's units. In C, macro magic is
> > used to mask the incompatibilities.
> > 
> > This would not be a problem if the calls were the only things that changed.
> > Then we could solve the issues by dynamically loading the library and using
> > some internal procvars to call the correct versions.
> > 
> > The problem, however, is that the records used to describe connections and
> > result sets also change, and this cannot be solved in a dynamical way. This
> > is not a problem if they are 'opaque', then we define them as untyped
> > pointers. The problem is that you sometimes need to access the fields of
> > these records (e.g. to get the field count), and this IS a problem.
> > 
> > These issues can be solved with conditional compilation, but which version
> > should FPC distribute ? And when will it again be invalidated by some change
> > in the API of MySQL ? This is a maintenance nightmare...
> > 
> > My advice where FPC is concerned is to drop MySQL and use a better/stabler
> > (API-wise) database, such as Firebird or PostGreSQL.
> I agree, to a certain extent, with your comments, but MySQL is still the
> most widely-used open source database; it is cross-platform and I am
> sure there must be lots of database developers who would love to be able
> to use Lazarus/FPC for MySQL applications. So, in order to maintain our
> credibility as a comprehensive cross-platform development tool, I think
> we need to be able to offer MySQL support. 

I agree with this. Mind you, the Constribs, Bugs and testsuite databases
of the FPC website are in MySQL. But only the testsuite database front-end 
is programmed using FPC. The others in PHP.

> The other two databases you mention, though they undoubtedly have
> advantages over MySQL, have not yet achieved the penetration of MySQL.

This is correct.

> Firebird is truly cross-platform, but PostgreSQL still needs to have
> Cygwin installed in order to run on Windows. (It's a bit reminiscent of
> Borland's decision to use Wine to replicate the Delphi IDE in Kylix!
> Though of course, in the reverse direction).

Personally I would favour Firebird. We use it at work as a production
database, installed at all our clients - which are mostly computer 
illiterate, a tribute to the ease of use of Firebird... 
Never had a problem. This is, of course, my personal appreciation.

> So despite its failings, I'm afraid we will need to provide some kind of
> support for MySQL in the forseeable future. I'm willing to have a try at
> producing some fixes, but they may not be elegant or comprehensive! 

Like I said, please do, and if you need help, I'll be glad to assist. I have
some ideas of how to achieve this, even without recompilation necessary, but
it will require some work as it involves shielding the end-user from the
MySQL internals...


More information about the fpc-devel mailing list