Giter VIP home page Giter VIP logo

nanodbc's Introduction

Synopsis

A very small C++ wrapper for the native C ODBC API. Please see the online documentation for user information, example usage, propaganda, and detailed source level documentation.

Building

You don't necessarily need to build nanodbc, as you can just drop the header and implementation files into your project. However I have provided CMake files which can be used to build a shared library object, or build and run the included unit tests. The CMake files will also support out of source builds.

Unit tests are built using Boost.Test and therefore require Boost be installed. In order to build the tests you will also need to have either unixODBC or iODBC installed and discoverable by CMake. This is easy on OS X (for example) where you can just use Homebrew to install unixODBC with brew install unixodbc, or simply use the system provided iODBC if you have OS X prior to 10.9. Also note that you can install Boost via Homebrew as well, which is very convenient!

Finally, the unit tests attempt to connect to a SQLite database, so you will have to have that and a SQLite ODBC driver installed. At the time of this writing, there happens to be a nice SQLite ODBC driver available from Christian Werner's website. The tests expect to find a data source named sqlite. So for example, your odbcinst.ini file on OS X might have a section similar to the following.

[sqlite]
Description             = SQLite ODBC Driver
Driver                  = /usr/lib/libsqlite3odbc-0.93.dylib
Setup                   = /usr/lib/libsqlite3odbc-0.93.dylib
Threading               = 2

Example Build Process

It's most convenient to create a build directory for an out of source build, but this isn't required. After you've used cmake to generate your Makefiles, you probably only really need to be aware of make nanodbc which will build your shared object, or make check which will build and run the unit tests. If the unit tests fail, please don't hesitate to report it by creating an issue including a log of the output you're getting! You may also want to install nanodbc to your system using make install.

cd path/to/nanodbc/repository
mkdir build
cd build
cmake .. [-DNANODBC_USE_CPP11=ON] [-DNANODBC_USE_UNICODE=ON]
make # creates shared library
make nanodbc # creates shared library
make example # builds example program
make tests # only builds the unit tests
make test # only runs the unit tests
make check # builds and then runs unit tests
make install # installs nanodbc.h and shared library

nanodbc's People

Contributors

lexicalunit avatar wimobiwan avatar ctrychta avatar mcg1969 avatar lionelperrin avatar tolonuk avatar manwithahammer avatar

Watchers

Weslyn Whitehead avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.