Adding new driver to debea

It commonly tooks 2-3 days to write driver for dba, because interface is very simple.

In order to modify build system you have to install tools for creating project files. You can find requirements and description of those tools in Build system section.

To implement new driver you have to implement dba:;Database interface, which contains following classes:

Then you should modify build system to recognize nedded libraries and add compiler and linker flag.

For MSW you should create enviroment variable that points to headers and libraries that are needed for driver compilation and add new template to syslibs.bkl like this:

<template id="postgres">
  <if cond="FORMAT!='autoconf'">
    <if cond="TOOLSET=='win32'">
      <lib-path>"$(DOLLAR)($(ENV_VAR)POSTGRESQL)$(DIRSEP)lib$(DIRSEP)ms"</lib-path>
      <include>"$(DOLLAR)($(ENV_VAR)POSTGRESQL)$(DIRSEP)include"</include>
    </if>
    <sys-lib>libpq</sys-lib>
    <sys-lib>wsock32</sys-lib>
  </if>
  <if cond="FORMAT=='autoconf'">
    <sys-lib>pq</sys-lib>
  </if>
</template>

Then you have to modify dba.bkl and add option for driver compilation and "module" section. This will enable MSW project files generation for driver using bakefile.

For Unix there is more work to do. In addition to changes above you have to modify configure.in to detect needed libraries and add options for new driver.

Last important step is to run standard CppUnit regression tests for driver to make sure that things works correctly. Things you nedd to do is to modify "testbase" template in dba.bkl by adding new preprocessor symbol that will enable test case compilations and then add test cases to test/main.cpp file.

After all changes you should regnerate project files and recompile library and programs.


Documentation
Quick start
Examples
Search

API Documentation
Class hierarchy
Member index
API Reference
Store filters
Store table macros
Back

Generated by doxygen at Sun Nov 9 02:08:16 2008