Thralling Penguin DbAbstract Library

DbAbstract brings a database abstraction layer to the Adaptive Communications Environment (ACE) and C++. DbAbstract works by using a single set of classes to access an abstract database implementation and having multiple shared libraries that implement actual client database API's. This allows the developer to write their code to a single set of C++ classes, but allow for multiple underlying databases with a simple switch of the underlying shared library client database implementation. This project aims to give abstraction at the smallest cost of overhead possible and ease of use. DbAbstract additionally supports methods for preventing SQL Injection/string escaping and date/time manipulation/conversion.

The library is licensed under the LGPL. It currently supports MySQL and Sqlite3 databases, but is easy to extend for additional client database implementations.

Requirements

  • Adaptive Communications Environment (with pkg-config support)
  • MySQL client library (if MySQL driver is desired)
  • Sqlite3 client library (if Sqlite3 driver is desired)
  • Doxygen (if documentation is desired)

Links

Example Build Instructions for Solaris 10

In the example below, I have my ACE build environment located in /Desktop/projects/ACE_wrappers. I have also installed the CSW packages for Sqlite3, MySQL 5, and Doxygen. Additionally, I will use the Sun Studio 11 compiler, instead of GCC.

PKG_CONFIG_PATH=/Desktop/projects/ACE_wrappers/build/ace \
CXX=/opt/SUNWspro/bin/CC CC=/opt/SUNWspro/bin/cc \
DOXYGEN=/opt/csw/bin/doxygen ./configure --prefix=/opt/dbabstract \
--enable-mysql=/opt/csw/mysql5 --enable-sqlite3=/opt/csw --enable-doc
gmake
gmake install

Example Build Instructions for CentOS 4

In the example below, I have my ACE build environment located in /usr/src/ACE_wrappers. Also, ensure that the sqlite-devel, mysql-devel, and doxygen RPM packages are installed, depending on your needs.

PKG_CONFIG_PATH=/usr/src/ACE_wrappers/build/ace \
./configure --prefix=/opt/dbabstract --enable-mysql=/usr \
--enable-sqlite3=/usr --enable-doc
make
make install

Contact

If you have any patches, additions, comments, or suggestions - I'd like to know.