Skip to content

Reasonable ODBC wrapper for C++

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

adamreichold/rodbc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Reasonable ODBC wrapper for C++

This library provides a thin wrapper around the ODBC API isolating applications from the C headers and trying to improve ease of use for C++ programs. It aims to provide reasonable facilities without undue overhead. Since calls through the driver manager can be expensive, it also emphasizes bindings that stay valid for the whole lifetime of a statement and bulk operations that bind batches of parameters and rows.

It requires C++11 compiler, e.g GCC 4.8 or later, support and depends on Boost version 1.58 or later, more specifically Fusion, Algorithm, DateTime, Format, Threads and Test. The build system is based on CMake including CTest and CPack.

The test suite uses a scratch database, an in-memory SQLite database by default, which can be configured using the CMake variable RODBC_TEST_CONN_STR. It has been successfully executed on Linux/amd64 using unixODBC 2.3 with SQLite 3.19, PostgreSQL 9.6 and MariaDB 10.1.

The API has three layers:

  • The Environment, Connection, Transaction and Statement classes are the lowest layer providing direct access to binding statements to arbitrary objects.
  • The TypedStatement, StagedStatement and Table classes use Boost.Fusion to automatically handle the binding of adapted structures including sets of parameters and rows.
  • The ConnectionPool classes use Boost.Thread to provide thread-local or shared connections with associated state and automatic detection of lost connections.

For usage examples and further discussions, please refer to the unit tests and the inline documentation.

About

Reasonable ODBC wrapper for C++

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks