Skip to content

Commit

Permalink
Squashed 'src/soci/' content from commit 6e9312c
Browse files Browse the repository at this point in the history
git-subtree-dir: src/soci
git-subtree-split: 6e9312c4bb3748907bd28d62c40feca42878cfef
  • Loading branch information
vinniefalco committed Mar 19, 2015
0 parents commit 9708a12
Show file tree
Hide file tree
Showing 341 changed files with 54,122 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# General
*.swp
tags
tmp

# Build directories
_build*
src/_build*
src/build

# Visual Studio
*.opensdf
*.sdf
*.suo

# KDevelop
*.kate-swp
*.kdev4

# Qt Creator
*.config
*.creator*
*.files
*.includes
40 changes: 40 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# .travis.yml
# Configure Travis CI service to build SOCI library, http://github.com/SOCI
#
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
language: cpp

compiler:
- g++
#- clang

services:
- mysql
- postgresql

env:
matrix:
- SOCI_TRAVIS_BACKEND=db2
- SOCI_TRAVIS_BACKEND=empty
- SOCI_TRAVIS_BACKEND=firebird
- SOCI_TRAVIS_BACKEND=mysql
- SOCI_TRAVIS_BACKEND=odbc
- SOCI_TRAVIS_BACKEND=oracle
- SOCI_TRAVIS_BACKEND=postgresql
- SOCI_TRAVIS_BACKEND=sqlite3

before_install: ./bin/ci/before_install.sh
before_script: ./bin/ci/before_script.sh
script: ./bin/ci/script.sh

notifications:
email:
recipients:
- soci-devel@lists.sourceforge.net
on_success: change # [always|never|change] # default: change
on_failure: always # [always|never|change] # default: always

irc:
channels:
- "irc.freenode.org#soci"
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
SOCI - The C++ Database Access Library
======================================

Website: http://soci.sourceforge.net

GitHub hosts SOCI source code repository, issues tracker and wiki:
https://github.com/SOCI

Downloads and mailing lists at
http://sourceforge.net/projects/soci/

Travis CI service at https://travis-ci.org/SOCI/soci

[![Build Status](https://api.travis-ci.org/SOCI/soci.png)](https://travis-ci.org/SOCI/soci)

License
-------

The SOCI library is distributed under the terms of the [Boost Software License](http://www.boost.org/LICENSE_1_0.txt).

Requirements
------------

Core:
* C++ compiler
* Boost C++ Libraries (optional, headers only)

Backend specific client libraries for:
* DB2
* Firebird
* MySQL
* ODBC andwith specific database driver
* Oracle
* PostgreSQL
* SQLite 3

See documentation at http://soci.sourceforge.net for details

Brief History
-------------
Originally, SOCI was developed by [Maciej Sobczak](http://www.msobczak.com/)
at [CERN](http://www.cern.ch/) as abstraction layer for Oracle,
a **Simple Oracle Call Interface**.
Later, several database backends have been developed for SOCI,
thus the long name has lost its practicality.
Currently, if you like, SOCI may stand for **Simple Open (Database) Call Interface**
or something similar.

> "CERN is also a user of the SOCI library, which serves as a database access
> layer in some of the control system components."
-- Maciej Sobczak at [Inspirel](http://www.inspirel.com/users.html)
13 changes: 13 additions & 0 deletions bin/ci/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash -e
# Run before_install actions for SOCI build at travis-ci.org
#
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 16126D3A3E5C1192
sudo apt-get update -qq
sudo apt-get install -qq libboost-dev libboost-date-time-dev

before_install="${TRAVIS_BUILD_DIR}/bin/ci/before_install_${SOCI_TRAVIS_BACKEND}.sh"
[ -x ${before_install} ] && ${before_install} || echo "nothing to run"
39 changes: 39 additions & 0 deletions bin/ci/before_install_db2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash -e
# Installs DB2 for SOCI build at travis-ci.org
#
# Copyright (c) 2013 Brian R. Toonen <toonen@alcf.anl.gov>
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

sudo bash -c 'echo "deb http://archive.canonical.com/ubuntu precise partner" >> /etc/apt/sources.list'
sudo apt-get update -qq
sudo apt-get install -y db2exc

echo "Running db2profile and db2rmln"
sudo /bin/sh -c '. ~db2inst1/sqllib/db2profile ; $DB2DIR/cfg/db2rmln'

echo "Setting up db2 users"
echo -e "db2inst1\ndb2inst1" | sudo passwd db2inst1
echo -e "db2fenc1\ndb2fenc1" | sudo passwd db2fenc1
echo -e "dasusr1\ndasusr1" | sudo passwd dasusr1

echo "Configuring DB2 ODBC driver"
if test `getconf LONG_BIT` = "64" ; then
if test -f /home/db2inst1/sqllib/lib64/libdb2o.so ; then
DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib64/libdb2o.so
else
echo "ERROR: can't find the 64-bit DB2 ODBC library"
exit 1
fi
else
if test -f /home/db2inst1/sqllib/lib32/libdb2.so ; then
DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib32/libdb2.so
elif test -f /home/db2inst1/sqllib/lib/libdb2.so ; then
DB2_ODBC_DRIVER=/home/db2inst1/sqllib/lib/libdb2.so
else
echo "ERROR: can't find the 32-bit DB2 ODBC library"
exit 1
fi
fi
echo "DB2 ODBC driver set to $DB2_ODBC_DRIVER"
16 changes: 16 additions & 0 deletions bin/ci/before_install_firebird.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash -e
# Install Firebird server for SOCI at travis-ci.org
#
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

sudo apt-get install -qq firebird2.5-super firebird2.5-dev

# Configure Firebird server
# See: Non-interactive setup for travis-ci.org
# http://tech.groups.yahoo.com/group/firebird-support/message/120883
#sudo dpkg-reconfigure -f noninteractive firebird2.5-super
sudo sed /ENABLE_FIREBIRD_SERVER=/s/no/yes/ -i /etc/default/firebird2.5
cat /etc/default/firebird2.5 | grep ENABLE_FIREBIRD_SERVER
sudo service firebird2.5-super start
13 changes: 13 additions & 0 deletions bin/ci/before_install_odbc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash -e
# Install ODBC libraries for SOCI at travis-ci.org
#
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

sudo apt-get install -qq \
tar bzip2 \
unixodbc-dev \
libmyodbc odbc-postgresql

sudo odbcinst -i -d -f /usr/share/libmyodbc/odbcinst.ini
15 changes: 15 additions & 0 deletions bin/ci/before_install_oracle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash -e
# Install Oracle client libraries for SOCI at travis-ci.org
#
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

sudo apt-get install -qq tar bzip2 libaio1

wget http://brzuchol.loskot.net/software/oracle/instantclient_11_2-linux-x64-mloskot.tar.bz2
tar -jxf instantclient_11_2-linux-x64-mloskot.tar.bz2
sudo mkdir -p /opt
sudo mv instantclient_11_2 /opt
sudo ln -s ${ORACLE_HOME}/libclntsh.so.11.1 ${ORACLE_HOME}/libclntsh.so
sudo ln -s ${ORACLE_HOME}/libocci.so.11.1 ${ORACLE_HOME}/libocci.so
9 changes: 9 additions & 0 deletions bin/ci/before_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e
# Run before_script actions for SOCI build at travis-ci.org
#
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

before_script="${TRAVIS_BUILD_DIR}/bin/ci/before_script_${SOCI_TRAVIS_BACKEND}.sh"
[ -x ${before_script} ] && ${before_script} || echo "nothing to run"
10 changes: 10 additions & 0 deletions bin/ci/before_script_db2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -e
# Sets up environment for SOCI backend DB2 at travis-ci.org
#
# Copyright (c) 2013 Brian R. Toonen <toonen@alcf.anl.gov>
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

sudo -u db2inst1 -i db2 "CREATE DATABASE SOCITEST"
sudo -u db2inst1 -i db2 "ACTIVATE DATABASE SOCITEST"
11 changes: 11 additions & 0 deletions bin/ci/before_script_firebird.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -e
# Configure Firebird database for SOCI build at travis-ci.org
#
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

isql-fb -z -q -i /dev/null # --version
echo 'CREATE DATABASE "LOCALHOST:/tmp/soci_test.fdb" PAGE_SIZE = 16384;' > /tmp/create_soci_test.sql
isql-fb -u SYSDBA -p masterkey -i /tmp/create_soci_test.sql -q
cat /tmp/create_soci_test.sql
9 changes: 9 additions & 0 deletions bin/ci/before_script_mysql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e
# Sets up environment for SOCI backend MySQL at travis-ci.org
#
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

mysql --version
mysql -e 'create database soci_test;'
11 changes: 11 additions & 0 deletions bin/ci/before_script_odbc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -e
# Sets up environment for SOCI backend ODBC at travis-ci.org
#
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

mysql --version
mysql -e 'create database soci_test;'
psql --version
psql -c 'create database soci_test;' -U postgres
9 changes: 9 additions & 0 deletions bin/ci/before_script_postgresql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e
# Sets up environment for SOCI backend PostgreSQL at travis-ci.org
#
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

psql --version
psql -c 'create database soci_test;' -U postgres
36 changes: 36 additions & 0 deletions bin/ci/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash -e
# Common definitions used by SOCI build scripts at travis-ci.org
#
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
if [[ "$TRAVIS" != "true" ]] ; then
echo "Running this script makes no sense outside of travis-ci.org"
exit 1
fi
#
# Environment
#
TCI_NUMTHREADS=2
if [[ -f /sys/devices/system/cpu/online ]]; then
# Calculates 1.5 times physical threads
TCI_NUMTHREADS=$(( ( $(cut -f 2 -d '-' /sys/devices/system/cpu/online) + 1 ) * 15 / 10 ))
fi
export ORACLE_HOME=/opt/instantclient_11_2
export LD_LIBRARY_PATH=${ORACLE_HOME}:${LD_LIBRARY_PATH}
#
# Functions
#
tmstamp()
{
echo -n "[$(date '+%H:%M:%S')]" ;
}

run_make()
{
[ $TCI_NUMTHREADS -gt 0 ] && make -j $TCI_NUMTHREADS ] || make
}

run_test()
{
ctest -V --output-on-failure .
}
14 changes: 14 additions & 0 deletions bin/ci/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -e
# Run test script actions for SOCI build at travis-ci.org
#
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

# prepare build directory
builddir="${TRAVIS_BUILD_DIR}/src/_build"
mkdir -p ${builddir}
cd ${builddir}

# build and run tests
${TRAVIS_BUILD_DIR}/bin/ci/script_${SOCI_TRAVIS_BACKEND}.sh
24 changes: 24 additions & 0 deletions bin/ci/script_db2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -e
# Builds and tests SOCI backend DB2 at travis-ci.org
#
# Copyright (c) 2013 Brian R. Toonen <toonen@alcf.anl.gov>
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
source ${TRAVIS_BUILD_DIR}/bin/ci/common.sh

cmake \
-DSOCI_TESTS=ON \
-DSOCI_STATIC=OFF \
-DSOCI_DB2=ON \
-DSOCI_EMPTY=OFF \
-DSOCI_FIREBIRD=OFF \
-DSOCI_MYSQL=OFF \
-DSOCI_ODBC=OFF \
-DSOCI_ORACLE=OFF \
-DSOCI_POSTGRESQL=OFF \
-DSOCI_SQLITE3=OFF \
-DSOCI_DB2_TEST_CONNSTR:STRING="DSN=SOCITEST\;Uid=db2inst1\;Pwd=db2inst1" \
..

run_make
run_test
Loading

0 comments on commit 9708a12

Please sign in to comment.