APQ¶
Introduction¶
APQ is a generic package for handling database connections that currently support MySQL (APQ :: MySQL), PostgreSQL (APQ :: PostgreSQL), Sybase and Microsoft SQL Server (both through APQ :: ct_lib) . ODBC support (APQ :: ODBC) is still in it's early alpha stages (but now is compilling fine against unixODBC).
Documentation¶
You can get the manual from the main APQ distribution package.
Installing¶
The following installation instructions are for version 3.1 running Debian linux flavours (ubuntu linux). They are known not to work on FreeBSD and Gentoo linux distributions.
Version 3.2 introduces a new build system which work on a wider variety of systems, including FreeBSD, MacOS X and several Linux distributions.
From sources tarball¶
the most valuable info is already in INSTALL file and in inline comments in files.
Here is a simple recipe on how to build APQ:
the example below will use a linux target :-)
for construct the libs ,most time, is just three commands :-) make configure oses=linux lib_build_types=static,dynamic build_with_debug_too=yes make compile oses=linux make install oses=linux prefix=/usr/local
this will configure, compile and install 4 nature of lib
lib version: static with debug in
lib version: static without debug
lib version: shared with debug
lib version: shared without debug
The system "in si" possesses the germen of multi-arch/multi-lib and cross-compiling :-)
For the guys using gnat-gps will pleasent notice , when importing the project file installed in install
part, appear 3 enviroment variables. combining this environment variables made possible change of
source, ali , libs etc on the fly :-)
the correct locations for all installed files is in INSTALL file.
Then you'll need to add $prefix/lib/gnat (e.g.: /usr/local/lib/gnat ) to your ADA_PROJECT_PATH to build your database drivers.
I will made example use of new features, mainly how setup a mysql and
postgresql with ssl connection and how uses libapq-postgresl-3.1.0+ and
libapq-mysql-3.1.0+¶
the main tasks for this covers:
#(if you dont have a 'oficial' keys and certs from a real CertificaAutority)
create the CA, Server and clients keys and certificates.
Is Mandatory that Common_Name in keys and cerificates are hostname for
server and user name when setting client keys and certificates.
#setting the rdbms to use ssl. we will show howto this is a Debian Sid
#setting user permissions for use with ssl
#and finally example working code using libapq.
as a bonus, I will demonstrate how 'compress' the connection with rdbms Mysql
I will first enumerate some pages with info about ssl and 'options' system
http://dev.mysql.com/doc/refman/5.1/en/mysql-options.html
http://dev.mysql.com/doc/refman/5.1/en/secure-connections.html
http://www.postgresql.org/docs/9.0/static/libpq-connect.html or more uptodate
link
*in writting process :-) *
Gentoo Linux¶
The gentoo linux overlay is outdated. Please use the manual method described in this page.