From 8ee6974e0a51dff2789f594cbd116b000283650b Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 26 Dec 2010 12:06:26 +0100 Subject: [PATCH 01/19] [Branch src] Created the 'src' branch, corresponding to the 'src' sub-directory of the master repository. --- .gitignore | 21 +- src/AUTHORS => AUTHORS | 0 src/CHANGES => CHANGES | 0 src/CMakeLists.txt => CMakeLists.txt | 0 src/LICENSE_1_0.txt => LICENSE_1_0.txt | 0 README | 7 +- src/TODO => TODO | 0 src/autogen.sh => autogen.sh | 0 {src/backends => backends}/.gitignore | 0 {src/backends => backends}/CMakeLists.txt | 0 .../empty/CMakeLists.txt | 0 .../empty/Makefile.basic | 0 {src/backends => backends}/empty/blob.cpp | 0 {src/backends => backends}/empty/factory.cpp | 0 {src/backends => backends}/empty/row-id.cpp | 0 {src/backends => backends}/empty/session.cpp | 0 {src/backends => backends}/empty/soci-empty.h | 0 .../empty/standard-into-type.cpp | 0 .../empty/standard-use-type.cpp | 0 .../backends => backends}/empty/statement.cpp | 0 .../empty/test/.gitignore | 0 .../empty/test/CMakeLists.txt | 0 .../empty/test/Makefile.basic | 0 .../empty/test/test-empty.cpp | 0 .../empty/vector-into-type.cpp | 0 .../empty/vector-use-type.cpp | 0 .../firebird/Makefile.basic | 0 {src/backends => backends}/firebird/blob.cpp | 0 .../backends => backends}/firebird/common.cpp | 0 {src/backends => backends}/firebird/common.h | 0 .../firebird/error-firebird.cpp | 0 .../firebird/error-firebird.h | 0 .../firebird/factory.cpp | 0 .../backends => backends}/firebird/row-id.cpp | 0 .../firebird/session.cpp | 0 .../firebird/soci-firebird.h | 0 .../firebird/standard-into-type.cpp | 0 .../firebird/standard-use-type.cpp | 0 .../firebird/statement.cpp | 0 .../firebird/test/Makefile.basic | 0 .../firebird/test/test-firebird.cpp | 0 .../firebird/vector-into-type.cpp | 0 .../firebird/vector-use-type.cpp | 0 .../mysql/CMakeLists.txt | 0 .../mysql/Makefile.basic | 0 {src/backends => backends}/mysql/blob.cpp | 0 {src/backends => backends}/mysql/common.cpp | 0 {src/backends => backends}/mysql/common.h | 0 {src/backends => backends}/mysql/factory.cpp | 0 {src/backends => backends}/mysql/row-id.cpp | 0 {src/backends => backends}/mysql/session.cpp | 0 {src/backends => backends}/mysql/soci-mysql.h | 0 .../mysql/standard-into-type.cpp | 0 .../mysql/standard-use-type.cpp | 0 .../backends => backends}/mysql/statement.cpp | 0 .../mysql/test/.gitignore | 0 .../mysql/test/CMakeLists.txt | 0 .../mysql/test/Makefile.basic | 0 .../mysql/test/test-mysql.cpp | 0 .../mysql/vector-into-type.cpp | 0 .../mysql/vector-use-type.cpp | 0 .../backends => backends}/odbc/CMakeLists.txt | 0 .../backends => backends}/odbc/Makefile.basic | 0 {src/backends => backends}/odbc/blob.cpp | 0 {src/backends => backends}/odbc/factory.cpp | 0 {src/backends => backends}/odbc/makefile.msvc | 0 {src/backends => backends}/odbc/row-id.cpp | 0 {src/backends => backends}/odbc/session.cpp | 0 {src/backends => backends}/odbc/soci-odbc.h | 0 .../odbc/standard-into-type.cpp | 0 .../odbc/standard-use-type.cpp | 0 {src/backends => backends}/odbc/statement.cpp | 0 .../odbc/test/CMakeLists.txt | 0 .../odbc/test/Makefile.basic | 0 .../odbc/test/makefile.msvc | 0 .../odbc/test/test-access.dsn | 0 .../odbc/test/test-mssql.dsn | 0 .../odbc/test/test-mysql.dsn | 0 .../odbc/test/test-odbc-access.cpp | 0 .../odbc/test/test-odbc-mssql.cpp | 0 .../odbc/test/test-odbc-mysql.cpp | 0 .../odbc/test/test-odbc-postgresql.cpp | 0 .../odbc/test/test-postgresql.dsn | 0 {src/backends => backends}/odbc/utility.h | 0 .../odbc/vector-into-type.cpp | 0 .../odbc/vector-use-type.cpp | 0 .../oracle/CMakeLists.txt | 0 .../oracle/Makefile.basic | 0 {src/backends => backends}/oracle/blob.cpp | 0 {src/backends => backends}/oracle/error.cpp | 0 {src/backends => backends}/oracle/error.h | 0 {src/backends => backends}/oracle/factory.cpp | 0 {src/backends => backends}/oracle/row-id.cpp | 0 {src/backends => backends}/oracle/session.cpp | 0 .../oracle/soci-oracle.h | 0 .../oracle/standard-into-type.cpp | 0 .../oracle/standard-use-type.cpp | 0 .../oracle/statement.cpp | 0 .../oracle/test/CMakeLists.txt | 0 .../oracle/test/Makefile.basic | 0 .../oracle/test/test-oracle.cpp | 0 .../oracle/vector-into-type.cpp | 0 .../oracle/vector-use-type.cpp | 0 .../postgresql/CMakeLists.txt | 0 .../postgresql/Makefile.basic | 0 .../backends => backends}/postgresql/blob.cpp | 0 .../postgresql/common.cpp | 0 .../backends => backends}/postgresql/common.h | 0 .../postgresql/factory.cpp | 0 .../postgresql/row-id.cpp | 0 .../postgresql/session.cpp | 0 .../postgresql/soci-postgresql.h | 0 .../postgresql/standard-into-type.cpp | 0 .../postgresql/standard-use-type.cpp | 0 .../postgresql/statement.cpp | 0 .../postgresql/test/.gitignore | 0 .../postgresql/test/CMakeLists.txt | 0 .../postgresql/test/Makefile.basic | 0 .../postgresql/test/test-postgresql.cpp | 0 .../postgresql/vector-into-type.cpp | 0 .../postgresql/vector-use-type.cpp | 0 .../sqlite3/CMakeLists.txt | 0 .../sqlite3/Makefile.basic | 0 {src/backends => backends}/sqlite3/blob.cpp | 0 {src/backends => backends}/sqlite3/common.cpp | 0 {src/backends => backends}/sqlite3/common.h | 0 .../backends => backends}/sqlite3/factory.cpp | 0 {src/backends => backends}/sqlite3/row-id.cpp | 0 .../backends => backends}/sqlite3/session.cpp | 0 .../sqlite3/soci-sqlite3.h | 0 .../sqlite3/standard-into-type.cpp | 0 .../sqlite3/standard-use-type.cpp | 0 .../sqlite3/statement.cpp | 0 .../sqlite3/test/.gitignore | 0 .../sqlite3/test/CMakeLists.txt | 0 .../sqlite3/test/Makefile.basic | 0 .../sqlite3/test/test-sqlite3.cpp | 0 .../sqlite3/vector-into-type.cpp | 0 .../sqlite3/vector-use-type.cpp | 0 build/README | 2 - build/unix/build-core.tcl | 37 - build/unix/build-mysql.tcl | 142 --- build/unix/build-oracle.tcl | 120 --- build/unix/build-postgresql.tcl | 148 --- build/unix/build-sqlite3.tcl | 142 --- build/unix/build.tcl | 87 -- build/unix/execute.tcl | 14 - build/unix/find-boost.tcl | 47 - build/unix/install.tcl | 74 -- build/unix/parse-parameters.tcl | 60 -- {src/cmake => cmake}/CMakeLists.txt | 0 {src/cmake => cmake}/SociBackend.cmake | 0 {src/cmake => cmake}/SociConfig.cmake | 0 {src/cmake => cmake}/SociDependencies.cmake | 0 {src/cmake => cmake}/SociSystemInfo.cmake | 0 {src/cmake => cmake}/SociUtilities.cmake | 0 {src/cmake => cmake}/SociVersion.cmake | 0 {src/cmake => cmake}/dependencies/Boost.cmake | 0 {src/cmake => cmake}/dependencies/MySQL.cmake | 0 {src/cmake => cmake}/dependencies/ODBC.cmake | 0 .../cmake => cmake}/dependencies/Oracle.cmake | 0 .../dependencies/PostgreSQL.cmake | 0 .../dependencies/SQLite3.cmake | 0 .../dependencies/Threads.cmake | 0 {src/cmake => cmake}/modules/FindDL.cmake | 0 {src/cmake => cmake}/modules/FindMySQL.cmake | 0 {src/cmake => cmake}/modules/FindODBC.cmake | 0 {src/cmake => cmake}/modules/FindOracle.cmake | 0 .../modules/FindPostgreSQL.cmake | 0 .../cmake => cmake}/modules/FindSQLite3.cmake | 0 .../vs2010-test-cmd-args.vcxproj.user.in | 0 {src/core => core}/.gitignore | 0 {src/core => core}/CMakeLists.txt | 0 {src/core => core}/Makefile.basic | 0 {src/core => core}/backend-loader.cpp | 0 {src/core => core}/backend-loader.h | 0 {src/core => core}/blob-exchange.h | 0 {src/core => core}/blob.cpp | 0 {src/core => core}/blob.h | 0 {src/core => core}/boost-fusion.h | 0 {src/core => core}/boost-gregorian-date.h | 0 {src/core => core}/boost-optional.h | 0 {src/core => core}/boost-tuple.h | 0 {src/core => core}/connection-pool.cpp | 0 {src/core => core}/connection-pool.h | 0 {src/core => core}/error.cpp | 0 {src/core => core}/error.h | 0 {src/core => core}/exchange-traits.h | 0 {src/core => core}/into-type.cpp | 0 {src/core => core}/into-type.h | 0 {src/core => core}/into.h | 0 {src/core => core}/once-temp-type.cpp | 0 {src/core => core}/once-temp-type.h | 0 {src/core => core}/prepare-temp-type.cpp | 0 {src/core => core}/prepare-temp-type.h | 0 {src/core => core}/procedure.cpp | 0 {src/core => core}/procedure.h | 0 .../ref-counted-prepare-info.cpp | 0 {src/core => core}/ref-counted-prepare-info.h | 0 {src/core => core}/ref-counted-statement.cpp | 0 {src/core => core}/ref-counted-statement.h | 0 {src/core => core}/row-exchange.h | 0 {src/core => core}/row.cpp | 0 {src/core => core}/row.h | 0 {src/core => core}/rowid-exchange.h | 0 {src/core => core}/rowid.cpp | 0 {src/core => core}/rowid.h | 0 {src/core => core}/rowset.h | 0 {src/core => core}/session.cpp | 0 {src/core => core}/session.h | 0 {src/core => core}/soci-backend.h | 0 {src/core => core}/soci-config.h | 0 {src/core => core}/soci-platform.h | 0 {src/core => core}/soci-simple.cpp | 0 {src/core => core}/soci-simple.h | 0 {src/core => core}/soci.h | 0 {src/core => core}/statement.cpp | 0 {src/core => core}/statement.h | 0 {src/core => core}/test/common-tests.h | 0 {src/core => core}/transaction.cpp | 0 {src/core => core}/transaction.h | 0 {src/core => core}/type-conversion-traits.h | 0 {src/core => core}/type-conversion.h | 0 {src/core => core}/type-holder.h | 0 {src/core => core}/type-ptr.h | 0 {src/core => core}/unsigned-types.h | 0 {src/core => core}/use-type.cpp | 0 {src/core => core}/use-type.h | 0 {src/core => core}/use.h | 0 {src/core => core}/values-exchange.h | 0 {src/core => core}/values.cpp | 0 {src/core => core}/values.h | 0 doc/backends.html | 474 --------- doc/backends/firebird.html | 240 ----- doc/backends/index.html | 115 --- doc/backends/mysql.html | 231 ----- doc/backends/odbc.html | 271 ------ doc/backends/oracle.html | 260 ----- doc/backends/postgresql.html | 231 ----- doc/backends/sqlite3.html | 205 ---- doc/basics.html | 143 --- doc/beyond.html | 90 -- doc/boost.html | 106 -- doc/errors.html | 101 -- doc/exchange.html | 742 -------------- doc/index.html | 98 -- doc/installation.html | 250 ----- doc/interfaces.html | 102 -- doc/multithreading.html | 64 -- doc/rationale.html | 313 ------ doc/reference.html | 906 ------------------ doc/statements.html | 388 -------- doc/structure.html | 80 -- doc/structure.odg | Bin 29603 -> 0 bytes doc/structure.png | Bin 26919 -> 0 bytes doc/style.css | 118 --- src/ideas.txt => ideas.txt | 0 src/.gitignore | 19 - src/README | 35 - www/articles.html | 42 - www/doc.html | 22 - www/events.html | 78 -- www/index.html | 111 --- www/links.html | 73 -- www/people.html | 74 -- www/style.css | 73 -- 266 files changed, 24 insertions(+), 6932 deletions(-) rename src/AUTHORS => AUTHORS (100%) rename src/CHANGES => CHANGES (100%) rename src/CMakeLists.txt => CMakeLists.txt (100%) rename src/LICENSE_1_0.txt => LICENSE_1_0.txt (100%) rename src/TODO => TODO (100%) rename src/autogen.sh => autogen.sh (100%) rename {src/backends => backends}/.gitignore (100%) rename {src/backends => backends}/CMakeLists.txt (100%) rename {src/backends => backends}/empty/CMakeLists.txt (100%) rename {src/backends => backends}/empty/Makefile.basic (100%) rename {src/backends => backends}/empty/blob.cpp (100%) rename {src/backends => backends}/empty/factory.cpp (100%) rename {src/backends => backends}/empty/row-id.cpp (100%) rename {src/backends => backends}/empty/session.cpp (100%) rename {src/backends => backends}/empty/soci-empty.h (100%) rename {src/backends => backends}/empty/standard-into-type.cpp (100%) rename {src/backends => backends}/empty/standard-use-type.cpp (100%) rename {src/backends => backends}/empty/statement.cpp (100%) rename {src/backends => backends}/empty/test/.gitignore (100%) rename {src/backends => backends}/empty/test/CMakeLists.txt (100%) rename {src/backends => backends}/empty/test/Makefile.basic (100%) rename {src/backends => backends}/empty/test/test-empty.cpp (100%) rename {src/backends => backends}/empty/vector-into-type.cpp (100%) rename {src/backends => backends}/empty/vector-use-type.cpp (100%) rename {src/backends => backends}/firebird/Makefile.basic (100%) rename {src/backends => backends}/firebird/blob.cpp (100%) rename {src/backends => backends}/firebird/common.cpp (100%) rename {src/backends => backends}/firebird/common.h (100%) rename {src/backends => backends}/firebird/error-firebird.cpp (100%) rename {src/backends => backends}/firebird/error-firebird.h (100%) rename {src/backends => backends}/firebird/factory.cpp (100%) rename {src/backends => backends}/firebird/row-id.cpp (100%) rename {src/backends => backends}/firebird/session.cpp (100%) rename {src/backends => backends}/firebird/soci-firebird.h (100%) rename {src/backends => backends}/firebird/standard-into-type.cpp (100%) rename {src/backends => backends}/firebird/standard-use-type.cpp (100%) rename {src/backends => backends}/firebird/statement.cpp (100%) rename {src/backends => backends}/firebird/test/Makefile.basic (100%) rename {src/backends => backends}/firebird/test/test-firebird.cpp (100%) rename {src/backends => backends}/firebird/vector-into-type.cpp (100%) rename {src/backends => backends}/firebird/vector-use-type.cpp (100%) rename {src/backends => backends}/mysql/CMakeLists.txt (100%) rename {src/backends => backends}/mysql/Makefile.basic (100%) rename {src/backends => backends}/mysql/blob.cpp (100%) rename {src/backends => backends}/mysql/common.cpp (100%) rename {src/backends => backends}/mysql/common.h (100%) rename {src/backends => backends}/mysql/factory.cpp (100%) rename {src/backends => backends}/mysql/row-id.cpp (100%) rename {src/backends => backends}/mysql/session.cpp (100%) rename {src/backends => backends}/mysql/soci-mysql.h (100%) rename {src/backends => backends}/mysql/standard-into-type.cpp (100%) rename {src/backends => backends}/mysql/standard-use-type.cpp (100%) rename {src/backends => backends}/mysql/statement.cpp (100%) rename {src/backends => backends}/mysql/test/.gitignore (100%) rename {src/backends => backends}/mysql/test/CMakeLists.txt (100%) rename {src/backends => backends}/mysql/test/Makefile.basic (100%) rename {src/backends => backends}/mysql/test/test-mysql.cpp (100%) rename {src/backends => backends}/mysql/vector-into-type.cpp (100%) rename {src/backends => backends}/mysql/vector-use-type.cpp (100%) rename {src/backends => backends}/odbc/CMakeLists.txt (100%) rename {src/backends => backends}/odbc/Makefile.basic (100%) rename {src/backends => backends}/odbc/blob.cpp (100%) rename {src/backends => backends}/odbc/factory.cpp (100%) rename {src/backends => backends}/odbc/makefile.msvc (100%) rename {src/backends => backends}/odbc/row-id.cpp (100%) rename {src/backends => backends}/odbc/session.cpp (100%) rename {src/backends => backends}/odbc/soci-odbc.h (100%) rename {src/backends => backends}/odbc/standard-into-type.cpp (100%) rename {src/backends => backends}/odbc/standard-use-type.cpp (100%) rename {src/backends => backends}/odbc/statement.cpp (100%) rename {src/backends => backends}/odbc/test/CMakeLists.txt (100%) rename {src/backends => backends}/odbc/test/Makefile.basic (100%) rename {src/backends => backends}/odbc/test/makefile.msvc (100%) rename {src/backends => backends}/odbc/test/test-access.dsn (100%) rename {src/backends => backends}/odbc/test/test-mssql.dsn (100%) rename {src/backends => backends}/odbc/test/test-mysql.dsn (100%) rename {src/backends => backends}/odbc/test/test-odbc-access.cpp (100%) rename {src/backends => backends}/odbc/test/test-odbc-mssql.cpp (100%) rename {src/backends => backends}/odbc/test/test-odbc-mysql.cpp (100%) rename {src/backends => backends}/odbc/test/test-odbc-postgresql.cpp (100%) rename {src/backends => backends}/odbc/test/test-postgresql.dsn (100%) rename {src/backends => backends}/odbc/utility.h (100%) rename {src/backends => backends}/odbc/vector-into-type.cpp (100%) rename {src/backends => backends}/odbc/vector-use-type.cpp (100%) rename {src/backends => backends}/oracle/CMakeLists.txt (100%) rename {src/backends => backends}/oracle/Makefile.basic (100%) rename {src/backends => backends}/oracle/blob.cpp (100%) rename {src/backends => backends}/oracle/error.cpp (100%) rename {src/backends => backends}/oracle/error.h (100%) rename {src/backends => backends}/oracle/factory.cpp (100%) rename {src/backends => backends}/oracle/row-id.cpp (100%) rename {src/backends => backends}/oracle/session.cpp (100%) rename {src/backends => backends}/oracle/soci-oracle.h (100%) rename {src/backends => backends}/oracle/standard-into-type.cpp (100%) rename {src/backends => backends}/oracle/standard-use-type.cpp (100%) rename {src/backends => backends}/oracle/statement.cpp (100%) rename {src/backends => backends}/oracle/test/CMakeLists.txt (100%) rename {src/backends => backends}/oracle/test/Makefile.basic (100%) rename {src/backends => backends}/oracle/test/test-oracle.cpp (100%) rename {src/backends => backends}/oracle/vector-into-type.cpp (100%) rename {src/backends => backends}/oracle/vector-use-type.cpp (100%) rename {src/backends => backends}/postgresql/CMakeLists.txt (100%) rename {src/backends => backends}/postgresql/Makefile.basic (100%) rename {src/backends => backends}/postgresql/blob.cpp (100%) rename {src/backends => backends}/postgresql/common.cpp (100%) rename {src/backends => backends}/postgresql/common.h (100%) rename {src/backends => backends}/postgresql/factory.cpp (100%) rename {src/backends => backends}/postgresql/row-id.cpp (100%) rename {src/backends => backends}/postgresql/session.cpp (100%) rename {src/backends => backends}/postgresql/soci-postgresql.h (100%) rename {src/backends => backends}/postgresql/standard-into-type.cpp (100%) rename {src/backends => backends}/postgresql/standard-use-type.cpp (100%) rename {src/backends => backends}/postgresql/statement.cpp (100%) rename {src/backends => backends}/postgresql/test/.gitignore (100%) rename {src/backends => backends}/postgresql/test/CMakeLists.txt (100%) rename {src/backends => backends}/postgresql/test/Makefile.basic (100%) rename {src/backends => backends}/postgresql/test/test-postgresql.cpp (100%) rename {src/backends => backends}/postgresql/vector-into-type.cpp (100%) rename {src/backends => backends}/postgresql/vector-use-type.cpp (100%) rename {src/backends => backends}/sqlite3/CMakeLists.txt (100%) rename {src/backends => backends}/sqlite3/Makefile.basic (100%) rename {src/backends => backends}/sqlite3/blob.cpp (100%) rename {src/backends => backends}/sqlite3/common.cpp (100%) rename {src/backends => backends}/sqlite3/common.h (100%) rename {src/backends => backends}/sqlite3/factory.cpp (100%) rename {src/backends => backends}/sqlite3/row-id.cpp (100%) rename {src/backends => backends}/sqlite3/session.cpp (100%) rename {src/backends => backends}/sqlite3/soci-sqlite3.h (100%) rename {src/backends => backends}/sqlite3/standard-into-type.cpp (100%) rename {src/backends => backends}/sqlite3/standard-use-type.cpp (100%) rename {src/backends => backends}/sqlite3/statement.cpp (100%) rename {src/backends => backends}/sqlite3/test/.gitignore (100%) rename {src/backends => backends}/sqlite3/test/CMakeLists.txt (100%) rename {src/backends => backends}/sqlite3/test/Makefile.basic (100%) rename {src/backends => backends}/sqlite3/test/test-sqlite3.cpp (100%) rename {src/backends => backends}/sqlite3/vector-into-type.cpp (100%) rename {src/backends => backends}/sqlite3/vector-use-type.cpp (100%) delete mode 100644 build/README delete mode 100644 build/unix/build-core.tcl delete mode 100644 build/unix/build-mysql.tcl delete mode 100644 build/unix/build-oracle.tcl delete mode 100644 build/unix/build-postgresql.tcl delete mode 100644 build/unix/build-sqlite3.tcl delete mode 100755 build/unix/build.tcl delete mode 100644 build/unix/execute.tcl delete mode 100644 build/unix/find-boost.tcl delete mode 100644 build/unix/install.tcl delete mode 100644 build/unix/parse-parameters.tcl rename {src/cmake => cmake}/CMakeLists.txt (100%) rename {src/cmake => cmake}/SociBackend.cmake (100%) rename {src/cmake => cmake}/SociConfig.cmake (100%) rename {src/cmake => cmake}/SociDependencies.cmake (100%) rename {src/cmake => cmake}/SociSystemInfo.cmake (100%) rename {src/cmake => cmake}/SociUtilities.cmake (100%) rename {src/cmake => cmake}/SociVersion.cmake (100%) rename {src/cmake => cmake}/dependencies/Boost.cmake (100%) rename {src/cmake => cmake}/dependencies/MySQL.cmake (100%) rename {src/cmake => cmake}/dependencies/ODBC.cmake (100%) rename {src/cmake => cmake}/dependencies/Oracle.cmake (100%) rename {src/cmake => cmake}/dependencies/PostgreSQL.cmake (100%) rename {src/cmake => cmake}/dependencies/SQLite3.cmake (100%) rename {src/cmake => cmake}/dependencies/Threads.cmake (100%) rename {src/cmake => cmake}/modules/FindDL.cmake (100%) rename {src/cmake => cmake}/modules/FindMySQL.cmake (100%) rename {src/cmake => cmake}/modules/FindODBC.cmake (100%) rename {src/cmake => cmake}/modules/FindOracle.cmake (100%) rename {src/cmake => cmake}/modules/FindPostgreSQL.cmake (100%) rename {src/cmake => cmake}/modules/FindSQLite3.cmake (100%) rename {src/cmake => cmake}/resources/vs2010-test-cmd-args.vcxproj.user.in (100%) rename {src/core => core}/.gitignore (100%) rename {src/core => core}/CMakeLists.txt (100%) rename {src/core => core}/Makefile.basic (100%) rename {src/core => core}/backend-loader.cpp (100%) rename {src/core => core}/backend-loader.h (100%) rename {src/core => core}/blob-exchange.h (100%) rename {src/core => core}/blob.cpp (100%) rename {src/core => core}/blob.h (100%) rename {src/core => core}/boost-fusion.h (100%) rename {src/core => core}/boost-gregorian-date.h (100%) rename {src/core => core}/boost-optional.h (100%) rename {src/core => core}/boost-tuple.h (100%) rename {src/core => core}/connection-pool.cpp (100%) rename {src/core => core}/connection-pool.h (100%) rename {src/core => core}/error.cpp (100%) rename {src/core => core}/error.h (100%) rename {src/core => core}/exchange-traits.h (100%) rename {src/core => core}/into-type.cpp (100%) rename {src/core => core}/into-type.h (100%) rename {src/core => core}/into.h (100%) rename {src/core => core}/once-temp-type.cpp (100%) rename {src/core => core}/once-temp-type.h (100%) rename {src/core => core}/prepare-temp-type.cpp (100%) rename {src/core => core}/prepare-temp-type.h (100%) rename {src/core => core}/procedure.cpp (100%) rename {src/core => core}/procedure.h (100%) rename {src/core => core}/ref-counted-prepare-info.cpp (100%) rename {src/core => core}/ref-counted-prepare-info.h (100%) rename {src/core => core}/ref-counted-statement.cpp (100%) rename {src/core => core}/ref-counted-statement.h (100%) rename {src/core => core}/row-exchange.h (100%) rename {src/core => core}/row.cpp (100%) rename {src/core => core}/row.h (100%) rename {src/core => core}/rowid-exchange.h (100%) rename {src/core => core}/rowid.cpp (100%) rename {src/core => core}/rowid.h (100%) rename {src/core => core}/rowset.h (100%) rename {src/core => core}/session.cpp (100%) rename {src/core => core}/session.h (100%) rename {src/core => core}/soci-backend.h (100%) rename {src/core => core}/soci-config.h (100%) rename {src/core => core}/soci-platform.h (100%) rename {src/core => core}/soci-simple.cpp (100%) rename {src/core => core}/soci-simple.h (100%) rename {src/core => core}/soci.h (100%) rename {src/core => core}/statement.cpp (100%) rename {src/core => core}/statement.h (100%) rename {src/core => core}/test/common-tests.h (100%) rename {src/core => core}/transaction.cpp (100%) rename {src/core => core}/transaction.h (100%) rename {src/core => core}/type-conversion-traits.h (100%) rename {src/core => core}/type-conversion.h (100%) rename {src/core => core}/type-holder.h (100%) rename {src/core => core}/type-ptr.h (100%) rename {src/core => core}/unsigned-types.h (100%) rename {src/core => core}/use-type.cpp (100%) rename {src/core => core}/use-type.h (100%) rename {src/core => core}/use.h (100%) rename {src/core => core}/values-exchange.h (100%) rename {src/core => core}/values.cpp (100%) rename {src/core => core}/values.h (100%) delete mode 100644 doc/backends.html delete mode 100644 doc/backends/firebird.html delete mode 100644 doc/backends/index.html delete mode 100644 doc/backends/mysql.html delete mode 100644 doc/backends/odbc.html delete mode 100644 doc/backends/oracle.html delete mode 100644 doc/backends/postgresql.html delete mode 100644 doc/backends/sqlite3.html delete mode 100644 doc/basics.html delete mode 100644 doc/beyond.html delete mode 100644 doc/boost.html delete mode 100644 doc/errors.html delete mode 100644 doc/exchange.html delete mode 100644 doc/index.html delete mode 100644 doc/installation.html delete mode 100644 doc/interfaces.html delete mode 100644 doc/multithreading.html delete mode 100644 doc/rationale.html delete mode 100644 doc/reference.html delete mode 100644 doc/statements.html delete mode 100644 doc/structure.html delete mode 100644 doc/structure.odg delete mode 100644 doc/structure.png delete mode 100644 doc/style.css rename src/ideas.txt => ideas.txt (100%) delete mode 100644 src/.gitignore delete mode 100644 src/README delete mode 100644 www/articles.html delete mode 100644 www/doc.html delete mode 100644 www/events.html delete mode 100644 www/index.html delete mode 100644 www/links.html delete mode 100644 www/people.html delete mode 100644 www/style.css diff --git a/.gitignore b/.gitignore index 1586e959..fd0596b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,19 @@ -tmp - +*~ +*.kdev[0-9] +*.swp +aclocal.m4 +autom4te.cache +confdefs.h +config.guess +config.log +config.status +config.sub +configure +depcomp +install-sh +libtool +ltmain.sh +m4 +missing +Makefile +Makefile.in diff --git a/src/AUTHORS b/AUTHORS similarity index 100% rename from src/AUTHORS rename to AUTHORS diff --git a/src/CHANGES b/CHANGES similarity index 100% rename from src/CHANGES rename to CHANGES diff --git a/src/CMakeLists.txt b/CMakeLists.txt similarity index 100% rename from src/CMakeLists.txt rename to CMakeLists.txt diff --git a/src/LICENSE_1_0.txt b/LICENSE_1_0.txt similarity index 100% rename from src/LICENSE_1_0.txt rename to LICENSE_1_0.txt diff --git a/README b/README index bba174f2..1f37730e 100644 --- a/README +++ b/README @@ -10,9 +10,12 @@ Development, Download, Bug Tracking, Mailing Lists: http://sourceforge.net/projects/soci/ -Git repository of SOCI project ------------------------------- +That branch corresponds to the 'src' sub-directory of the Git repository. + +Reminder: Git repository of SOCI project +---------------------------------------- /src - project source code tree /doc - project documentation /www - project website /build - legacy build configurations (to be removed) + diff --git a/src/TODO b/TODO similarity index 100% rename from src/TODO rename to TODO diff --git a/src/autogen.sh b/autogen.sh similarity index 100% rename from src/autogen.sh rename to autogen.sh diff --git a/src/backends/.gitignore b/backends/.gitignore similarity index 100% rename from src/backends/.gitignore rename to backends/.gitignore diff --git a/src/backends/CMakeLists.txt b/backends/CMakeLists.txt similarity index 100% rename from src/backends/CMakeLists.txt rename to backends/CMakeLists.txt diff --git a/src/backends/empty/CMakeLists.txt b/backends/empty/CMakeLists.txt similarity index 100% rename from src/backends/empty/CMakeLists.txt rename to backends/empty/CMakeLists.txt diff --git a/src/backends/empty/Makefile.basic b/backends/empty/Makefile.basic similarity index 100% rename from src/backends/empty/Makefile.basic rename to backends/empty/Makefile.basic diff --git a/src/backends/empty/blob.cpp b/backends/empty/blob.cpp similarity index 100% rename from src/backends/empty/blob.cpp rename to backends/empty/blob.cpp diff --git a/src/backends/empty/factory.cpp b/backends/empty/factory.cpp similarity index 100% rename from src/backends/empty/factory.cpp rename to backends/empty/factory.cpp diff --git a/src/backends/empty/row-id.cpp b/backends/empty/row-id.cpp similarity index 100% rename from src/backends/empty/row-id.cpp rename to backends/empty/row-id.cpp diff --git a/src/backends/empty/session.cpp b/backends/empty/session.cpp similarity index 100% rename from src/backends/empty/session.cpp rename to backends/empty/session.cpp diff --git a/src/backends/empty/soci-empty.h b/backends/empty/soci-empty.h similarity index 100% rename from src/backends/empty/soci-empty.h rename to backends/empty/soci-empty.h diff --git a/src/backends/empty/standard-into-type.cpp b/backends/empty/standard-into-type.cpp similarity index 100% rename from src/backends/empty/standard-into-type.cpp rename to backends/empty/standard-into-type.cpp diff --git a/src/backends/empty/standard-use-type.cpp b/backends/empty/standard-use-type.cpp similarity index 100% rename from src/backends/empty/standard-use-type.cpp rename to backends/empty/standard-use-type.cpp diff --git a/src/backends/empty/statement.cpp b/backends/empty/statement.cpp similarity index 100% rename from src/backends/empty/statement.cpp rename to backends/empty/statement.cpp diff --git a/src/backends/empty/test/.gitignore b/backends/empty/test/.gitignore similarity index 100% rename from src/backends/empty/test/.gitignore rename to backends/empty/test/.gitignore diff --git a/src/backends/empty/test/CMakeLists.txt b/backends/empty/test/CMakeLists.txt similarity index 100% rename from src/backends/empty/test/CMakeLists.txt rename to backends/empty/test/CMakeLists.txt diff --git a/src/backends/empty/test/Makefile.basic b/backends/empty/test/Makefile.basic similarity index 100% rename from src/backends/empty/test/Makefile.basic rename to backends/empty/test/Makefile.basic diff --git a/src/backends/empty/test/test-empty.cpp b/backends/empty/test/test-empty.cpp similarity index 100% rename from src/backends/empty/test/test-empty.cpp rename to backends/empty/test/test-empty.cpp diff --git a/src/backends/empty/vector-into-type.cpp b/backends/empty/vector-into-type.cpp similarity index 100% rename from src/backends/empty/vector-into-type.cpp rename to backends/empty/vector-into-type.cpp diff --git a/src/backends/empty/vector-use-type.cpp b/backends/empty/vector-use-type.cpp similarity index 100% rename from src/backends/empty/vector-use-type.cpp rename to backends/empty/vector-use-type.cpp diff --git a/src/backends/firebird/Makefile.basic b/backends/firebird/Makefile.basic similarity index 100% rename from src/backends/firebird/Makefile.basic rename to backends/firebird/Makefile.basic diff --git a/src/backends/firebird/blob.cpp b/backends/firebird/blob.cpp similarity index 100% rename from src/backends/firebird/blob.cpp rename to backends/firebird/blob.cpp diff --git a/src/backends/firebird/common.cpp b/backends/firebird/common.cpp similarity index 100% rename from src/backends/firebird/common.cpp rename to backends/firebird/common.cpp diff --git a/src/backends/firebird/common.h b/backends/firebird/common.h similarity index 100% rename from src/backends/firebird/common.h rename to backends/firebird/common.h diff --git a/src/backends/firebird/error-firebird.cpp b/backends/firebird/error-firebird.cpp similarity index 100% rename from src/backends/firebird/error-firebird.cpp rename to backends/firebird/error-firebird.cpp diff --git a/src/backends/firebird/error-firebird.h b/backends/firebird/error-firebird.h similarity index 100% rename from src/backends/firebird/error-firebird.h rename to backends/firebird/error-firebird.h diff --git a/src/backends/firebird/factory.cpp b/backends/firebird/factory.cpp similarity index 100% rename from src/backends/firebird/factory.cpp rename to backends/firebird/factory.cpp diff --git a/src/backends/firebird/row-id.cpp b/backends/firebird/row-id.cpp similarity index 100% rename from src/backends/firebird/row-id.cpp rename to backends/firebird/row-id.cpp diff --git a/src/backends/firebird/session.cpp b/backends/firebird/session.cpp similarity index 100% rename from src/backends/firebird/session.cpp rename to backends/firebird/session.cpp diff --git a/src/backends/firebird/soci-firebird.h b/backends/firebird/soci-firebird.h similarity index 100% rename from src/backends/firebird/soci-firebird.h rename to backends/firebird/soci-firebird.h diff --git a/src/backends/firebird/standard-into-type.cpp b/backends/firebird/standard-into-type.cpp similarity index 100% rename from src/backends/firebird/standard-into-type.cpp rename to backends/firebird/standard-into-type.cpp diff --git a/src/backends/firebird/standard-use-type.cpp b/backends/firebird/standard-use-type.cpp similarity index 100% rename from src/backends/firebird/standard-use-type.cpp rename to backends/firebird/standard-use-type.cpp diff --git a/src/backends/firebird/statement.cpp b/backends/firebird/statement.cpp similarity index 100% rename from src/backends/firebird/statement.cpp rename to backends/firebird/statement.cpp diff --git a/src/backends/firebird/test/Makefile.basic b/backends/firebird/test/Makefile.basic similarity index 100% rename from src/backends/firebird/test/Makefile.basic rename to backends/firebird/test/Makefile.basic diff --git a/src/backends/firebird/test/test-firebird.cpp b/backends/firebird/test/test-firebird.cpp similarity index 100% rename from src/backends/firebird/test/test-firebird.cpp rename to backends/firebird/test/test-firebird.cpp diff --git a/src/backends/firebird/vector-into-type.cpp b/backends/firebird/vector-into-type.cpp similarity index 100% rename from src/backends/firebird/vector-into-type.cpp rename to backends/firebird/vector-into-type.cpp diff --git a/src/backends/firebird/vector-use-type.cpp b/backends/firebird/vector-use-type.cpp similarity index 100% rename from src/backends/firebird/vector-use-type.cpp rename to backends/firebird/vector-use-type.cpp diff --git a/src/backends/mysql/CMakeLists.txt b/backends/mysql/CMakeLists.txt similarity index 100% rename from src/backends/mysql/CMakeLists.txt rename to backends/mysql/CMakeLists.txt diff --git a/src/backends/mysql/Makefile.basic b/backends/mysql/Makefile.basic similarity index 100% rename from src/backends/mysql/Makefile.basic rename to backends/mysql/Makefile.basic diff --git a/src/backends/mysql/blob.cpp b/backends/mysql/blob.cpp similarity index 100% rename from src/backends/mysql/blob.cpp rename to backends/mysql/blob.cpp diff --git a/src/backends/mysql/common.cpp b/backends/mysql/common.cpp similarity index 100% rename from src/backends/mysql/common.cpp rename to backends/mysql/common.cpp diff --git a/src/backends/mysql/common.h b/backends/mysql/common.h similarity index 100% rename from src/backends/mysql/common.h rename to backends/mysql/common.h diff --git a/src/backends/mysql/factory.cpp b/backends/mysql/factory.cpp similarity index 100% rename from src/backends/mysql/factory.cpp rename to backends/mysql/factory.cpp diff --git a/src/backends/mysql/row-id.cpp b/backends/mysql/row-id.cpp similarity index 100% rename from src/backends/mysql/row-id.cpp rename to backends/mysql/row-id.cpp diff --git a/src/backends/mysql/session.cpp b/backends/mysql/session.cpp similarity index 100% rename from src/backends/mysql/session.cpp rename to backends/mysql/session.cpp diff --git a/src/backends/mysql/soci-mysql.h b/backends/mysql/soci-mysql.h similarity index 100% rename from src/backends/mysql/soci-mysql.h rename to backends/mysql/soci-mysql.h diff --git a/src/backends/mysql/standard-into-type.cpp b/backends/mysql/standard-into-type.cpp similarity index 100% rename from src/backends/mysql/standard-into-type.cpp rename to backends/mysql/standard-into-type.cpp diff --git a/src/backends/mysql/standard-use-type.cpp b/backends/mysql/standard-use-type.cpp similarity index 100% rename from src/backends/mysql/standard-use-type.cpp rename to backends/mysql/standard-use-type.cpp diff --git a/src/backends/mysql/statement.cpp b/backends/mysql/statement.cpp similarity index 100% rename from src/backends/mysql/statement.cpp rename to backends/mysql/statement.cpp diff --git a/src/backends/mysql/test/.gitignore b/backends/mysql/test/.gitignore similarity index 100% rename from src/backends/mysql/test/.gitignore rename to backends/mysql/test/.gitignore diff --git a/src/backends/mysql/test/CMakeLists.txt b/backends/mysql/test/CMakeLists.txt similarity index 100% rename from src/backends/mysql/test/CMakeLists.txt rename to backends/mysql/test/CMakeLists.txt diff --git a/src/backends/mysql/test/Makefile.basic b/backends/mysql/test/Makefile.basic similarity index 100% rename from src/backends/mysql/test/Makefile.basic rename to backends/mysql/test/Makefile.basic diff --git a/src/backends/mysql/test/test-mysql.cpp b/backends/mysql/test/test-mysql.cpp similarity index 100% rename from src/backends/mysql/test/test-mysql.cpp rename to backends/mysql/test/test-mysql.cpp diff --git a/src/backends/mysql/vector-into-type.cpp b/backends/mysql/vector-into-type.cpp similarity index 100% rename from src/backends/mysql/vector-into-type.cpp rename to backends/mysql/vector-into-type.cpp diff --git a/src/backends/mysql/vector-use-type.cpp b/backends/mysql/vector-use-type.cpp similarity index 100% rename from src/backends/mysql/vector-use-type.cpp rename to backends/mysql/vector-use-type.cpp diff --git a/src/backends/odbc/CMakeLists.txt b/backends/odbc/CMakeLists.txt similarity index 100% rename from src/backends/odbc/CMakeLists.txt rename to backends/odbc/CMakeLists.txt diff --git a/src/backends/odbc/Makefile.basic b/backends/odbc/Makefile.basic similarity index 100% rename from src/backends/odbc/Makefile.basic rename to backends/odbc/Makefile.basic diff --git a/src/backends/odbc/blob.cpp b/backends/odbc/blob.cpp similarity index 100% rename from src/backends/odbc/blob.cpp rename to backends/odbc/blob.cpp diff --git a/src/backends/odbc/factory.cpp b/backends/odbc/factory.cpp similarity index 100% rename from src/backends/odbc/factory.cpp rename to backends/odbc/factory.cpp diff --git a/src/backends/odbc/makefile.msvc b/backends/odbc/makefile.msvc similarity index 100% rename from src/backends/odbc/makefile.msvc rename to backends/odbc/makefile.msvc diff --git a/src/backends/odbc/row-id.cpp b/backends/odbc/row-id.cpp similarity index 100% rename from src/backends/odbc/row-id.cpp rename to backends/odbc/row-id.cpp diff --git a/src/backends/odbc/session.cpp b/backends/odbc/session.cpp similarity index 100% rename from src/backends/odbc/session.cpp rename to backends/odbc/session.cpp diff --git a/src/backends/odbc/soci-odbc.h b/backends/odbc/soci-odbc.h similarity index 100% rename from src/backends/odbc/soci-odbc.h rename to backends/odbc/soci-odbc.h diff --git a/src/backends/odbc/standard-into-type.cpp b/backends/odbc/standard-into-type.cpp similarity index 100% rename from src/backends/odbc/standard-into-type.cpp rename to backends/odbc/standard-into-type.cpp diff --git a/src/backends/odbc/standard-use-type.cpp b/backends/odbc/standard-use-type.cpp similarity index 100% rename from src/backends/odbc/standard-use-type.cpp rename to backends/odbc/standard-use-type.cpp diff --git a/src/backends/odbc/statement.cpp b/backends/odbc/statement.cpp similarity index 100% rename from src/backends/odbc/statement.cpp rename to backends/odbc/statement.cpp diff --git a/src/backends/odbc/test/CMakeLists.txt b/backends/odbc/test/CMakeLists.txt similarity index 100% rename from src/backends/odbc/test/CMakeLists.txt rename to backends/odbc/test/CMakeLists.txt diff --git a/src/backends/odbc/test/Makefile.basic b/backends/odbc/test/Makefile.basic similarity index 100% rename from src/backends/odbc/test/Makefile.basic rename to backends/odbc/test/Makefile.basic diff --git a/src/backends/odbc/test/makefile.msvc b/backends/odbc/test/makefile.msvc similarity index 100% rename from src/backends/odbc/test/makefile.msvc rename to backends/odbc/test/makefile.msvc diff --git a/src/backends/odbc/test/test-access.dsn b/backends/odbc/test/test-access.dsn similarity index 100% rename from src/backends/odbc/test/test-access.dsn rename to backends/odbc/test/test-access.dsn diff --git a/src/backends/odbc/test/test-mssql.dsn b/backends/odbc/test/test-mssql.dsn similarity index 100% rename from src/backends/odbc/test/test-mssql.dsn rename to backends/odbc/test/test-mssql.dsn diff --git a/src/backends/odbc/test/test-mysql.dsn b/backends/odbc/test/test-mysql.dsn similarity index 100% rename from src/backends/odbc/test/test-mysql.dsn rename to backends/odbc/test/test-mysql.dsn diff --git a/src/backends/odbc/test/test-odbc-access.cpp b/backends/odbc/test/test-odbc-access.cpp similarity index 100% rename from src/backends/odbc/test/test-odbc-access.cpp rename to backends/odbc/test/test-odbc-access.cpp diff --git a/src/backends/odbc/test/test-odbc-mssql.cpp b/backends/odbc/test/test-odbc-mssql.cpp similarity index 100% rename from src/backends/odbc/test/test-odbc-mssql.cpp rename to backends/odbc/test/test-odbc-mssql.cpp diff --git a/src/backends/odbc/test/test-odbc-mysql.cpp b/backends/odbc/test/test-odbc-mysql.cpp similarity index 100% rename from src/backends/odbc/test/test-odbc-mysql.cpp rename to backends/odbc/test/test-odbc-mysql.cpp diff --git a/src/backends/odbc/test/test-odbc-postgresql.cpp b/backends/odbc/test/test-odbc-postgresql.cpp similarity index 100% rename from src/backends/odbc/test/test-odbc-postgresql.cpp rename to backends/odbc/test/test-odbc-postgresql.cpp diff --git a/src/backends/odbc/test/test-postgresql.dsn b/backends/odbc/test/test-postgresql.dsn similarity index 100% rename from src/backends/odbc/test/test-postgresql.dsn rename to backends/odbc/test/test-postgresql.dsn diff --git a/src/backends/odbc/utility.h b/backends/odbc/utility.h similarity index 100% rename from src/backends/odbc/utility.h rename to backends/odbc/utility.h diff --git a/src/backends/odbc/vector-into-type.cpp b/backends/odbc/vector-into-type.cpp similarity index 100% rename from src/backends/odbc/vector-into-type.cpp rename to backends/odbc/vector-into-type.cpp diff --git a/src/backends/odbc/vector-use-type.cpp b/backends/odbc/vector-use-type.cpp similarity index 100% rename from src/backends/odbc/vector-use-type.cpp rename to backends/odbc/vector-use-type.cpp diff --git a/src/backends/oracle/CMakeLists.txt b/backends/oracle/CMakeLists.txt similarity index 100% rename from src/backends/oracle/CMakeLists.txt rename to backends/oracle/CMakeLists.txt diff --git a/src/backends/oracle/Makefile.basic b/backends/oracle/Makefile.basic similarity index 100% rename from src/backends/oracle/Makefile.basic rename to backends/oracle/Makefile.basic diff --git a/src/backends/oracle/blob.cpp b/backends/oracle/blob.cpp similarity index 100% rename from src/backends/oracle/blob.cpp rename to backends/oracle/blob.cpp diff --git a/src/backends/oracle/error.cpp b/backends/oracle/error.cpp similarity index 100% rename from src/backends/oracle/error.cpp rename to backends/oracle/error.cpp diff --git a/src/backends/oracle/error.h b/backends/oracle/error.h similarity index 100% rename from src/backends/oracle/error.h rename to backends/oracle/error.h diff --git a/src/backends/oracle/factory.cpp b/backends/oracle/factory.cpp similarity index 100% rename from src/backends/oracle/factory.cpp rename to backends/oracle/factory.cpp diff --git a/src/backends/oracle/row-id.cpp b/backends/oracle/row-id.cpp similarity index 100% rename from src/backends/oracle/row-id.cpp rename to backends/oracle/row-id.cpp diff --git a/src/backends/oracle/session.cpp b/backends/oracle/session.cpp similarity index 100% rename from src/backends/oracle/session.cpp rename to backends/oracle/session.cpp diff --git a/src/backends/oracle/soci-oracle.h b/backends/oracle/soci-oracle.h similarity index 100% rename from src/backends/oracle/soci-oracle.h rename to backends/oracle/soci-oracle.h diff --git a/src/backends/oracle/standard-into-type.cpp b/backends/oracle/standard-into-type.cpp similarity index 100% rename from src/backends/oracle/standard-into-type.cpp rename to backends/oracle/standard-into-type.cpp diff --git a/src/backends/oracle/standard-use-type.cpp b/backends/oracle/standard-use-type.cpp similarity index 100% rename from src/backends/oracle/standard-use-type.cpp rename to backends/oracle/standard-use-type.cpp diff --git a/src/backends/oracle/statement.cpp b/backends/oracle/statement.cpp similarity index 100% rename from src/backends/oracle/statement.cpp rename to backends/oracle/statement.cpp diff --git a/src/backends/oracle/test/CMakeLists.txt b/backends/oracle/test/CMakeLists.txt similarity index 100% rename from src/backends/oracle/test/CMakeLists.txt rename to backends/oracle/test/CMakeLists.txt diff --git a/src/backends/oracle/test/Makefile.basic b/backends/oracle/test/Makefile.basic similarity index 100% rename from src/backends/oracle/test/Makefile.basic rename to backends/oracle/test/Makefile.basic diff --git a/src/backends/oracle/test/test-oracle.cpp b/backends/oracle/test/test-oracle.cpp similarity index 100% rename from src/backends/oracle/test/test-oracle.cpp rename to backends/oracle/test/test-oracle.cpp diff --git a/src/backends/oracle/vector-into-type.cpp b/backends/oracle/vector-into-type.cpp similarity index 100% rename from src/backends/oracle/vector-into-type.cpp rename to backends/oracle/vector-into-type.cpp diff --git a/src/backends/oracle/vector-use-type.cpp b/backends/oracle/vector-use-type.cpp similarity index 100% rename from src/backends/oracle/vector-use-type.cpp rename to backends/oracle/vector-use-type.cpp diff --git a/src/backends/postgresql/CMakeLists.txt b/backends/postgresql/CMakeLists.txt similarity index 100% rename from src/backends/postgresql/CMakeLists.txt rename to backends/postgresql/CMakeLists.txt diff --git a/src/backends/postgresql/Makefile.basic b/backends/postgresql/Makefile.basic similarity index 100% rename from src/backends/postgresql/Makefile.basic rename to backends/postgresql/Makefile.basic diff --git a/src/backends/postgresql/blob.cpp b/backends/postgresql/blob.cpp similarity index 100% rename from src/backends/postgresql/blob.cpp rename to backends/postgresql/blob.cpp diff --git a/src/backends/postgresql/common.cpp b/backends/postgresql/common.cpp similarity index 100% rename from src/backends/postgresql/common.cpp rename to backends/postgresql/common.cpp diff --git a/src/backends/postgresql/common.h b/backends/postgresql/common.h similarity index 100% rename from src/backends/postgresql/common.h rename to backends/postgresql/common.h diff --git a/src/backends/postgresql/factory.cpp b/backends/postgresql/factory.cpp similarity index 100% rename from src/backends/postgresql/factory.cpp rename to backends/postgresql/factory.cpp diff --git a/src/backends/postgresql/row-id.cpp b/backends/postgresql/row-id.cpp similarity index 100% rename from src/backends/postgresql/row-id.cpp rename to backends/postgresql/row-id.cpp diff --git a/src/backends/postgresql/session.cpp b/backends/postgresql/session.cpp similarity index 100% rename from src/backends/postgresql/session.cpp rename to backends/postgresql/session.cpp diff --git a/src/backends/postgresql/soci-postgresql.h b/backends/postgresql/soci-postgresql.h similarity index 100% rename from src/backends/postgresql/soci-postgresql.h rename to backends/postgresql/soci-postgresql.h diff --git a/src/backends/postgresql/standard-into-type.cpp b/backends/postgresql/standard-into-type.cpp similarity index 100% rename from src/backends/postgresql/standard-into-type.cpp rename to backends/postgresql/standard-into-type.cpp diff --git a/src/backends/postgresql/standard-use-type.cpp b/backends/postgresql/standard-use-type.cpp similarity index 100% rename from src/backends/postgresql/standard-use-type.cpp rename to backends/postgresql/standard-use-type.cpp diff --git a/src/backends/postgresql/statement.cpp b/backends/postgresql/statement.cpp similarity index 100% rename from src/backends/postgresql/statement.cpp rename to backends/postgresql/statement.cpp diff --git a/src/backends/postgresql/test/.gitignore b/backends/postgresql/test/.gitignore similarity index 100% rename from src/backends/postgresql/test/.gitignore rename to backends/postgresql/test/.gitignore diff --git a/src/backends/postgresql/test/CMakeLists.txt b/backends/postgresql/test/CMakeLists.txt similarity index 100% rename from src/backends/postgresql/test/CMakeLists.txt rename to backends/postgresql/test/CMakeLists.txt diff --git a/src/backends/postgresql/test/Makefile.basic b/backends/postgresql/test/Makefile.basic similarity index 100% rename from src/backends/postgresql/test/Makefile.basic rename to backends/postgresql/test/Makefile.basic diff --git a/src/backends/postgresql/test/test-postgresql.cpp b/backends/postgresql/test/test-postgresql.cpp similarity index 100% rename from src/backends/postgresql/test/test-postgresql.cpp rename to backends/postgresql/test/test-postgresql.cpp diff --git a/src/backends/postgresql/vector-into-type.cpp b/backends/postgresql/vector-into-type.cpp similarity index 100% rename from src/backends/postgresql/vector-into-type.cpp rename to backends/postgresql/vector-into-type.cpp diff --git a/src/backends/postgresql/vector-use-type.cpp b/backends/postgresql/vector-use-type.cpp similarity index 100% rename from src/backends/postgresql/vector-use-type.cpp rename to backends/postgresql/vector-use-type.cpp diff --git a/src/backends/sqlite3/CMakeLists.txt b/backends/sqlite3/CMakeLists.txt similarity index 100% rename from src/backends/sqlite3/CMakeLists.txt rename to backends/sqlite3/CMakeLists.txt diff --git a/src/backends/sqlite3/Makefile.basic b/backends/sqlite3/Makefile.basic similarity index 100% rename from src/backends/sqlite3/Makefile.basic rename to backends/sqlite3/Makefile.basic diff --git a/src/backends/sqlite3/blob.cpp b/backends/sqlite3/blob.cpp similarity index 100% rename from src/backends/sqlite3/blob.cpp rename to backends/sqlite3/blob.cpp diff --git a/src/backends/sqlite3/common.cpp b/backends/sqlite3/common.cpp similarity index 100% rename from src/backends/sqlite3/common.cpp rename to backends/sqlite3/common.cpp diff --git a/src/backends/sqlite3/common.h b/backends/sqlite3/common.h similarity index 100% rename from src/backends/sqlite3/common.h rename to backends/sqlite3/common.h diff --git a/src/backends/sqlite3/factory.cpp b/backends/sqlite3/factory.cpp similarity index 100% rename from src/backends/sqlite3/factory.cpp rename to backends/sqlite3/factory.cpp diff --git a/src/backends/sqlite3/row-id.cpp b/backends/sqlite3/row-id.cpp similarity index 100% rename from src/backends/sqlite3/row-id.cpp rename to backends/sqlite3/row-id.cpp diff --git a/src/backends/sqlite3/session.cpp b/backends/sqlite3/session.cpp similarity index 100% rename from src/backends/sqlite3/session.cpp rename to backends/sqlite3/session.cpp diff --git a/src/backends/sqlite3/soci-sqlite3.h b/backends/sqlite3/soci-sqlite3.h similarity index 100% rename from src/backends/sqlite3/soci-sqlite3.h rename to backends/sqlite3/soci-sqlite3.h diff --git a/src/backends/sqlite3/standard-into-type.cpp b/backends/sqlite3/standard-into-type.cpp similarity index 100% rename from src/backends/sqlite3/standard-into-type.cpp rename to backends/sqlite3/standard-into-type.cpp diff --git a/src/backends/sqlite3/standard-use-type.cpp b/backends/sqlite3/standard-use-type.cpp similarity index 100% rename from src/backends/sqlite3/standard-use-type.cpp rename to backends/sqlite3/standard-use-type.cpp diff --git a/src/backends/sqlite3/statement.cpp b/backends/sqlite3/statement.cpp similarity index 100% rename from src/backends/sqlite3/statement.cpp rename to backends/sqlite3/statement.cpp diff --git a/src/backends/sqlite3/test/.gitignore b/backends/sqlite3/test/.gitignore similarity index 100% rename from src/backends/sqlite3/test/.gitignore rename to backends/sqlite3/test/.gitignore diff --git a/src/backends/sqlite3/test/CMakeLists.txt b/backends/sqlite3/test/CMakeLists.txt similarity index 100% rename from src/backends/sqlite3/test/CMakeLists.txt rename to backends/sqlite3/test/CMakeLists.txt diff --git a/src/backends/sqlite3/test/Makefile.basic b/backends/sqlite3/test/Makefile.basic similarity index 100% rename from src/backends/sqlite3/test/Makefile.basic rename to backends/sqlite3/test/Makefile.basic diff --git a/src/backends/sqlite3/test/test-sqlite3.cpp b/backends/sqlite3/test/test-sqlite3.cpp similarity index 100% rename from src/backends/sqlite3/test/test-sqlite3.cpp rename to backends/sqlite3/test/test-sqlite3.cpp diff --git a/src/backends/sqlite3/vector-into-type.cpp b/backends/sqlite3/vector-into-type.cpp similarity index 100% rename from src/backends/sqlite3/vector-into-type.cpp rename to backends/sqlite3/vector-into-type.cpp diff --git a/src/backends/sqlite3/vector-use-type.cpp b/backends/sqlite3/vector-use-type.cpp similarity index 100% rename from src/backends/sqlite3/vector-use-type.cpp rename to backends/sqlite3/vector-use-type.cpp diff --git a/build/README b/build/README deleted file mode 100644 index db968b7b..00000000 --- a/build/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory is dedicated for: -- other building systems contributed by SOCI team and users diff --git a/build/unix/build-core.tcl b/build/unix/build-core.tcl deleted file mode 100644 index aba8d8ec..00000000 --- a/build/unix/build-core.tcl +++ /dev/null @@ -1,37 +0,0 @@ -proc buildCore {} { - global CXXFLAGS - - puts "building static core" - - set cwd [pwd] - cd "../../src/core" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS" - } - - execute "ar cr libsoci_core.a [glob *.o]" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/core/libsoci_core.a lib" - eval exec mkdir -p "include" - execute "cp [glob ../../src/core/*.h] include" -} - -proc buildCoreSo {} { - global CXXFLAGS SHARED - - puts "building shared core" - - set cwd [pwd] - cd "../../src/core" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -fPIC" - } - - execute "g++ $SHARED -o libsoci_core.so [glob *.o]" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/core/libsoci_core.so lib" - eval exec mkdir -p "include" - execute "cp [glob ../../src/core/*.h] include" -} diff --git a/build/unix/build-mysql.tcl b/build/unix/build-mysql.tcl deleted file mode 100644 index f1371ae5..00000000 --- a/build/unix/build-mysql.tcl +++ /dev/null @@ -1,142 +0,0 @@ -source "local/parameters.tcl" - -proc findMySQL {} { - global mysqlInclude mysqlLib - - # candidate directories for local MySQL: - set includeDirs { - "/usr/local/include/mysql" - "/usr/include/mysql" - "/usr/local/include" - "/usr/include" - "/opt/local/include" - } - set libDirs { - "/usr/local/lib/mysql" - "/usr/lib/mysql" - "/usr/local/lib" - "/usr/lib" - "/opt/local/lib" - } - - if [info exists mysqlInclude] { - set includeDirs [list $mysqlInclude] - } - if [info exists mysqlLib] { - set libDirs [list $mysqlLib] - } - - set includeDir "" - foreach I $includeDirs { - set header "${I}/mysql.h" - if {[file exists $header]} { - set includeDir $I - break - } - } - if {$includeDir == ""} { - return {} - } - - set libDir "" - foreach L $libDirs { - set libraryA "${L}/libmysqlclient.a" - set librarySo "${L}/libmysqlclient.so" - if {[file exists $libraryA] || [file exists $librarySo]} { - set libDir $L - break - } - } - if {$libDir == ""} { - return {} - } - - return [list $includeDir $libDir] -} - -proc buildMySQL {} { - global CXXFLAGS - - puts "building static MySQL" - - set dirs [findMySQL] - if {$dirs == {}} { - puts "cannot find MySQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/mysql" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -I../../core -I${includeDir}" - } - - execute "ar cr libsoci_mysql.a [glob *.o]" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/mysql/libsoci_mysql.a lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/mysql/soci-mysql.h include" -} - -proc buildMySQLSo {} { - global CXXFLAGS SHARED - - puts "building shared MySQL" - - set dirs [findMySQL] - if {$dirs == {}} { - puts "cannot find MySQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/mysql" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -fPIC -I../../core -I${includeDir}" - } - - execute "g++ $SHARED -o libsoci_mysql.so [glob *.o] -L${libDir} -lmysqlclient -lz" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/mysql/libsoci_mysql.so lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/mysql/soci-mysql.h include" -} - -proc buildMySQLTest {} { - global CXXTESTFLAGS LDL - - puts "building MySQL test" - - set dirs [findMySQL] - if {$dirs == {}} { - puts "cannot find MySQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set dirs [findBoost] - if {$dirs == {}} { - puts "cannot find Boost library files, skipping this target" - return - } - - set boostIncludeDir [lindex $dirs 0] - set boostLibDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/mysql/test" - execute "g++ test-mysql.cpp -o test-mysql $CXXTESTFLAGS -I.. -I../../../core -I../../../core/test -I${includeDir} -I${boostIncludeDir} -L../../../../build/unix/lib -L${libDir} -L${boostLibDir} -lsoci_core -lsoci_mysql -lboost_date_time ${LDL} -lmysqlclient -lz" - cd $cwd - eval exec mkdir -p "tests" - execute "cp ../../src/backends/mysql/test/test-mysql tests" -} diff --git a/build/unix/build-oracle.tcl b/build/unix/build-oracle.tcl deleted file mode 100644 index ac59d0b2..00000000 --- a/build/unix/build-oracle.tcl +++ /dev/null @@ -1,120 +0,0 @@ -proc findOracle {} { - global env oracleInclude oracleLib - - if {[info exists oracleInclude] && - [info exists oracleLib]} { - set includeDir $oracleInclude - set libDir $oracleLib - } else { - if {[info exists env(ORACLE_HOME)] == 0} { - puts "The ORACLE_HOME variable is not set." - return {} - } - - set ORACLE_HOME $env(ORACLE_HOME) - - set includeDir [file join $ORACLE_HOME "rdbms/public"] - set header [file join $includeDir "oci.h"] - if {[file exists $header] == 0} { - puts "ORACLE_HOME is strange." - return {} - } - - set libDir [file join $ORACLE_HOME "lib"] - set libraryA [file join $libDir "libclntsh.a"] - set librarySo [file join $libDir "libclntsh.so"] - if {([file exists $libraryA] == 0) && ([file exists $librarySo] == 0)} { - puts "ORACLE_HOME is strange." - return {} - } - } - - return [list $includeDir $libDir] -} - -proc buildOracle {} { - global CXXFLAGS - - puts "building static Oracle" - - set dirs [findOracle] - if {$dirs == {}} { - puts "cannot find Oracle library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/oracle" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -I../../core -I${includeDir}" - } - - execute "ar cr libsoci_oracle.a [glob *.o]" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/oracle/libsoci_oracle.a lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/oracle/soci-oracle.h include" -} - -proc buildOracleSo {} { - global CXXFLAGS SHARED - - puts "building shared Oracle" - - set dirs [findOracle] - if {$dirs == {}} { - puts "cannot find Oracle library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/oracle" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -fPIC -I../../core -I${includeDir}" - } - - execute "g++ $SHARED -o libsoci_oracle.so [glob *.o] -L${libDir} -lclntsh -lnnz10" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/oracle/libsoci_oracle.so lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/oracle/soci-oracle.h include" -} - -proc buildOracleTest {} { - global CXXTESTFLAGS LDL - - puts "building Oracle test" - - set dirs [findOracle] - if {$dirs == {}} { - puts "cannot find Oracle library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set dirs [findBoost] - if {$dirs == {}} { - puts "cannot find Boost library files, skipping this target" - return - } - - set boostIncludeDir [lindex $dirs 0] - set boostLibDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/oracle/test" - execute "g++ test-oracle.cpp -o test-oracle $CXXTESTFLAGS -I.. -I../../../core -I../../../core/test -I${includeDir} -I${boostIncludeDir} -L../../../../build/unix/lib -L${libDir} -L${boostLibDir} -lsoci_core -lsoci_oracle -lboost_date_time ${LDL} -lclntsh -lnnz10" - cd $cwd - eval exec mkdir -p "tests" - execute "cp ../../src/backends/oracle/test/test-oracle tests" -} diff --git a/build/unix/build-postgresql.tcl b/build/unix/build-postgresql.tcl deleted file mode 100644 index 49a4f939..00000000 --- a/build/unix/build-postgresql.tcl +++ /dev/null @@ -1,148 +0,0 @@ -proc findPostgreSQL {} { - global postgresqlInclude postgresqlLib - - # candidate directories for local PostgreSQL: - set includeDirs { - "/usr/local/pgsql/include" - "/usr/local/postgresql/include" - "/usr/local/include/pgsql" - "/usr/local/include/postgresql" - "/usr/include/pgsql" - "/usr/include/postgresql" - "/usr/local/include" - "/usr/include" - "/opt/local/include" - } - set libDirs { - "/usr/local/pgsql/lib" - "/usr/local/postgresql/lib" - "/usr/local/lib/pgsql" - "/usr/local/lib/postgresql" - "/usr/lib/pgsql" - "/usr/lib/postgresql" - "/usr/local/lib" - "/usr/lib" - "/opt/local/lib" - } - - if [info exists postgresqlInclude] { - set includeDirs [list $postgresqlInclude] - } - if [info exists postgresqlLib] { - set libDirs [list $postgresqlLib] - } - - set includeDir "" - foreach I $includeDirs { - set header "${I}/libpq/libpq-fs.h" - if {[file exists $header]} { - set includeDir $I - break - } - } - if {$includeDir == ""} { - return {} - } - - set libDir "" - foreach L $libDirs { - set libraryA "${L}/libpq.a" - set librarySo "${L}/libpq.so" - if {[file exists $libraryA] || [file exists $librarySo]} { - set libDir $L - break - } - } - if {$libDir == ""} { - return {} - } - - return [list $includeDir $libDir] -} - -proc buildPostgreSQL {} { - global CXXFLAGS - - puts "building static PostgreSQL" - - set dirs [findPostgreSQL] - if {$dirs == {}} { - puts "cannot find PostgreSQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/postgresql" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -I../../core -I${includeDir}" - } - - execute "ar cr libsoci_postgresql.a [glob *.o]" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/postgresql/libsoci_postgresql.a lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/postgresql/soci-postgresql.h include" -} - -proc buildPostgreSQLSo {} { - global CXXFLAGS SHARED - - puts "building shared PostgreSQL" - - set dirs [findPostgreSQL] - if {$dirs == {}} { - puts "cannot find PostgreSQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/postgresql" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -fPIC -I../../core -I${includeDir}" - } - - execute "g++ $SHARED -o libsoci_postgresql.so [glob *.o] -L${libDir} -lpq" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/postgresql/libsoci_postgresql.so lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/postgresql/soci-postgresql.h include" -} - -proc buildPostgreSQLTest {} { - global CXXTESTFLAGS LDL - - puts "building PostgreSQL test" - - set dirs [findPostgreSQL] - if {$dirs == {}} { - puts "cannot find PostgreSQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set dirs [findBoost] - if {$dirs == {}} { - puts "cannot find Boost library files, skipping this target" - return - } - - set boostIncludeDir [lindex $dirs 0] - set boostLibDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/postgresql/test" - execute "g++ test-postgresql.cpp -o test-postgresql $CXXTESTFLAGS -I.. -I../../../core -I../../../core/test -I${includeDir} -I${boostIncludeDir} -L../../../../build/unix/lib -L${libDir} -L${boostLibDir} -lsoci_core -lsoci_postgresql -lboost_date_time ${LDL} -lpq" - cd $cwd - eval exec mkdir -p "tests" - execute "cp ../../src/backends/postgresql/test/test-postgresql tests" -} diff --git a/build/unix/build-sqlite3.tcl b/build/unix/build-sqlite3.tcl deleted file mode 100644 index a48d6516..00000000 --- a/build/unix/build-sqlite3.tcl +++ /dev/null @@ -1,142 +0,0 @@ -proc findSqlite3 {} { - global Sqlite3Include Sqlite3Lib - - # candidate directories for local sqlite3: - set includeDirs { - "/usr/local/include" - "/usr/include" - "/opt/local/include" - } - set libDirs { - "/usr/local/lib" - "/usr/lib" - "/opt/local/lib" - } - - if [info exists Sqlite3Include] { - set includeDirs [list $Sqlite3Include] - } - if [info exists Sqlite3Lib] { - set libDirs [list $Sqlite3Lib] - } - - set includeDir "" - foreach I $includeDirs { - set header "${I}/sqlite3.h" - if {[file exists $header]} { - set includeDir $I - break - } - } - if {$includeDir == ""} { - return {} - } - - set libDir "" - foreach L $libDirs { - set libraryA "${L}/libsqlite3.a" - set librarySo "${L}/libsqlite3.so" - set libraryDl "${L}/libsqlite3.dylib" - if {[file exists $libraryA] || [file exists $librarySo] || [file exists $libraryDl]} { - set libDir $L - break - } - } - if {$libDir == ""} { - return {} - } - - return [list $includeDir $libDir] -} - -proc buildSqlite3 {} { - global CXXFLAGS tcl_platform - - puts "building static Sqlite3" - - set dirs [findSqlite3] - if {$dirs == {}} { - puts "cannot find Sqlite3 library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/sqlite3" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -I../../core -I${includeDir}" - } - - execute "ar cr libsoci_sqlite3.a [glob *.o]" - if {$tcl_platform(os) == "Darwin"} { - # special case for Mac OS X - execute "ranlib libsoci_sqlite3.a" - } - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/sqlite3/libsoci_sqlite3.a lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/sqlite3/soci-sqlite3.h include" - -} - -proc buildSqlite3So {} { - global CXXFLAGS SHARED - - puts "building shared Sqlite3" - - set dirs [findSqlite3] - if {$dirs == {}} { - puts "cannot find Sqlite3 library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/sqlite3" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -fPIC -I../../core -I${includeDir}" - } - - execute "g++ $SHARED -o libsoci_sqlite3.so [glob *.o] -L${libDir} -lsqlite3" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/sqlite3/libsoci_sqlite3.so lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/sqlite3/soci-sqlite3.h include" -} - -proc buildSqlite3Test {} { - global CXXTESTFLAGS LDL - - puts "building Sqlite3 test" - - set dirs [findSqlite3] - if {$dirs == {}} { - puts "cannot find Sqlite3 library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set dirs [findBoost] - if {$dirs == {}} { - puts "cannot find Boost library files, skipping this target" - return - } - - set boostIncludeDir [lindex $dirs 0] - set boostLibDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/sqlite3/test" - execute "g++ test-sqlite3.cpp -o test-sqlite3 $CXXTESTFLAGS -I.. -I../../../core -I../../../core/test -I${includeDir} -I${boostIncludeDir} -L../../../../build/unix/lib -L${libDir} -L${boostLibDir} -lsoci_core -lsoci_sqlite3 -lboost_date_time ${LDL} -lsqlite3" - cd $cwd - eval exec mkdir -p "tests" - execute "cp ../../src/backends/sqlite3/test/test-sqlite3 tests" -} diff --git a/build/unix/build.tcl b/build/unix/build.tcl deleted file mode 100755 index 7ec3d321..00000000 --- a/build/unix/build.tcl +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/tclsh - -# some common compilation settings if you need to change them: - -if [info exists env(CXXFLAGS)] { - set CXXFLAGS $env(CXXFLAGS) -} else { - set CXXFLAGS "-Wall -pedantic -Wno-long-long -O2" -} - -set CXXTESTFLAGS "-O2" - -if {$tcl_platform(os) == "Darwin"} { - # special case for Mac OS X - set SHARED "-dynamiclib -flat_namespace -undefined suppress" -} else { - set SHARED "-shared" -} - -if {$tcl_platform(os) == "FreeBSD"} { - # FreeBSD does not have the libdl library, it is part of libc. - set LDL "" -} else { - set LDL "-ldl" -} - -source "execute.tcl" -source "find-boost.tcl" -source "build-core.tcl" -source "build-oracle.tcl" -source "build-postgresql.tcl" -source "build-mysql.tcl" - -proc printUsageAndExit {} { - puts "Usage:" - puts "$ ./build.tcl list-of-targets" - puts "" - puts "list of targets can contain any of:" - puts "core - the core part of the library (static version)" - puts "core-so - the core part of the library (shared version)" - puts "oracle - the static Oracle backend" - puts "oracle-so - the shared Oracle backend" - puts " Note: before building Oracle backend" - puts " set the ORACLE_HOME variable properly." - puts "postgresql - the static PostgreSQL backend" - puts "postgresql-so - the shared PostgreSQL backend" - puts "mysql - the static MySQL backend" - puts "mysql-so - the shared MySQL backend" - puts "" - puts "oracle-test - the test for Oracle" - puts "postgresql-test - the test for PostgreSQL" - puts "mysql-test - the test for MySQL" - puts " Note: build static core and backends first." - puts "" - puts "Examples:" - puts "" - puts "$ ./build.tcl core mysql" - puts "" - puts "$ ./build.tcl core postgresql postgresql-test" - puts "" - puts "After successful build the results are in include, lib and test directories." - puts "Move/copy the contents of these directories wherever you want." - exit -} - -if {$argc == 0 || $argv == "--help"} { - printUsageAndExit -} - -foreach target $argv { - switch -exact $target { - core buildCore - core-so buildCoreSo - oracle buildOracle - oracle-so buildOracleSo - oracle-test buildOracleTest - postgresql buildPostgreSQL - postgresql-so buildPostgreSQLSo - postgresql-test buildPostgreSQLTest - mysql buildMySQL - mysql-so buildMySQLSo - mysql-test buildMySQLTest - default { - puts "unknown target $target - skipping" - } - } -} diff --git a/build/unix/execute.tcl b/build/unix/execute.tcl deleted file mode 100644 index 90d57485..00000000 --- a/build/unix/execute.tcl +++ /dev/null @@ -1,14 +0,0 @@ -proc execute {command} { - puts $command - set result [catch {eval exec $command "2>@ stdout"} output] - if {$result != 0} { - puts "The last command did not execute properly:" - puts $output - puts "Please contact the SOCI team." - exit - } else { - if {$output != ""} { - puts $output - } - } -} diff --git a/build/unix/find-boost.tcl b/build/unix/find-boost.tcl deleted file mode 100644 index 2904ac3d..00000000 --- a/build/unix/find-boost.tcl +++ /dev/null @@ -1,47 +0,0 @@ -proc findBoost {} { - global rootBoost - - # candidate directories for local Boost: - set includeDirs { - "/usr/local/include" - "/usr/include" - "/opt/local/include" - } - set libDirs { - "/usr/local/lib" - "/usr/lib" - "/opt/local/lib" - } - - if [info exists rootBoost] { - set includeDirs [list $rootBoost] - set libDirs [list $rootBoost] - } - - set includeDir "" - foreach I $includeDirs { - set header "${I}/boost/version.hpp" - if {[file exists $header]} { - set includeDir $I - break - } - } - if {$includeDir == ""} { - return {} - } - - set libDir "" - foreach L $libDirs { - set libraryA "${L}/libboost_date_time.a" - set librarySo "${L}/libboost_date_time.so" - if {[file exists $libraryA] || [file exists $librarySo]} { - set libDir $L - break - } - } - if {$libDir == ""} { - return {} - } - - return [list $includeDir $libDir] -} diff --git a/build/unix/install.tcl b/build/unix/install.tcl deleted file mode 100644 index e11eda5b..00000000 --- a/build/unix/install.tcl +++ /dev/null @@ -1,74 +0,0 @@ -set headerInstallPrefix "/usr/local/include/soci" -set libInstallPrefix "/usr/local/lib" -set sociVersion "3.0.0" -set sociMajor "3" - -source "execute.tcl" -source "local/parameters.tcl" - -if [info exists env(DESTDIR)] { - set DESTDIR $env(DESTDIR) - set headerInstallPrefix [file normalize ${DESTDIR}/${headerInstallPrefix}] - set libInstallPrefix [file normalize ${DESTDIR}/${libInstallPrefix}] -} - -set uninstallFile [open "local/uninstall.sh" "w"] - -if {[file exists $headerInstallPrefix] == 0} { - execute "mkdir -p $headerInstallPrefix" - puts $uninstallFile "rm -rf $headerInstallPrefix" -} - -foreach header [glob "include/*"] { - set tail [file tail $header] - puts "copying $tail to ${headerInstallPrefix}" - execute "cp $header $headerInstallPrefix" - puts $uninstallFile "rm -f ${headerInstallPrefix}/${tail}" -} - -if {[file exists $libInstallPrefix] == 0} { - execute "mkdir -p $libInstallPrefix" - puts $uninstallFile "rm -rf $libInstallPrefix" -} - -foreach lib [glob "lib/*.a"] { - set tail [file tail $lib] - puts "copying $tail to ${libInstallPrefix}" - execute "cp $lib $libInstallPrefix" - puts $uninstallFile "rm -f ${libInstallPrefix}/${tail}" -} - -set buildDir [pwd] -cd $libInstallPrefix -foreach lib [glob "${buildDir}/lib/*.so"] { - set rootName [file rootname [file tail $lib]] - set targetName "${rootName}-${sociVersion}.so" - set majorLink "${rootName}-${sociMajor}.so" - set link "${rootName}.so" - - puts "copying [file tail $lib] to ${targetName}" - execute "cp $lib $targetName" - puts $uninstallFile "rm -f ${libInstallPrefix}/${targetName}" - - puts "creating link ${majorLink}" - execute "ln -s $targetName [file tail $majorLink]" - puts $uninstallFile "rm -f ${libInstallPrefix}/${majorLink}" - - puts "creating ${link}" - execute "ln -s $targetName [file tail $link]" - puts $uninstallFile "rm -f ${libInstallPrefix}/${link}" -} - -close $uninstallFile - -puts "ldconfig ${libInstallPrefix}" -catch { eval exec "ldconfig ${libInstallPrefix}" } - -puts "" -puts "" -puts "Hint: the shared libraries were installed in $libInstallPrefix" -puts "- If you use dynamically loaded backends, then you might need to set" -puts " the SOCI_BACKENDS_PATH variable accordingly." -puts "" -puts "Hint: to remove all installed files and links run make uninstall" -puts "" diff --git a/build/unix/parse-parameters.tcl b/build/unix/parse-parameters.tcl deleted file mode 100644 index 574a6f60..00000000 --- a/build/unix/parse-parameters.tcl +++ /dev/null @@ -1,60 +0,0 @@ -set paramsFile [open "local/parameters"] -set tclParamsFile [open "local/parameters.tcl" "w"] - -set line [gets $paramsFile] -while {![eof $paramsFile]} { - set pair [split $line "="] - if {[llength $pair] == 2} { - set name [lindex $pair 0] - set value [lindex $pair 1] - - switch -exact -- $name { - --include-prefix { - puts $tclParamsFile "set headerInstallPrefix $value" - puts "setting prefix for SOCI headers to $value" - } - --lib-prefix { - puts $tclParamsFile "set libInstallPrefix $value" - puts "setting prefix for SOCI libraries to $value" - } - --mysql-include { - puts $tclParamsFile "set mysqlInclude $value" - puts "setting include directory for MySQL to $value" - } - --mysql-lib { - puts $tclParamsFile "set mysqlLib $value" - puts "setting lib directory for MySQL to $value" - } - --oracle-include { - puts $tclParamsFile "set oracleInclude $value" - puts "setting include directory for Oracle to $value" - } - --oracle-lib { - puts $tclParamsFile "set oracleLib $value" - puts "setting lib directory for Oracle to $value" - } - --postgresql-include { - puts $tclParamsFile "set postgresqlInclude $value" - puts "setting include directory for PostgreSQL to $value" - } - --postgresql-lib { - puts $tclParamsFile "set postgresqlLib $value" - puts "setting lib directory for PostgreSQL to $value" - } - --boost-include { - puts $tclParamsFile "set boostInclude $value" - puts "setting Boost include directory to $value" - } - --boost-lib { - puts $tclParamsFile "set boostLib $value" - puts "setting Boost lib directory to $value" - } - default { - puts "unknown option: $name : skipping it!" - } - } - } - set line [gets $paramsFile] -} -close $paramsFile -close $tclParamsFile diff --git a/src/cmake/CMakeLists.txt b/cmake/CMakeLists.txt similarity index 100% rename from src/cmake/CMakeLists.txt rename to cmake/CMakeLists.txt diff --git a/src/cmake/SociBackend.cmake b/cmake/SociBackend.cmake similarity index 100% rename from src/cmake/SociBackend.cmake rename to cmake/SociBackend.cmake diff --git a/src/cmake/SociConfig.cmake b/cmake/SociConfig.cmake similarity index 100% rename from src/cmake/SociConfig.cmake rename to cmake/SociConfig.cmake diff --git a/src/cmake/SociDependencies.cmake b/cmake/SociDependencies.cmake similarity index 100% rename from src/cmake/SociDependencies.cmake rename to cmake/SociDependencies.cmake diff --git a/src/cmake/SociSystemInfo.cmake b/cmake/SociSystemInfo.cmake similarity index 100% rename from src/cmake/SociSystemInfo.cmake rename to cmake/SociSystemInfo.cmake diff --git a/src/cmake/SociUtilities.cmake b/cmake/SociUtilities.cmake similarity index 100% rename from src/cmake/SociUtilities.cmake rename to cmake/SociUtilities.cmake diff --git a/src/cmake/SociVersion.cmake b/cmake/SociVersion.cmake similarity index 100% rename from src/cmake/SociVersion.cmake rename to cmake/SociVersion.cmake diff --git a/src/cmake/dependencies/Boost.cmake b/cmake/dependencies/Boost.cmake similarity index 100% rename from src/cmake/dependencies/Boost.cmake rename to cmake/dependencies/Boost.cmake diff --git a/src/cmake/dependencies/MySQL.cmake b/cmake/dependencies/MySQL.cmake similarity index 100% rename from src/cmake/dependencies/MySQL.cmake rename to cmake/dependencies/MySQL.cmake diff --git a/src/cmake/dependencies/ODBC.cmake b/cmake/dependencies/ODBC.cmake similarity index 100% rename from src/cmake/dependencies/ODBC.cmake rename to cmake/dependencies/ODBC.cmake diff --git a/src/cmake/dependencies/Oracle.cmake b/cmake/dependencies/Oracle.cmake similarity index 100% rename from src/cmake/dependencies/Oracle.cmake rename to cmake/dependencies/Oracle.cmake diff --git a/src/cmake/dependencies/PostgreSQL.cmake b/cmake/dependencies/PostgreSQL.cmake similarity index 100% rename from src/cmake/dependencies/PostgreSQL.cmake rename to cmake/dependencies/PostgreSQL.cmake diff --git a/src/cmake/dependencies/SQLite3.cmake b/cmake/dependencies/SQLite3.cmake similarity index 100% rename from src/cmake/dependencies/SQLite3.cmake rename to cmake/dependencies/SQLite3.cmake diff --git a/src/cmake/dependencies/Threads.cmake b/cmake/dependencies/Threads.cmake similarity index 100% rename from src/cmake/dependencies/Threads.cmake rename to cmake/dependencies/Threads.cmake diff --git a/src/cmake/modules/FindDL.cmake b/cmake/modules/FindDL.cmake similarity index 100% rename from src/cmake/modules/FindDL.cmake rename to cmake/modules/FindDL.cmake diff --git a/src/cmake/modules/FindMySQL.cmake b/cmake/modules/FindMySQL.cmake similarity index 100% rename from src/cmake/modules/FindMySQL.cmake rename to cmake/modules/FindMySQL.cmake diff --git a/src/cmake/modules/FindODBC.cmake b/cmake/modules/FindODBC.cmake similarity index 100% rename from src/cmake/modules/FindODBC.cmake rename to cmake/modules/FindODBC.cmake diff --git a/src/cmake/modules/FindOracle.cmake b/cmake/modules/FindOracle.cmake similarity index 100% rename from src/cmake/modules/FindOracle.cmake rename to cmake/modules/FindOracle.cmake diff --git a/src/cmake/modules/FindPostgreSQL.cmake b/cmake/modules/FindPostgreSQL.cmake similarity index 100% rename from src/cmake/modules/FindPostgreSQL.cmake rename to cmake/modules/FindPostgreSQL.cmake diff --git a/src/cmake/modules/FindSQLite3.cmake b/cmake/modules/FindSQLite3.cmake similarity index 100% rename from src/cmake/modules/FindSQLite3.cmake rename to cmake/modules/FindSQLite3.cmake diff --git a/src/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in b/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in similarity index 100% rename from src/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in rename to cmake/resources/vs2010-test-cmd-args.vcxproj.user.in diff --git a/src/core/.gitignore b/core/.gitignore similarity index 100% rename from src/core/.gitignore rename to core/.gitignore diff --git a/src/core/CMakeLists.txt b/core/CMakeLists.txt similarity index 100% rename from src/core/CMakeLists.txt rename to core/CMakeLists.txt diff --git a/src/core/Makefile.basic b/core/Makefile.basic similarity index 100% rename from src/core/Makefile.basic rename to core/Makefile.basic diff --git a/src/core/backend-loader.cpp b/core/backend-loader.cpp similarity index 100% rename from src/core/backend-loader.cpp rename to core/backend-loader.cpp diff --git a/src/core/backend-loader.h b/core/backend-loader.h similarity index 100% rename from src/core/backend-loader.h rename to core/backend-loader.h diff --git a/src/core/blob-exchange.h b/core/blob-exchange.h similarity index 100% rename from src/core/blob-exchange.h rename to core/blob-exchange.h diff --git a/src/core/blob.cpp b/core/blob.cpp similarity index 100% rename from src/core/blob.cpp rename to core/blob.cpp diff --git a/src/core/blob.h b/core/blob.h similarity index 100% rename from src/core/blob.h rename to core/blob.h diff --git a/src/core/boost-fusion.h b/core/boost-fusion.h similarity index 100% rename from src/core/boost-fusion.h rename to core/boost-fusion.h diff --git a/src/core/boost-gregorian-date.h b/core/boost-gregorian-date.h similarity index 100% rename from src/core/boost-gregorian-date.h rename to core/boost-gregorian-date.h diff --git a/src/core/boost-optional.h b/core/boost-optional.h similarity index 100% rename from src/core/boost-optional.h rename to core/boost-optional.h diff --git a/src/core/boost-tuple.h b/core/boost-tuple.h similarity index 100% rename from src/core/boost-tuple.h rename to core/boost-tuple.h diff --git a/src/core/connection-pool.cpp b/core/connection-pool.cpp similarity index 100% rename from src/core/connection-pool.cpp rename to core/connection-pool.cpp diff --git a/src/core/connection-pool.h b/core/connection-pool.h similarity index 100% rename from src/core/connection-pool.h rename to core/connection-pool.h diff --git a/src/core/error.cpp b/core/error.cpp similarity index 100% rename from src/core/error.cpp rename to core/error.cpp diff --git a/src/core/error.h b/core/error.h similarity index 100% rename from src/core/error.h rename to core/error.h diff --git a/src/core/exchange-traits.h b/core/exchange-traits.h similarity index 100% rename from src/core/exchange-traits.h rename to core/exchange-traits.h diff --git a/src/core/into-type.cpp b/core/into-type.cpp similarity index 100% rename from src/core/into-type.cpp rename to core/into-type.cpp diff --git a/src/core/into-type.h b/core/into-type.h similarity index 100% rename from src/core/into-type.h rename to core/into-type.h diff --git a/src/core/into.h b/core/into.h similarity index 100% rename from src/core/into.h rename to core/into.h diff --git a/src/core/once-temp-type.cpp b/core/once-temp-type.cpp similarity index 100% rename from src/core/once-temp-type.cpp rename to core/once-temp-type.cpp diff --git a/src/core/once-temp-type.h b/core/once-temp-type.h similarity index 100% rename from src/core/once-temp-type.h rename to core/once-temp-type.h diff --git a/src/core/prepare-temp-type.cpp b/core/prepare-temp-type.cpp similarity index 100% rename from src/core/prepare-temp-type.cpp rename to core/prepare-temp-type.cpp diff --git a/src/core/prepare-temp-type.h b/core/prepare-temp-type.h similarity index 100% rename from src/core/prepare-temp-type.h rename to core/prepare-temp-type.h diff --git a/src/core/procedure.cpp b/core/procedure.cpp similarity index 100% rename from src/core/procedure.cpp rename to core/procedure.cpp diff --git a/src/core/procedure.h b/core/procedure.h similarity index 100% rename from src/core/procedure.h rename to core/procedure.h diff --git a/src/core/ref-counted-prepare-info.cpp b/core/ref-counted-prepare-info.cpp similarity index 100% rename from src/core/ref-counted-prepare-info.cpp rename to core/ref-counted-prepare-info.cpp diff --git a/src/core/ref-counted-prepare-info.h b/core/ref-counted-prepare-info.h similarity index 100% rename from src/core/ref-counted-prepare-info.h rename to core/ref-counted-prepare-info.h diff --git a/src/core/ref-counted-statement.cpp b/core/ref-counted-statement.cpp similarity index 100% rename from src/core/ref-counted-statement.cpp rename to core/ref-counted-statement.cpp diff --git a/src/core/ref-counted-statement.h b/core/ref-counted-statement.h similarity index 100% rename from src/core/ref-counted-statement.h rename to core/ref-counted-statement.h diff --git a/src/core/row-exchange.h b/core/row-exchange.h similarity index 100% rename from src/core/row-exchange.h rename to core/row-exchange.h diff --git a/src/core/row.cpp b/core/row.cpp similarity index 100% rename from src/core/row.cpp rename to core/row.cpp diff --git a/src/core/row.h b/core/row.h similarity index 100% rename from src/core/row.h rename to core/row.h diff --git a/src/core/rowid-exchange.h b/core/rowid-exchange.h similarity index 100% rename from src/core/rowid-exchange.h rename to core/rowid-exchange.h diff --git a/src/core/rowid.cpp b/core/rowid.cpp similarity index 100% rename from src/core/rowid.cpp rename to core/rowid.cpp diff --git a/src/core/rowid.h b/core/rowid.h similarity index 100% rename from src/core/rowid.h rename to core/rowid.h diff --git a/src/core/rowset.h b/core/rowset.h similarity index 100% rename from src/core/rowset.h rename to core/rowset.h diff --git a/src/core/session.cpp b/core/session.cpp similarity index 100% rename from src/core/session.cpp rename to core/session.cpp diff --git a/src/core/session.h b/core/session.h similarity index 100% rename from src/core/session.h rename to core/session.h diff --git a/src/core/soci-backend.h b/core/soci-backend.h similarity index 100% rename from src/core/soci-backend.h rename to core/soci-backend.h diff --git a/src/core/soci-config.h b/core/soci-config.h similarity index 100% rename from src/core/soci-config.h rename to core/soci-config.h diff --git a/src/core/soci-platform.h b/core/soci-platform.h similarity index 100% rename from src/core/soci-platform.h rename to core/soci-platform.h diff --git a/src/core/soci-simple.cpp b/core/soci-simple.cpp similarity index 100% rename from src/core/soci-simple.cpp rename to core/soci-simple.cpp diff --git a/src/core/soci-simple.h b/core/soci-simple.h similarity index 100% rename from src/core/soci-simple.h rename to core/soci-simple.h diff --git a/src/core/soci.h b/core/soci.h similarity index 100% rename from src/core/soci.h rename to core/soci.h diff --git a/src/core/statement.cpp b/core/statement.cpp similarity index 100% rename from src/core/statement.cpp rename to core/statement.cpp diff --git a/src/core/statement.h b/core/statement.h similarity index 100% rename from src/core/statement.h rename to core/statement.h diff --git a/src/core/test/common-tests.h b/core/test/common-tests.h similarity index 100% rename from src/core/test/common-tests.h rename to core/test/common-tests.h diff --git a/src/core/transaction.cpp b/core/transaction.cpp similarity index 100% rename from src/core/transaction.cpp rename to core/transaction.cpp diff --git a/src/core/transaction.h b/core/transaction.h similarity index 100% rename from src/core/transaction.h rename to core/transaction.h diff --git a/src/core/type-conversion-traits.h b/core/type-conversion-traits.h similarity index 100% rename from src/core/type-conversion-traits.h rename to core/type-conversion-traits.h diff --git a/src/core/type-conversion.h b/core/type-conversion.h similarity index 100% rename from src/core/type-conversion.h rename to core/type-conversion.h diff --git a/src/core/type-holder.h b/core/type-holder.h similarity index 100% rename from src/core/type-holder.h rename to core/type-holder.h diff --git a/src/core/type-ptr.h b/core/type-ptr.h similarity index 100% rename from src/core/type-ptr.h rename to core/type-ptr.h diff --git a/src/core/unsigned-types.h b/core/unsigned-types.h similarity index 100% rename from src/core/unsigned-types.h rename to core/unsigned-types.h diff --git a/src/core/use-type.cpp b/core/use-type.cpp similarity index 100% rename from src/core/use-type.cpp rename to core/use-type.cpp diff --git a/src/core/use-type.h b/core/use-type.h similarity index 100% rename from src/core/use-type.h rename to core/use-type.h diff --git a/src/core/use.h b/core/use.h similarity index 100% rename from src/core/use.h rename to core/use.h diff --git a/src/core/values-exchange.h b/core/values-exchange.h similarity index 100% rename from src/core/values-exchange.h rename to core/values-exchange.h diff --git a/src/core/values.cpp b/core/values.cpp similarity index 100% rename from src/core/values.cpp rename to core/values.cpp diff --git a/src/core/values.h b/core/values.h similarity index 100% rename from src/core/values.h rename to core/values.h diff --git a/doc/backends.html b/doc/backends.html deleted file mode 100644 index 103c04bc..00000000 --- a/doc/backends.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - - - SOCI - backends - - - - - -

Backends reference

- -

This part of the documentation is provided for those who want to -write (and contribute!) their own backends. It is anyway recommended -that authors of new backend see the code of some existing backend for -hints on how things are really done.

- -

The backend interface is a set of base classes that the actual backends -are supposed to specialize. The main SOCI interface uses only the -interface and respecting the protocol (for example, the order of -function calls) described here. Note that both the interface and the -protocol were initially designed with the Oracle database in mind, -which means -that whereas it is quite natural with respect to the way Oracle API -(OCI) works, it might impose some implementation burden on other -backends, where things are done differently and therefore have to be -adjusted, cached, converted, etc.

- -

The interface to the common SOCI interface is defined in the core/soci-backend.h -header file. This file is dissected below.

- -

All names are defined in either soci or soci::details -namespace.

- -
-// data types, as seen by the user
-enum data_type
-{
-    dt_string, dt_date, dt_double, dt_integer, dt_unsigned_long, dt_long_long
-};
-
-// the enum type for indicator variables
-enum indicator { i_ok, i_null, i_truncated };
-
-// data types, as used to describe exchange format
-enum exchange_type
-{
-    x_char, x_cstring, x_stdstring, x_short, x_integer,
-    x_unsigned_long, x_long_long, x_double, x_stdtm, x_statement,
-    x_rowid, x_blob
-};
-
-struct cstring_descriptor
-{
-    cstring_descriptor(char * str, std::size_t bufSize)
-        : str_(str), bufSize_(bufSize) {}
-
-    char * str_;
-    std::size_t bufSize_;
-};
-
-// actually in error.h:
-class soci_error : public std::runtime_error
-{
-public:
-    soci_error(std::string const & msg);
-};
-
- -

The data_type enumeration type defines all types that -form the core type support for SOCI. The enum itself can be used by -clients when dealing with dynamic rowset description.

- -

The indicator enumeration type defines all recognized states of data. -The i_truncated -state is provided for the case where the string is retrieved from the -database into the char buffer that is not long enough to hold the whole -value.

- -

The exchange_type enumeration type defines all possible -types that can be used with the into and use -elements.

- -

The cstring_descriptor is a helper class that allows to -store the address of char buffer together with its size. -The objects of this class are passed to the backend when the x_cstring -type is involved.

- -

The soci_error class is an exception type used for -database-related (and -also usage-related) errors. The backends should throw exceptions of -this or derived type only.

- -
-class standard_into_type_backend
-{
-public:
-    virtual ~standard_into_type_backend() {}
-
-    virtual void define_by_pos(int & position,
-        void * data, exchange_type type) = 0;
-
-    virtual void pre_fetch() = 0;
-    virtual void post_fetch(bool gotData, bool calledFromFetch,
-        indicator * ind) = 0;
-
-    virtual void clean_up() = 0;
-};
-
- -

The standard_into_type_back_end class implements the dynamic -interactions with the simple (non-bulk) into elements. -The objects of this class (or, rather, of the derived class implemented -by the actual backend) are created by the statement -object when the into element is bound - in terms of -lifetime management, statement is the master of this -class.

- - -

The intended use of pre_fetch and post_fetch -functions is to manage any internal buffer and/or data conversion for -each value retrieved from the database. If the given server supports -binary data transmission and the data format for the given type agrees -with what is used on the client machine, then these two functions need -not do anything; otherwise buffer management and data conversions -should go there.

- -
-class vector_into_type_backend
-{
-public:
-    virtual ~vector_into_type_backend() {}
-
-    virtual void define_by_pos(int & position,
-        void * data, exchange_type type) = 0;
-
-    virtual void pre_fetch() = 0;
-    virtual void post_fetch(bool gotData, indicator * ind) = 0;
-
-    virtual void resize(std::size_t sz) = 0;
-    virtual std::size_t size() = 0;
-
-    virtual void clean_up() = 0;
-};
-
- -

The vector_into_type_back_end has similar structure and -purpose as the previous one, but is used for vectors (bulk data -retrieval).

- -

The data pointer points to the variable of type std::vector<T> -(and not to its internal buffer), resize -is supposed to really resize the user-provided vector and size -is supposed to return the current size of this vector. -The important difference with regard to the previous class is that ind -points (if not NULL) to the beginning of the array of indicators. The backend -should fill this array according to the actual state of the retrieved -data.

- -
-class standard_use_type_backend
-{
-public:
-    virtual ~standard_use_type_backend() {}
-
-    virtual void bind_by_pos(int & position,
-        void * data, exchange_type type, bool readOnly) = 0;
-    virtual void bind_by_name(std::string const & name,
-        void * data, exchange_type type, bool readOnly) = 0;
-
-    virtual void pre_use(indicator const * ind) = 0;
-    virtual void post_use(bool gotData, indicator * ind) = 0;
-
-    virtual void clean_up() = 0;
-};
-
- -

The standard_use_type_backend implements the interactions -with the simple (non-bulk) use elements, created and -destroyed by the statement object.

- - -

The intended use for pre_use and post_use -methods is to manage any internal buffers and/or data conversion. They -can be called many times with the same statement.

- -
-class vector_use_type_backend
-{
-public:
-    virtual ~vector_use_type_backend() {}
-
-    virtual void bind_by_pos(int & position,
-        void * data, exchange_type type) = 0;
-    virtual void bind_by_name(std::string const & name,
-        void * data, exchange_type type) = 0;
-
-    virtual void pre_use(indicator const * ind) = 0;
-
-    virtual std::size_t size() = 0;
-
-    virtual void clean_up() = 0;
-};
-
- -

Objects of this type (or rather of type derived from this one) are used -to implement interactions with user-provided vector (bulk) use -elements and are managed by the statement object. -The data pointer points to the whole vector object -provided by the user (and not to -its internal buffer); ind points to the beginning of the -array of indicators (or is NULL). The meaning of this -interface is analogous to those presented above.

- -
-class statement_backend
-{
-public:
-    virtual ~statement_backend() {}
-
-    virtual void alloc() = 0;
-    virtual void clean_up() = 0;
-
-    virtual void prepare(std::string const & query, statement_type eType) = 0;
-
-    enum exec_fetch_result { ef_success, ef_no_data };
-    virtual exec_fetch_result execute(int number) = 0;
-    virtual exec_fetch_result fetch(int number) = 0;
-
-    virtual int get_number_of_rows() = 0;
-
-    virtual std::string rewrite_for_procedure_call(std::string const & query) = 0;
-
-    virtual int prepare_for_describe() = 0;
-    virtual void describe_column(int colNum, data_type & dtype,
-        std::string & column_name) = 0;
-
-    virtual standard_into_type_backend * make_into_type_backend() = 0;
-    virtual standard_use_type_backend * make_use_type_backend() = 0;
-    virtual vector_into_type_backend * make_vector_into_type_backend() = 0;
-    virtual vector_use_type_backend * make_vector_use_type_backend() = 0;
-};
-
- -

The statement_backend type implements the internals of the -statement objects. The objects of this class are created by the session -object.

- - -

Notes:

-
    -
  1. Whether the query is executed using the simple one-time syntax or -is prepared, the alloc, prepare and execute -functions are always called, in this order.
  2. -
  3. All into and use elements are bound -(their define_by_pos or bind_by_pos/bind_by_name -functions are called) between -statement preparation and execution. -
  4. -
- -
-class rowid_backend
-{
-public:
-    virtual ~rowid_backend() {}
-};
-
- -

The rowid_backend class is a hook for the backends to -provide their own state for the row identifier. It has no functions, -since the only portable interaction with the row identifier object is -to use it with into and use elements.

- -
-class blob_backend
-{
-public:
-    virtual ~blob_backend() {}
-
-    virtual std::size_t get_len() = 0;
-    virtual std::size_t read(std::size_t offset, char * buf,
-        std::size_t toRead) = 0;
-    virtual std::size_t write(std::size_t offset, char const * buf,
-        std::size_t toWrite) = 0;
-    virtual std::size_t append(char const * buf, std::size_t toWrite) = 0;
-    virtual void trim(std::size_t newLen) = 0;
-};
-
- -

The blob_backend interface provides the entry points for -the blob methods.

- -
-class session_backend
-{
-public:
-    virtual ~session_backend() {}
-
-    virtual void begin() = 0;
-    virtual void commit() = 0;
-    virtual void rollback() = 0;
-
-    virtual std::string get_backend_name() const = 0;
-
-    virtual statement_backend * make_statement_backend() = 0;
-    virtual rowid_backend * make_rowid_backend() = 0;
-    virtual blob_backend * make_blob_backend() = 0;
-};
-
- -

The object of the class derived from session_backend implements the -internals of the session object.

- - -
-struct backend_factory
-{
-    virtual ~backend_factory() {}
-
-    virtual details::session_backend * make_session(
-        std::string const & connectString) const = 0;
-};
-
- -

The backend_factory is a base class for backend-provided -factory class that is able to create valid sessions. The connectString -parameter passed to make_session is provided here by the session -constructor and contains only the backend-related parameters, without the backend name -(if the dynamic backend loading is used).

- -

The actual backend factory object is supposed to be provided by the -backend implementation and declared in its header file. In addition to this, -the factory_ABC function with the "C" calling convention -and returning the pointer to concrete factory object should be provided, -where ABC is the backend name.

- -

The following example is taken from soci-postgresql.h, -which declares entities of the PostgreSQL backend:

- -
-struct postgresql_backend_factory : backend_factory
-{
-    virtual postgresql_session_backend * make_session(
-        std::string const & connectString) const;
-};
-
-extern postgresql_backend_factory const postgresql;
-
-extern "C"
-{
-
-// for dynamic backend loading
-backend_factory const * factory_postgresql();
-
-} // extern "C"
-
- -

With the above declarations, it is enough to pass the postgresql -factory name to the constructor of the session object, -which will use this factory to create concrete implementations for any -other objects that -are needed, with the help of appropriate make_XYZ -functions. Alternatively, the factory_postgresql function will -be called automatically by the backend loader if the backend name is provided -at run-time instead.

- -

Note that the backend source code is placed in the backends/name directory (for example, -backends/oracle) and the test driver is in backends/name/test. There is also backends/empty -directory provided as a skeleton for development of new backends and -their tests. It is -recommended that all backends respect naming conventions by just -appending their name to the base-class names. The backend name used for -the global factory object should clearly identify the given -database engine, like oracle, postgresql, mysql, -and so on.

- - - - - - - - - - - diff --git a/doc/backends/firebird.html b/doc/backends/firebird.html deleted file mode 100644 index c1deafb2..00000000 --- a/doc/backends/firebird.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - SOCI - Firebird Backend Reference - - - - - -

Firebird Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI Firebird backend is currently supported for use with Firebird 1.5.
-Other versions of Firebird may work as well, but they have not been tested by the SOCI team.

- -

Tested Platforms

- - - - - - - - -
Firebird versionOperating SystemCompiler
1.5.2.4731SunOS 5.10g++ 3.4.3
1.5.2.4731Windows XPVisual C++ 8.0
1.5.3.4870Windows XPVisual C++ 8.0 Professional
- -

Required Client Libraries

- -

The Firebird backend requires Firebird's libfbclient client library.

- -

Connecting to the Database

- -

To establish a connection to a Firebird database, create a Session object -using the firebird backend factory together with a connection string:

- -
-BackEndFactory const &backEnd = firebird;
-Session sql(backEnd, 
-        "service=/usr/local/firbird/db/test.fdb user=SYSDBA password=masterkey");
-
- -

or simply:

- -
-Session sql(firebird, 
-        "service=/usr/local/firbird/db/test.fdb user=SYSDBA password=masterkey");
-
- -

The set of parameters used in the connection string for Firebird is:

- -

The following parameters have to be provided as part of the connection string : -service, user, password. Role and charset parameters are optional.

- -

Once you have created a Session object as shown above, you can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from user_tables", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the Session class.)

- -

SOCI Feature Support

-

Dynamic Binding

- -

The Firebird backend supports the use of the SOCI Row class, which facilitates retrieval of data whose type is not known at compile time.

- -

When calling Row::get<T>(), the type you should pass as T depends upon the underlying database type. For the Firebird backend, this type mapping is:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Firebird Data TypeSOCI Data TypeRow::get<T> specializations
numeric, decimal
(where scale > 0)
eDoubledouble
numeric, decimal [1]
(where scale = 0)
eInteger, eDoubleint, double
double precision, floateDoubledouble
smallint, integereIntegerint
char, varchareStringstd::string
date, time, timestampeDatestd::tm
-

 [1]  There is also 64bit integer type for larger values which is -currently not supported.

-

(See the dynamic resultset binding documentation for general information on using the Row class.)

- -

Binding by Name

- -

In addition to binding by position, the Firebird backend supports binding by name, via an overload of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

It should be noted that parameter binding by name is supported only by means of emulation, since the underlying API used by the backend doesn't provide this feature.

- -

Bulk Operations

- -

The Firebird backend has full support for SOCI's bulk operations interface. This feature is also supported by emulation.

- -

Transactions

- -

Transactions are also fully -supported by the Firebird backend. In fact, there is always a transaction which is automatically commited in Session's destructor. -
See the Configuration options section for more details.

- -

BLOB Data Type

- -

The Firebird backend supports working with data stored in columns of type Blob, via SOCI's BLOB class.

-

It should by noted, that entire Blob data is fetched from database to allow random read and write access. -This is because Firebird itself allows only writing to a new Blob or reading from existing one - -modifications of existing Blob means creating a new one. Firebird backend hides those details from user.

- -

RowID Data Type

- -

This feature is not supported by Firebird backend.

- -

Nested Statements

- -

This feature is not supported by Firebird backend.

- -

Stored Procedures

- -

Firebird stored procedures can be executed by using SOCI's Procedure class.

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several getBackEnd() functions, as described in the beyond SOCI documentation.

- -

The Firebird backend provides the following concrete classes for navite API access:

- - - - - - - - - - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
SessionBackEnd* Session::getBackEnd()FirebirdSessionBackEnd
StatementBackEnd* Statement::getBackEnd()FirebirdStatementBackEnd
BLOBBackEnd* BLOB::getBackEnd()FirebirdBLOBBackEnd
RowIDBackEnd* RowID::getBackEnd()FirebirdRowIDBackEnd
- - -

Backend-specific extensions

-

FirebirdSOCIError

- -

The Firebird backend can throw instances of class FirebirdSOCIError, -which is publicly derived from SOCIError and has an -additional public status_ member containing the Firebird status vector.

- -

Configuration options

- -

The Firebird backend recognize the following configuration macros :

- - - - - diff --git a/doc/backends/index.html b/doc/backends/index.html deleted file mode 100644 index e63b7534..00000000 --- a/doc/backends/index.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - SOCI - Existing Backends - - - - - -

Existing backends and supported platforms

- -

Supported Features

- -

(Follow the links to learn more about each backend.)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OraclePostgreSQLMySQLSQLite3FirebirdODBC
Binding by NameYESYES (>=8.0)YESYESYESYES
Dynamic BindingYESYESYESYESYESYES
Bulk OperationsYESYESYESYESYESYES
TransactionsYESYESYES - (with servers that support them, usually >= 4.0)YESYESYES
BLOB Data TypeYESYESNOYESYESNO
RowID Data TypeYESYESNONONONO
Nested StatementsYESNONONONONO
Stored ProceduresYESYESNO (but stored functions, YES)NOYESNO
- - - - - - - - - - diff --git a/doc/backends/mysql.html b/doc/backends/mysql.html deleted file mode 100644 index 2f0bd82c..00000000 --- a/doc/backends/mysql.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - SOCI - MySQL Backend Reference - - - - - -

MySQL Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI MySQL backend should in principle work with every version -of MySQL 3.x or newer. Some of the features (transactions, stored -functions) are not available when MySQL server doesn't support them.

- -

Tested Platforms

- - - - - - -
MySQL versionOperating SystemCompiler
5.0.45Linux i686 2.6.23 (Fedora release 7)g++ 4.1.2
- -

Required Client Libraries

- -

The SOCI MySQL backend requires MySQL's libmysqlclient -client library.

-

Note that the SOCI library itself depends also on libdl, so the minimum set of libraries needed to compile a basic client program is:

-
--lsoci_core -lsoci_mysql -ldl -lmysqlclient
-
- - -

Connecting to the Database

- -

To establish a connection to a MySQL server, create a session object -using the mysql backend factory together with a connection -string:

- -
-session sql(mysql, "db=test user=root password='Ala ma kota'");
-
-// or:
-session sql("mysql", "db=test user=root password='Ala ma kota'");
-
-// or:
-session sql("mysql://db=test user=root password='Ala ma kota'");
-
- -

The set of parameters used in the connection string for MySQL is:

- - -

Once you have created a session object as shown above, you -can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from invoices", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the session class.)

- -

SOCI Feature Support

-

Dynamic Binding

- -

The MySQL backend supports the use of the SOCI row class, -which facilitates retrieval of data which type is not known at compile -time.

- -

When calling row::get<T>(), the type you should pass -as T depends upon the underlying database type.
-For the MySQL backend, this type mapping is:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MySQL Data TypeSOCI Data Typerow::get<T> specializations
FLOAT, DOUBLE, DECIMAL and synonymsdt_doubledouble
TINYINT, SMALLINT, INT, BIGINT (provided it's in the range)dt_integerint
STRING/BINARY, VARCHAR/VARBINARYdt_stringstd::string
TIMESTAMP (works only with MySQL >= 5.0), DATE, - TIME, DATETIMEdt_datestd::tm
- -

(See the dynamic resultset binding documentation for general information on using the Row class.)

- -

Binding by Name

- -

In addition to binding by -position, the MySQL backend supports -binding by name, via an overload -of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

It should be noted that parameter binding of any kind is supported -only by means of emulation, since the underlying API used by the backend -doesn't provide this feature.

- -

Bulk Operations

- -

The MySQL backend has full support for SOCI's bulk operations interface. This feature is also supported -by emulation.

- -

Transactions

- -

Transactions are also -supported by the MySQL backend. Please note, however, that transactions -can only be used when the MySQL server supports them (it depends on -options used during the compilation of the server; typically, but not -always, servers >=4.0 support transactions and earlier versions do not) -and only with appropriate table types. -

- -

BLOB Data Type

- -

SOCI blob interface is not supported by the MySQL backend.

- -

RowID Data Type

- -

The rowid functionality is not supported by the MySQL backend.

- -

Nested Statements

- -

Nested statements are not supported by the MySQL backend.

- -

Stored Procedures

- -

MySQL version 5.0 and later supports two kinds of -stored routines: stored procedures and stored functions -(for details, please consult the -MySQL -documentation). Stored functions can be executed by using -SOCI's procedure class. -There is currently no support for stored procedures.

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several get_backend() functions, as described in the Beyond SOCI documentation.

- -

The MySQL backend provides the following concrete classes for native API access:

- - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
session_backend * session::get_backend()mysql_session_backend
statement_backend * statement::get_backend()mysql_statement_backend
- - -

Backend-specific extensions

- -

None.

- -

Configuration options

- -

None.

- - - - diff --git a/doc/backends/odbc.html b/doc/backends/odbc.html deleted file mode 100644 index 6f63ed39..00000000 --- a/doc/backends/odbc.html +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - SOCI - ODBC Backend Reference - - - - - -

ODBC Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI ODBC backend is supported for use with ODBC 3.

- -

Tested Platforms

- - - - - - - - -
ODBC versionOperating SystemCompiler
3Windows XPVisual Studio 2005 (express)
3Windows XPVisual C++ 8.0 Professional
3Windows XP(cygwin) g++ 3.3.4
- -

Required Client Libraries

- -

The SOCI ODBC backend requires the ODBC client library.

- -

Connecting to the Database

- -

To establish a connection to the ODBC database, create a Session object -using the ODBC backend factory together with a connection string:

- -
-BackEndFactory const &backEnd = odbc;
-Session sql(backEnd, "filedsn=c:\\my.dsn");
-
- -

or simply:

- -
-Session sql(odbc, "filedsn=c:\\my.dsn");
-
- -

The set of parameters used in the connection string for ODBC is the same as accepted by the SQLDriverConnect function from the ODBC library.

- -

Once you have created a Session object as shown above, you can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from invoices", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the Session class.)

- -

SOCI Feature Support

-

Dynamic Binding

- -

The ODBC backend supports the use of the SOCI Row class, which facilitates retrieval of data whose type is not known at compile time.

- -

When calling Row::get<T>(), the type you should pass as T depends upon the underlying database type.
For the ODBC backend, this type mapping is:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ODBC Data TypeSOCI Data TypeRow::get<T> specializations
SQL_DOUBLE - , SQL_DECIMAL - , SQL_REAL - , SQL_FLOAT - , SQL_NUMERIC - eDoubledouble
SQL_TINYINT - , SQL_SMALLINT - , SQL_INTEGER - , SQL_BIGINTeIntegerint
SQL_CHAR, SQL_VARCHAReStringstd::string
SQL_TYPE_DATE - , SQL_TYPE_TIME - , SQL_TYPE_TIMESTAMPeDatestd::tm
- -

Not all ODBC drivers support all datatypes

- -

(See the dynamic resultset binding documentation for general information on using the Row class.)

- -

Binding by Name

- -

In addition to binding by position, the ODBC backend supports binding by name, via an overload of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

Apart from the portable "colon-name" syntax above, which is achieved by rewriting the query string, the backend also supports the ODBC ? syntax:

- -
-int i = 7;
-int j = 8;
-sql << "insert into t(x, y) values(?, ?)", use(i), use(j);
-
- -

Bulk Operations

- -

The ODBC backend has support for SOCI's bulk operations interface. Not all ODBC drivers support bulk operations, the following is a list of some tested backends:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ODBC DriverBulk ReadBulk Insert
MS SQL Server 2005YESYES
MS Access 2003YESNO
PostgresQL 8.1YESYES
MySQL 4.1NONO
- -

Transactions

- -

Transactions are also fully supported by the ODBC backend, provided that they are supported by the underlying database.

- -

BLOB Data Type

- -

Not currently supported

- -

RowID Data Type

- -

Not currently supported

- -

Nested Statements

- -

Not currently supported

- -

Stored Procedures

- -

Not currently supported

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several getBackEnd() functions, as described in the beyond SOCI documentation.

- -

The ODBC backend provides the following concrete classes for navite API access:

- - - - - - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
SessionBackEnd* Session::getBackEnd()ODBCSessionBackEnd
StatementBackEnd* Statement::getBackEnd()ODBCStatementBackEnd
RowIDBackEnd* RowID::getBackEnd()ODBCRowIDBackEnd
- - -

Backend-specific extensions

-

ODBCSOCIError

- -

The ODBC backend can throw instances of class ODBCSOCIError, -which is publicly derived from SOCIError and has -additional public members containing the ODBC error code, the Native database error code, and the message returned from ODBC:

- -
-int main()
-{
-    try
-    {
-        // regular code
-    }
-    catch (SOCI::ODBCSOCIError const & e)
-    {
-        cerr << "ODBC Error Code: " << e.odbcErrorCode() << endl
-             << "Native Error Code: " << e.nativeErrorCode() << endl
-             << "SOCI Message: " << e.what() << std::endl
-             << "ODBC Message: " << e.odbcErrorMessage() << endl;
-    }
-   catch (exception const &e)
-    {
-        cerr << "Some other error: " << e.what() << endl;
-    }
-}
-
-

Configuration options

- -

None

- - - - diff --git a/doc/backends/oracle.html b/doc/backends/oracle.html deleted file mode 100644 index faa46110..00000000 --- a/doc/backends/oracle.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - SOCI - Oracle Backend Reference - - - - - -

Oracle Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI Oracle backend is currently supported for use with Oracle 10 or later.
-Older versions of Oracle may work as well, but they have not been tested by the SOCI team.

- -

Tested Platforms

- - - - - - -
Oracle versionOperating SystemCompiler
10.2.0 (XE)Linux i686 2.6.9 (RedHat family)g++ 3.4.6
- -

Required Client Libraries

- -

The SOCI Oracle backend requires Oracle's libclntsh client library. -Depending on the particular system, the libnnz10 library might be needed as well.

-

Note that the SOCI library itself depends also on libdl, so the minimum set of libraries needed to compile a basic client program is:

-
--lsoci_core -lsoci_oracle -ldl -lclntsh -lnnz10
-
- -

Connecting to the Database

- -

To establish a connection to an Oracle database, create a session object -using the oracle backend factory together with a connection string:

- -
-session sql(oracle, "service=orcl user=scott password=tiger");
-
-// or:
-session sql("oracle", "service=orcl user=scott password=tiger");
-
-// or:
-session sql("oracle://service=orcl user=scott password=tiger");
-
- -

The set of parameters used in the connection string for Oracle is:

- -

The first 3 of these parameters have to be provided as part of the connection string.

-

The mode parameter allows to specify the connection mode and can be any of:

- - -

Once you have created a session object as shown above, you can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from user_tables", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the session class.)

- -

SOCI Feature Support

- -

Dynamic Binding

- -

The Oracle backend supports the use of the SOCI row class, which facilitates retrieval of data which type is not known at compile time.

- -

When calling row::get<T>(), the type you should pass as T depends upon the underlying database type.
For the Oracle backend, this type mapping is:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Oracle Data TypeSOCI Data Typerow::get<T> specializations
number (where scale > 0)dt_doubledouble
number
(where scale = 0 and precision < std::numeric_limits<int>::digits10)
dt_integerint
numberdt_long_longlong long
char, varchar, varchar2dt_stringstd::string
datedt_datestd::tm
- -

(See the dynamic resultset binding documentation for general information on using the row class.)

- -

Binding by Name

- -

In addition to binding by position, the Oracle backend supports binding by name, via an overload of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

SOCI's use of ':' to indicate a value to be bound within a SQL string is consistant with the underlying Oracle client library syntax.

- -

Bulk Operations

- -

The Oracle backend has full support for SOCI's bulk operations interface.

- -

Transactions

- -

Transactions are also fully supported by the Oracle backend, -although transactions with non-default isolation levels have to be managed by explicit SQL statements.

- -

blob Data Type

- -

The Oracle backend supports working with data stored in columns of type Blob, via SOCI's blob class.

- -

rowid Data Type

- -

Oracle rowid's are accessible via SOCI's rowid class.

- -

Nested Statements

- -

The Oracle backend supports selecting into objects of type statement, so that you may work with nested sql statements and PL/SQL cursors:

- -
-statement stInner(sql);
-statement stOuter = (sql.prepare <<
-    "select cursor(select name from person order by id)"
-    " from person where id = 1",
-    into(stInner));
-stInner.exchange(into(name));
-stOuter.execute();
-stOuter.fetch();
-
-while (stInner.fetch())
-{
-    std::cout << name << '\n';
-}
-
- -

Stored Procedures

- -

Oracle stored procedures can be executed by using SOCI's procedure class.

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several get_backend() functions, as described in the Beyond SOCI documentation.

- -

The Oracle backend provides the following concrete classes for navite API access:

- - - - - - - - - - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
session_backend * session::get_backend()oracle_session_backend
statement_backend * statement::get_backend()oracle_statement_backend
blob_backend * blob::get_backend()oracle_blob_backend
rowid_backend * rowid::get_backend()oracle_rowid_backend
- - -

Backend-specific extensions

-

eracle=soci_error

- -

The Oracle backend can throw instances of class oracle_soci_error, -which is publicly derived from soci_error and has an -additional public err_num_ member containing the Oracle error code:

- -
-int main()
-{
-    try
-    {
-        // regular code
-    }
-    catch (oracle_soci_error const & e)
-    {
-        cerr << "Oracle error: " << e.err_num_
-            << " " << e.what() << endl;
-    }
-    catch (exception const &e)
-    {
-        cerr << "Some other error: " << e.what() << endl;
-    }
-}
-
- - - - diff --git a/doc/backends/postgresql.html b/doc/backends/postgresql.html deleted file mode 100644 index f30123a2..00000000 --- a/doc/backends/postgresql.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - SOCI - PostgreSQL Backend Reference - - - - - -

PostgreSQL Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI PostgreSQL backend is supported for use with PostgreSQL >= 7.3, although versions older than 8.0 will suffer from limited feature support. See below for details.

- -

Tested Platforms

- - - - - - - - - - -
PostgreSQL versionOperating SystemCompiler
8.3Mac OS X 10.5.3g++ 4.0.1
8.3Mac OS X 10.5.3g++ 4.4.0
8.3FreeBSD 7.0g++ 4.2.1
8.3Linux i686 2.6.9 (RedHat family)g++ 3.4.6
8.2.7Linux i686 2.6.23 (Fedora release 7)g++ 4.1.2
- -

Required Client Libraries

- -

The SOCI PostgreSQL backend requires PostgreSQL's libpq client library.

-

Note that the SOCI library itself depends also on libdl, so the minimum set of libraries needed to compile a basic client program is:

-
--lsoci_core -lsoci_postgresql -ldl -lpq
-
- -

Connecting to the Database

- -

To establish a connection to the PostgreSQL database, create a session object -using the postgresql backend factory together with a connection string:

- -
-session sql(postgresql, "dbname=mydatabase");
-
-// or:
-session sql("postgresql", "dbname=mydatabase");
-
-// or:
-session sql("postgresql://dbname=mydatabase");
-
- -

The set of parameters used in the connection string for PostgreSQL is the same as accepted by the PQconnectdb function from the libpq library.

- -

Once you have created a session object as shown above, you can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from invoices", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the session class.)

- -

SOCI Feature Support

- -

Dynamic Binding

- -

The PostgreSQL backend supports the use of the SOCI row class, which facilitates retrieval of data whose type is not known at compile time.

- -

When calling row::get<T>(), the type you should pass as T depends upon the underlying database type.
For the PostgreSQL backend, this type mapping is:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PostgreSQL Data TypeSOCI Data Typerow::get<T> specializations
numeric, real, doubledt_doubledouble
boolean, smallint, integerdt_integerint
int8dt_long_longlong long
oiddt_unsigned_longunsigned long
char, varchar, text, cstring, bpchardt_stringstd::string
abstime, reltime, date, time, timestamp, timestamptz, timetzdt_datestd::tm
- -

(See the dynamic resultset binding documentation for general information on using the row class.)

- -

Binding by Name

- -

In addition to binding by position, the PostgreSQL backend supports binding by name, via an overload of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

Apart from the portable "colon-name" syntax above, which is achieved by rewriting the query string, the backend also supports the PostgreSQL native numbered syntax:

- -
-int i = 7;
-int j = 8;
-sql << "insert into t(x, y) values($1, $2)", use(i), use(j);
-
- -

The use of native syntax is not recommended, but can be nevertheless imposed by switching off the query rewriting. This can be achieved by defining the macro SOCI_PGSQL_NOBINDBYNAME and it is actually necessary for PostgreSQL 7.3, in which case binding of use elements is not supported at all. See the Configuration options section for details.

- -

Bulk Operations

- -

The PostgreSQL backend has full support for SOCI's bulk operations interface.

- -

Transactions

- -

Transactions are also fully supported by the PostgreSQL backend.

- -

blob Data Type

- -

The PostgreSQL backend supports working with data stored in columns of type Blob, via SOCI's blob class with the exception that trimming is not supported.

- -

rowid Data Type

- -

The concept of row identifier (OID in PostgreSQL) is supported via SOCI's rowid class.

- -

Nested Statements

- -

Nested statements are not supported by PostgreSQL backend.

- -

Stored Procedures

- -

PostgreSQL stored procedures can be executed by using SOCI's procedure class.

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several get_backend() functions, as described in the beyond SOCI documentation.

- -

The PostgreSQL backend provides the following concrete classes for navite API access:

- - - - - - - - - - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
session_backend * session::get_backend()postgresql_session_backend
statement_backend * statement::get_backend()postgresql_statement_backend
blob_backend * blob::get_backend()postgresql_blob_backend
rowid_backend * rowid::get_backend()postgresql_rowid_backend
- - -

Backend-specific extensions

- -

None.

- -

Configuration options

- -

To support older PostgreSQL versions, the following configuration macros are recognized:

- - - - - - diff --git a/doc/backends/sqlite3.html b/doc/backends/sqlite3.html deleted file mode 100644 index 88b753cc..00000000 --- a/doc/backends/sqlite3.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - SOCI - SQLite3 Backend Reference - - - - - -

SQLite3 Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI SQLite3 backend is supported for use with SQLite3 >= 3.1

- -

Tested Platforms

- - - - - - - - - - - - - - -
SQLite3 versionOperating SystemCompiler
3.5.2Mac OS X 10.5g++ 4.0.1
3.1.3Mac OS X 10.4g++ 4.0.1
3.2.1Linux i686 2.6.10-gentoo-r6g++ 3.4.5
3.3.4Ubuntu 5.1g++ 4.0.2
3.3.4Windows XP(cygwin) g++ 3.3.4
3.3.4Windows XPVisual C++ 2005 Express Edition
3.3.8Windows XPVisual C++ 2005 Professional
3.4.0Windows XP(cygwin) g++ 3.4.4
3.4.0Windows XPVisual C++ 2005 Express Edition
- -

Required Client Libraries

- -

The SOCI SQLite3 backend requires SQLite3's libsqlite3 client library.

- -

Connecting to the Database

- -

To establish a connection to the SQLite3 database, create a Session object -using the SQLite3 backend factory together with the database file name:

- -
-session sql(sqlite3, "database_filename");
-
- -

The only option for the connection string is the name of the file to use as a database.

- -

Once you have created a Session object as shown above, you can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from invoices", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the Session class.)

- -

SOCI Feature Support

-

Dynamic Binding

- -

The SQLite3 backend supports the use of the SOCI Row class, which facilitates retrieval of data whose type is not known at compile time.

- -

When calling Row::get<T>(), the type you should pass as T depends upon the underlying database type.

- -

For the SQLite3 backend, this type mapping is complicated by the fact the SQLite3 does not enforce types *, and makes no attempt to validate the type names used in table creation or alteration statements. SQLite3 will return the type as a string, SOCI will recognize the following strings and match them the corresponding SOCI types:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SQLite3 Data TypeSOCI Data TypeRow::get<T> specializations
*float*eDoubledouble
*int*eIntegerint
*char*eStringstd::string
*date*, *time*eDatestd::tm
- -

* There is one case where SQLite3 enforces type. If a column is declared as "integer primary key", then SQLite3 uses that as an alias to the internal ROWID column that exists for every table. Only integers are allowed in this column.

- -

(See the dynamic resultset binding documentation for general information on using the Row class.)

- -

Binding by Name

- -

In addition to binding by position, the SQLite3 backend supports binding by name, via an overload of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

The backend also supports the SQLite3 native numbered syntax, "one or more literals can be replace by a parameter "?" or ":AAA" or "@AAA" or "$VVV" where AAA is an alphanumeric identifier and VVV is a variable name according to the syntax rules of the TCL programming language." [1]:

- -
-int i = 7;
-int j = 8;
-sql << "insert into t(x, y) values(?, ?)", use(i), use(j);
-
- -

Bulk Operations

- -

The SQLite3 backend has full support for SOCI's bulk operations interface. However, this support is emulated and is not native.

- -

Transactions

- -

Transactions are also fully supported by the SQLite3 backend.

- -

BLOB Data Type

- -

The SQLite3 backend supports working with data stored in columns of type Blob, via SOCI's blob class. Because of SQLite3 general typelessness the column does not have to be declared any particular type.

-

RowID Data Type

- -

In SQLite3 RowID is an integer. "Each entry in an SQLite table has a unique integer key called the "rowid". The rowid is always available as an undeclared column named ROWID, OID, or _ROWID_. If the table has a column of type INTEGER PRIMARY KEY then that column is another an alias for the rowid."[2]

- -

Nested Statements

- -

Nested statements are not supported by SQLite3 backend.

- -

Stored Procedures

- -

Stored procedures are not supported by SQLite3 backend

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several getBackEnd() functions, as described in the beyond SOCI documentation.

- -

The SQLite3 backend provides the following concrete classes for navite API access:

- - - - - - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
SessionBackEnd* Session::getBackEnd()SQLite3SessionBackEnd
StatementBackEnd* Statement::getBackEnd()SQLite3StatementBackEnd
RowIDBackEnd* RowID::getBackEnd()SQLite3RowIDBackEnd
- - -

Backend-specific extensions

- -

None.

- -

Configuration options

- -

None

- - - - diff --git a/doc/basics.html b/doc/basics.html deleted file mode 100644 index 70d002ff..00000000 --- a/doc/basics.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - SOCI - basics - - - - - -

Connections and simple queries

- -

Connecting to the database

- -

The session class encapsulates the database connection -and other backend-related details, which are common to all the -statements -that will be later executed. It has a couple of overloaded constructors.

- -

The most basic one expects two parameters: -the requested backend factory object and the generic connection string, -which meaning is backend-dependent.

-

Example:

- -
-session sql(oracle, "service=orcl user=scott password=tiger");
-
- -

Another example might be:

- -
-session sql(postgresql, "dbname=mydb");
-
- -

Above, the sql object is a local (automatic) object -that encapsulates the connection.

- -

This session constructor either connects successfully, or -throws an exception.

- -

Another constructor allows to name backends at run-time and supports -the dynamically loadable backends, which have to be compiled as shared libraries. The usage is similar to the above, but instead of providing the factory object, the backend name is expected:

- -
-session sql("postgresql", "dbname=mydb");
-
- -

For convenience, the URL-like form that combines both the backend name with connection parameters is supported as well:

- -
-session sql("postgresql://dbname=mydb");
-
- -

The last two constructors described above try to locate the shared library with the name libsoci_ABC.so (or libsoci_ABC.dll on Windows), where ABC is the backend name. In the above examples, the expected library name will be libsoci_postgresql.so for Unix-like systems.

- -
-

Environment configuration:

-

The SOCI_BACKENDS_PATH environment variable defines the set of paths where the shared libraries will be searched for. There can be many paths, separated by colons, and they are used from left to right until the library with the appropriate name is found. If this variable is not set or is empty, the current directory is used as a default path for dynamically loaded backends.

-
- -

An alternative way to set up the session is to create it in the disconnected state and connect later:

- -
-session sql;
-
-// some time later:
-sql.open(postgresql, "dbname=mydb");
-
-// or:
-sql.open("postgresql://dbname=mydb");
-
- -

The rules for backend naming are the same as with the constructors described above.

-

The session can be also explicitly closed and reconnected, which can help with basic session error recovery. The reconnect function has no parameters and attempts to use the same values as those provided with earlier constructor or open calls.

- -

See also the page devoted to multithreading for a detailed description of connection pools.

- -

It is possible to have many active sessions at the same -time, even using different backends.

- -
-

Portability note:

-

The following backend factories are currently (as of 3.0.0 release) available:

- -

The following backends are also available, with various levels of completeness:

- -
- -

Simple SQL statements

- -

In many cases, the SQL query is intended to be executed only once, -which means that statement parsing and execution can go together. -The session class provides a special once -member, which triggers parsing and execution of such one-time -statements:

- -
-sql.once << "drop table persons";
-
- -

For shorter syntax, the following form is also allowed:

- -
-sql << "drop table persons";
-
- -

The IOStream-like interface is exactly what it looks like, so that -the -statement text can be composed of many parts, involving anything that -is streamable (including custom classes, if they have -appropriate operator<<):

- -
-string tableName = "persons";
-sql << "drop table " << tableName;
-
-int id = 123;
-sql << "delete from companies where id = " << id;
-
- - - - - - - - - - - diff --git a/doc/beyond.html b/doc/beyond.html deleted file mode 100644 index 3647c5d7..00000000 --- a/doc/beyond.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - SOCI - beyond - - - - - -

Beyond SOCI

- -

As the original name of the library (Simple Oracle Call Interface) -clearly stated, SOCI is intended to be a simple library, targetting the -majority of needs in regular C++ application. We do not claim that -everything can be done with SOCI and it was never the intent of the -library. What is important, though, is that the simplicity of the -library does not prevent the -client applications from reaching into the low-level specifics of each -database backend in order to achieve special configuration or -performance goals.

- -

Most of the SOCI classes have the getBackEnd method, -which -returns the pointer to the actual backend object that implements the -given functionality. The knowledge of the actual backend allows the -client application to get access to all low-level details that are -involved.

- -
-blob b(sql);
-
-oracle_session_back_end * sessionBackEnd = static_cast<oracle_session_back_end *>(sql.get_back_end());
-oracle_blob_back_end * blobBackEnd = static_cast<oracle_blob_back_end *>(b.get_back_end());
-
-OCILobDisableBuffering(sessionBackEnd->svchp_, sessionBackEnd->errhp_, blobBackEnd->lobp_);
-
- -

The above code creates the blob object and uses two calls -to the get_back_end function (on both the session -and the blob objects) to get access to the actual backend -objects. Assuming that it is the "oracle" backend which -is in use, the downcasts allow to access all relevant low-level handles -and use them in the call -to the OCILobDisableBuffering function. This way, the -BLOB handle was configured in a way that the SOCI library alone would -not allow.

- -
-rowid rid(sql); // sql is a session object
-sql << "select oid from mytable where id = 7", into(rid);
-
-postgresql_rowid_back_end * rbe = static_cast<postgresql_rowid_back_end *>(rid.get_back_end());
-
-unsigned long oid = rbe->value_;
-
- -

The above example retrieves the rowid ("something" that -identifies the -row in the table) from the table and uses the get_back_end -function to -extract the actual object that implements this functionality. Assuming -that it is the "postgresql" backend which is in use, the -downcast is -performed to use the postgresql_rowid_back_end interface to -get the actual -OID value that is a physical, low-level implementation of row -identifier on PostgreSQL databases.

- -

In order for any of the above to compile, you have to explicitly #include -the appropriate backend's header file.

- -

Please see the header file related to the given backend to learn what -low-level handles and descriptors are available.

- - - - - - - - - - - diff --git a/doc/boost.html b/doc/boost.html deleted file mode 100644 index dc441e8b..00000000 --- a/doc/boost.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - SOCI - integration with Boost - - - - - -

Integration with Boost

- -

The SOCI user code can be easily integrated with the Boost library thanks to the very flexible type conversion facility. There are three important Boost types that are supported out of the box.

- -

boost::optional<T>

- -

boost::optional<T> provides an alternative way to support the null data condition and as such relieves the user from necessity to handle separate indicator values.

-

The boost::optional<T> objects can be used everywhere where the regular user provided -values are expected.

-

Example:

- -
-boost::optional<string> name;
-sql << "select name from person where id = 7", into(name);
-
-if (name.is_initialized())
-{
-    // OK, the name was retrieved and is not-null
-    cout << "The name is " << name.get();
-}
-else
-{
-    // the name is null
-}
-
- -

The boost::optional<T> objects are fully supported for both into and use elements, in both single and vector forms. They can be also used for user-defined data types.

- -

boost::tuple<T1, ...>

- -

boost::tuple<T1, ...> allows to work with whole rows of information and in some cases can be more convenient to use than the more dynamically-oriented row type.

-

Example:

- -
-boost::tuple<string, string, int> person;
-
-sql << "select name, phone, salary from persons where ...",
-    into(person);
-
- -

Tuples are supported for both into and use elements. They can be used with rowset as well.

- -

Tuples can be also composed with boost::optional<T>:

- -
-boost::tuple<string, boost::optional<string>, int> person;
-
-sql << "select name, phone, salary from persons where ...",
-    into(person);
-
-if (person.get<1>().is_initialized())
-{
-    // the given person has a phone number
-}
-else
-{
-    // this person does not have a phone number
-}
-
- -

boost::fusion::vector<T1, ...>

- -

The boost::fusion::vector types are supported in the same way as tuples.

- -

boost::gregorian::date

- -

The boost::gregorian::date is provided as a conversion for base type std::tm and can be used as a replacement for it.

- -
-

Optional integration:

-

The integration with Boost types is optional and not enabled by default, which means that SOCI can be compiled and used without any dependency on Boost.

-

In order to enable the support for any of the above types, the user needs to either include one of these headers:

-
-#include <boost-optional.h>
-#include <boost-tuple.h>
-#include <boost-fusion.h>
-#include <boost-gregorian-date.h>
-
-

or to define the SOCI_USE_BOOST macro before including the soci.h main header file. Note that in this case the support for boost::fusion::vector is enabled only if the detected Boost version is at least 1.35.

-
- - - - - - - - - - - diff --git a/doc/errors.html b/doc/errors.html deleted file mode 100644 index 82beccd1..00000000 --- a/doc/errors.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - SOCI - errors - - - - - -

Errors

- -

All DB-related errors manifest themselves as exceptions of type soci_error, -which is derived from std::runtime_error.
-This allows to -handle database errors within the standard exception framework:

- -
-int main()
-{
-    try
-    {
-        // regular code
-    }
-    catch (exception const & e)
-    {
-        cerr << "Bang! " << e.what() << endl;
-    }
-}
-
- -
-

Portability note:

-

The Oracle backend can also throw the instances of the oracle_soci_error, -which is publicly derived from soci_error and has an -additional public err_num_ -member containing the Oracle error code:

- -
-int main()
-{
-    try
-    {
-        // regular code
-    }
-    catch (oracle_soci_error const & e)
-    {
-        cerr << "Oracle error: " << e.err_num_
-            << " " << e.what() << endl;
-    }
-    catch (exception const & e)
-    {
-        cerr << "Some other error: " << e.what() << endl;
-    }
-}
-
-
- -
-

Portability note:

-

The MySQL backend can throw instances of the mysql_soci_error, -which is publicly derived from soci_error and has an -additional public err_num_ -member containing the MySQL error code (as returned by -mysql_errno()):

- -
-int main()
-{
-    try
-    {
-        // regular code
-    }
-    catch (mysql_soci_error const & e)
-    {
-        cerr << "MySQL error: " << e.err_num_
-            << " " << e.what() << endl;
-    }
-    catch (exception const & e)
-    {
-        cerr << "Some other error: " << e.what() << endl;
-    }
-}
-
-
- - - - - - - - - - - diff --git a/doc/exchange.html b/doc/exchange.html deleted file mode 100644 index 86391a6d..00000000 --- a/doc/exchange.html +++ /dev/null @@ -1,742 +0,0 @@ - - - - - - SOCI - exchanging data - - - - - -

Exchanging data

- - - -

Binding local data

- -
-

Note: -The Oracle documentation uses two terms: defining (for -instructing the library where the output data should go) and binding -(for the input data and input/output PL/SQL -parameters). For the sake of simplicity, SOCI uses the term binding -for both of these.

-
- -

Binding output data

- -

The into expression is used to add binding information to -the statement:

- -
-int count;
-sql << "select count(*) from person", into(count);
-
-string name;
-sql << "select name from person where id = 7", into(name);
-
- -

In the above examples, some data is retrieved from the database and -transmitted into the given local variable.

- -

There should be as many into elements as there are -expected columns in the result (see dynamic -resultset binding for the exception to this rule).

- -

Binding input data

- -

The use expression associates the SQL placeholder (written with colon) with the local data:

- -
-int val = 7;
-sql << "insert into numbers(val) values(:val)", use(val);
-
- -

In the above statement, the first "val" is a column name (assuming -that -there is appropriate table numbers with this column), the -second "val" (with colon) is a -placeholder and its name is ignored here, and the third "val" is a name -of local variable.

- -

To better understand the meaning of each "val" above, consider also:

- -
-int number = 7;
-sql << "insert into numbers(val) values(:blabla)", use(number);
-
- -

Both examples above will insert the value of some local variable into -the table numbers - we say that the local variable is used in the SQL statement.

- -

There should be as many use elements as there are -parameters used in the SQL query.

- -
-

Portability note:

-

Older versions of the PostgreSQL client API do not allow to use input -parameters at all. In order to compile SOCI with those old client -libraries, define the SOCI_POSTGRESQL_NOPARAMS preprocessor -name passing -DSOCI_POSTGRESQL_NOPARAMS=ON variable to CMake.

-
- -

Binding by position

- -

If there is more output or input "holes" in the single statement, it -is possible to use many into and use -expressions, separated by commas, where each expression will be -responsible for the consecutive "hole" in the statement:

- -
-string firstName = "John", lastName = "Smith";
-int personId = 7;
-
-sql << "insert into person(id, firstname, lastname) values(:id, :fn, :ln)",
-    use(personId), use(firstName), use(lastName);
-
-sql << "select firstname, lastname from person where id = :id",
-    into(firstName), into(lastName), use(personId);
-
- -

In the code above, the order of "holes" in the SQL statement and the -order of into and use expression should -match.

- -

Binding by name

- -

The SQL placeholders that have their names (with colon) can be bound -by name to clearly associate the local variable with the given placehorder.

- -

This explicit naming allows to use different order of elements:

- -
-string firstName = "John", lastName = "Smith";
-int personId = 7;
-sql << "insert into person(id, firstname, lastname) values(:id, :fn, :ln)",
-    use(firstName, "fn"), use(lastName, "ln"), use(personId, "id");
-
- -

or bind the same local data to many "holes" at the same time:

- -
-string addr = "...";
-sql << "update person"
-       " set mainaddress = :addr, contactaddress = :addr"
-       " where id = 7",
-       use(addr, "addr");
-
- -
-

Object lifetime and immutability:

-

SOCI assumes that local variables provided as use elements -live at least as long at it takes to execute the whole statement. -In short statement forms like above, the statement is executed sometime -at the end of the full expression and the whole process is driven by the invisible -temporary object handled by the library. If the data provided by user comes -from another temporary variable, it might be possible for the compiler to arrange -them in a way that the user data will be destroyed before the statement will -have its chance to execute, referencing objects that no longer exist:

-
-// dangerous code:
-
-string getNameFromSomewhere();
-
-sql << "insert into person(name) values(:n)",
-    use(getNameFromSomewhere());
-
-

In the above example, the data passed to the database comes from the temporary -variable that is a result of call to getNameFromSomewhere - this -should be avoided and named variables should be used to ensure safe lifetime relations:

-
-// safe code:
-
-string getNameFromSomewhere();
-
-string name = getNameFromSomewhere();
-sql << "insert into person(name) values(:n)",
-    use(name);
-
- -

It is still possible to provide const data for use elements. -Note that some database servers, like Oracle, allow PL/SQL procedures to modify their -in/out parameters - this is detected by the SOCI library and an error is reported -if the database attempts to modify the use element that holds const -data.

-

The above example can be ultimately written in the following way:

-
-// safe and efficient code:
-
-string getNameFromSomewhere();
-
-const string & name = getNameFromSomewhere();
-sql << "insert into person(name) values(:n)",
-    use(name);
-
-
- -
-

Portability notes:

-

The PostgreSQL backend allows to use the "native" PostgreSQL way of -naming parameters in the query, which is by numbers like $1, -$2, $3, etc. In fact, the backend rewrites -the given query to the native form - and this is also one of the very few places -where SOCI intrudes into the SQL query. For portability reasons, it is -recommended to use named parameters, as shown in the examples above.
-The query rewriting can be switched off by compiling the backend with -the SOCI_POSTGRESQL_NOBINDBYNAME name defined (pass --DSOCI_POSTGRESQL_NOBINDBYNAME=ON variable to CMake). -Note that in this case it is also necessary to define SOCI_POSTGRESQL_NOPREPARE -(controlled by CMake variable -DSOCI_POSTGRESQL_NOPREPARE=ON), -because statement preparation relies on successful query rewriting. -In practice, both macros will be needed for PostgreSQL server older than 8.0.

-
- -

Handling nulls and other conditions

- -

Indicators

- -

In order to support null values and other conditions which are not -real errors, the concept of indicator is provided.

- -

For example, when the following SQL query is executed:

-
-select name from person where id = 7
-
- -

there are three possible outcomes:

-
    -
  1. there is a person with id = 7 and his name is returned
  2. -
  3. there is a person with id = 7, but he has no name (his name is -null in the database table)
  4. -
  5. there is no such person
  6. -
- -

Whereas the first alternative is easy to handle, the other two are more -complex. Moreover, they are not necessarily errors from the -application's point of view and what's more interesting, they are different -and the application may wish to detect which is the case.
-The following example does this:

- -
-string name;
-indicator ind;
-
-sql << "select name from person where id = 7", into(name, ind);
-
-if (sql.got_data())
-{
-    switch (ind)
-    {
-    case i_ok:
-        // the data was returned without problems
-        break;
-    case i_null:
-        // there is a person, but he has no name (his name is null)
-        break;
-    case i_truncated:
-        // the name was returned only in part,
-        // because the provided buffer was too short
-        // (not possible with std::string, but possible with char* and char[])
-        break;
-    }
-}
-else
-{
-    // no such person in the database
-}
-
- -

The use of indicator variable is optional, but if it is not used and -the result would be i_null, -then the exception is thrown. This means that you should use indicator -variables everywhere where the application logic (and database schema) -allow the "attribute not set" condition.

- -

Indicator variables can be also used when binding input data, to -control whether the data is to be used as provided, or explicitly -overrided to be null:

- -
-int id = 7;
-string name;
-indicator ind = i_null;
-sql << "insert into person(id, name) values(:id, :name)",
-    use(id), use(name, ind);
-
- -

In the above example, the row is inserted with name -attribute set to null.

- -

Indicator variables can also be used in conjunction with vector -based insert, update, and select statements:

- -
-vector<string> names(100);
-vector<indicator> inds;
-sql << "select name from person where id = 7", into(names, inds);
-
- -

The above example retrieves first 100 rows of data (or less). The -initial size of names vector provides the (maximum) -number of rows that should be read. Both vectors will be -automatically resized according to the number of rows that were -actually read.

- -

The following example inserts null for each value of name:

- -
-vector<int> ids;
-vector<string> names;
-vector<indicator> nameIndicators;
-
-for (int i = 0; i != 10; ++i)
-{
-    ids.push_back(i);
-    names.push_back("");
-    nameIndicators.push_back(i_null);
-}
-
-sql << "insert into person(id, name) values(:id, :name)",
-    use(ids), use(name, nameIndicators);
-
- -

See also Integration with Boost to learn -how the Boost.Optional library can be used to handle null data conditions -in a more natural way.

- -

Types

- -

Static type binding

- -

The static binding for types is most useful when the types used in -the database are known at compile time - this was already presented -above with the help of into and use -functions.

- -

The following types are currently supported for use with into -and use expressions:

- - -

See the test code that accompanies the library to see how each of -these types is used.

- -

Static type binding for bulk operations

- -

Bulk inserts, updates, and selects are supported through the -following std::vector based into and use types: -

- - -

Use of the vector based types mirrors that of the standard types, with -the size of the vector used to specify the number of records to process -at a time. See below for examples.

- -

Note that bulk operations are supported only for std::vectors of the types listed above.

- -

Dynamic resultset binding

- -

For certain applications it is desirable to be able to select data from -arbitrarily structured tables (e.g. via "select * from ...") and format the -resulting data based upon its type. -SOCI supports this through the soci::row and soci::column_properties -classes.

- -

Data is selected into a row object, which holds column_properties -objects describing -the attributes of data contained in each column. Once the data type for each -column is known, the data can be formatted appropriately.

- -

For example, the code below creates an XML document from a selected row -of data from an arbitrary table:

- -
-row r;
-sql << "select * from some_table", into(r);
-
-std::ostringstream doc;
-doc << "<row>" << std::endl;
-for(std::size_t i = 0; i != r.size(); ++i)
-{
-    const column_properties & props = r.get_properties(i);
-
-    doc << '<' << props.get_name() << '>';
-
-    switch(props.get_data_type())
-    {
-    case dt_string:
-        doc << r.get<std::string>(i);
-        break;
-    case dt_double:
-        doc << r.get<double>(i);
-        break;
-    case dt_integer:
-        doc << r.get<int>(i);
-        break;
-    case dt_unsigned_long:
-        doc << r.get<unsigned long>(i);
-        break;
-    case dt_long_long:
-        doc << r.get<long long>(i);
-        break;
-    case dt_date:
-        std::tm when = r.get<std::tm>(i);
-        doc << asctime(&when);
-        break;
-    }
-
-    doc << "</" << props.get_name() << '>' << std::endl;
-}
-doc << "</row>";
-
- -

The type T parameter that should be passed to -row::get<T>() depends on the SOCI data type that -is returned from -column_properties::get_data_type().

-

row::get<T>() -throws an exception of type -std::bad_cast if an incorrect type T is -requested.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SOCI Data Typerow::get<T> specialization
dt_doubledouble
dt_integerint
dt_unsigned_longunsigned long
dt_long_longlong long
dt_stringstd::string
dt_datestd::tm
- -

The mapping of underlying database column types to SOCI datatypes is database specific. -See the backend documentation for details.

- -

It is also possible to extract data from the row object using its stream-like -interface, where each extracted variable should have matching type respective to its position in the chain:

- -
-row r;
-sql << "select name, address, age from persons where id = 123", into(r);
-
-string name, address;
-int age;
-
-r >> name >> address >> age;
-
- -

Note, however, that this interface is not compatible with the standard -std::istream class and that it is only possible to extract a single row at a time -- for "safety" reasons the row boundary is preserved and it is necessary to perform the -fetch operation explicitly for each consecutive row -(see next page).

- -

Extending SOCI to support custom (user-defined) C++ types

- -

SOCI can be easily extended with support for user-defined datatypes.

- -

The extension mechanism relies on appropriate specialization of the type_conversion -struct that converts to and from one of the following SOCI base types:

- - - -

There are three required class members for a valid type_conversion -specialization:

- - -

Note that no database-specific code is required to define user conversion.

- -

The following example shows how the user can extend SOCI to -support his own type MyInt, which here is some wrapper -for the fundamental int type:

- -
-class MyInt
-{
-public:
-    MyInt() {}
-    MyInt(int i) : i_(i) {}
-
-    void set(int i) { i_ = i; }
-    int get() const { return i_; }
-
-private:
-    int i_;
-};
-
-namespace soci
-{
-    template <>
-    struct type_conversion<MyInt>
-    {
-        typedef int base_type;
-
-        static void from_base(int i, indicator ind, MyInt & mi)
-        {
-            if (ind == i_null)
-            {
-                throw soci_error("Null value not allowed for this type");
-            }
-
-            mi.set(i);
-        }
-
-        static void to_base(const MyInt & mi, int & i, indicator & ind)
-        {
-            i = mi.get();
-            ind = i_ok;
-        }
-    };
-}
-
- -

The above specialization for soci::type_conversion<MyInt> is enough -to enable the following:

- -
-MyInt i;
-
-sql << "select count(*) from person", into(i);
-
-cout << "We have " << i.get() << " persons in the database.\n";
-
- -

Note that there is a number of types from the Boost library integrated with SOCI out of the box, see Integration with Boost for complete description. Use these as examples of conversions for more complext data types.

- -

Note also that user-defined datatypes are not supported with bulk data transfer.

- -

Another possibility to extend SOCI with custom data types is to use -the into_type<T> and use_type<T> -class templates, which specializations can be user-provided. These -specializations need to implement the interface defined by, -respectively, the into_type_base and use_type_base -classes.

- -

Note that when specializing these template classes the only convention -is that when the indicator -variable is used (see below), it should appear in the second position. -Please refer to the library source code to see how this is done for the -standard types.

- -

Object-relational mapping

- -

SOCI provides a class called values specifically to -enable object-relational mapping via type_conversion -specializations.

- -

For example, the following code maps a Person object to -and from a -database table containing columns "ID", "FIRST_NAME", "LAST_NAME", and -"GENDER".

- -

Note that the mapping is non-invasive - the Person object -itself does not contain any SOCI-specific code:

- -
-struct Person
-{
-    int id;
-    std::string firstName;
-    std::string lastName;
-    std::string gender;
-};
-
-namespace soci
-{
-template<> struct TypeConversion<Person>
-{
-    typedef values base_type;
-    static void from_base(values const & v, indicator /* ind */, Person & p)
-    {
-        p.id = v.get<int>("ID");
-        p.firstName = v.get<std::string>("FIRST_NAME");
-        p.lastName = v.get<std::string>("LAST_NAME");
-
-        // p.gender will be set to the default value "unknown"
-        // when the column is null:
-        p.gender = v.get<std::string>("GENDER", "unknown");
-
-        // alternatively, the indicator can be tested directly:
-        // if (v.indicator("GENDER") == i_null)
-        // {
-        //     p.gender = "unknown";
-        // }
-        // else
-        // {
-        //     p.gender = v.get<std::string>("GENDER");
-        // }
-    }
-    static void to_base(const Person & p, values & v, indicator & ind)
-    {
-        v.set("ID", p.id);
-        v.set("FIRST_NAME", p.firstName);
-        v.set("LAST_NAME", p.lastName);
-        v.set("GENDER", p.gender, p.gender.empty() ? i_null : i_ok);
-        ind = i_ok;
-    }
-};
-}
-
- -

With the above type_conversion specialization in place, it -is possible to use Person directly with SOCI:

- -
-session sql(oracle, "service=db1 user=scott password=tiger");
-
-Person p;
-p.id = 1;
-p.lastName = "Smith";
-p.firstName = "Pat";
-sql << "insert into person(id, first_name, last_name) "
-       "values(:ID, :FIRST_NAME, :LAST_NAME)", use(p);
-
-Person p1;
-sql << "select * from person", into(p1);
-assert(p1.id == 1);
-assert(p1.firstName + p.lastName == "PatSmith");
-assert(p1.gender == "unknown");
-
-p.firstName = "Patricia";
-sql << "update person set first_name = :FIRST_NAME "
-       "where id = :ID", use(p);
-
- -
-

Note: The values -class is currently not suited for use outside of type_conversion -specializations. It is specially designed to facilitate -object-relational mapping when used as shown above.

-
- -

Large objects (BLOBs)

- -

The SOCI library provides also an interface for basic operations on -large objects (BLOBs - Binary Large OBjects).

- -
-blob b(sql); // sql is a session object
-sql << "select mp3 from mymusic where id = 123", into(b);
-
- -

The following functions are provided in the blob -interface, mimicking the file-like operations:

- - -

The offset parameter is always counted from the beginning -of the BLOB's data.

- -
-

Portability notes:

-
    -
  1. The way to define BLOB table columns and create or destroy BLOB -objects in the database varies between different database engines. -Please see the SQL documentation relevant for the given server to learn -how this is actually done. The test programs provided with the SOCI -library can be also a simple source of full working examples.
  2. -
  3. The trim function is not currently available for -the PostgreSQL backend.
  4. -
-
- - - - - - - - - - - diff --git a/doc/index.html b/doc/index.html deleted file mode 100644 index f72520cc..00000000 --- a/doc/index.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - SOCI - - - - - -

Documentation and tutorial

- - - -

The following (complete!) example is purposedly provided without any explanation.

- -
-#include "soci.h"
-#include "soci-oracle.h"
-#include <iostream>
-#include <istream>
-#include <ostream>
-#include <string>
-#include <exception>
-
-using namespace soci;
-using namespace std;
-
-bool getName(string &name)
-{
-    cout << "Enter name: ";
-    return cin >> name;
-}
-
-int main()
-{
-    try
-    {
-        session sql(oracle, "service=mydb user=john password=secret");
-
-        int count;
-        sql << "select count(*) from phonebook", into(count);
-
-        cout << "We have " << count << " entries in the phonebook.\n";
-
-        string name;
-        while (getName(name))
-        {
-            string phone;
-            indicator ind;
-            sql << "select phone from phonebook where name = :name",
-                into(phone, ind), use(name);
-
-            if (ind == i_ok)
-            {
-                cout << "The phone number is " << phone << '\n';
-            }
-            else
-            {
-                cout << "There is no phone for " << name << '\n';
-            }
-        }
-    }
-    catch (exception const &e)
-    {
-        cerr << "Error: " << e.what() << '\n';
-    }
-}
-
- - - - - - - - - - - diff --git a/doc/installation.html b/doc/installation.html deleted file mode 100644 index 03052f52..00000000 --- a/doc/installation.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - SOCI - structure - - - - - -

Installation

- - - -

Downloading

- -

Download package with latest release of the SOCI source code: soci-X.Y.Z.tar.gz|tar.bz2|zip, where X.Y.Z is the version number. Unpack this file.

- -

If you intend to hack SOCI, you can clone the Git repository:

- -
git clone git://soci.git.sourceforge.net/gitroot/soci/soci 
- -

Compilation

- -

SOCI is configured to build using CMake system in version 2.6+.

- -

The build configuration allows to control various aspects of compilation and installation by setting common CMake variables that change behaviour, describe system or control build (see CMake help) as well as SOCI-specific variables described below. All these variables are available regardless of platform or compilation toolset used.

- -

Running CMake from the command line allows to set variables in the CMake cache with the following syntax: -DVARIABLE:TYPE=VALUE. If you are new to CMake, you may find Running CMake helpful.

- -

TODO: group CMake variables specific to SOCI by backends + add variables used to defined LIB and INCLUDE for backend deps.

- - - - - - - - - - - - - - - - - - - -
List of a few essential and common CMake variables
CMAKE_BUILD_TYPEstringSpecifies the build type for make based generators (see CMake help).
CMAKE_INSTALL_PREFIXpathInstall directory used by install command (see CMake help).
CMAKE_VERBOSE_MAKEFILEbooleanIf ON, create verbose makefile (see CMake help).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
List of variables used to control detection of SOCI external dependencies
WITH_BOOSTbooleanShould CMake try to detect Boost C++ Libraries. If ON, CMake will try to find Boost headers and binaries of Boost.Date_Time library.
WITH_MYSQLbooleanShould CMake try to detect mysqlclient libraries providing MySQL C API. Note, currently the mysql_config program is not being used.
WITH_ODBCbooleanShould CMake try to detect ODBC libraries. On Unix systems, CMake tries to find unixODBC or iODBC implementations.
WITH_ORACLEbooleanShould CMake try to detect Oracle Call Interface (OCI) libraries.
WITH_POSTGRESQLbooleanShould CMake try to detect PostgreSQL client interface libraries. SOCI relies on libpq C library.
WITH_SQLITE3booleanShould CMak try to detect SQLite C/C++ library. As bonus, the configuration tries OSGeo4W distribution if OSGEO4W_ROOT environment variable is set.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
List of variables used to control selection of SOCI backends. All these variables are automatically switched on if corresponding WITH_ variable explained above is set to ON.
SOCI_EMPTYbooleanBuilds the sample backend called Empty. Always ON by default.
SOCI_MYSQLbooleanRequests to build MySQL backend. Automatically switched on, if WITH_MYSQL is set to ON.
SOCI_ODBCbooleanRequests to build ODBC backend. Automatically switched on, if WITH_ODBC is set to ON.
SOCI_ORACLEbooleanRequests to build Oracle backend. Automatically switched on, if WITH_ORACLE is set to ON.
SOCI_POSTGRESQLbooleanRequests to build PostgreSQL backend. Automatically switched on, if WITH_POSTGRESQL is set to ON.
SOCI_SQLITE3booleanRequests to build SQLite3 backend. Automatically switched on, if WITH_SQLITE3 is set to ON.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
List of variables used to control SOCI tests
SOCI_TESTSbooleanShould CMake build unit tests for all enabled backends. If OFF, all the connection string variables below are ignored.
SOCI_EMPTY_TEST_CONNSTRstringConnection string passed to Empty backend test program (e.g. "dummy connection")
SOCI_MYSQL_TEST_CONNSTRstringConnection string to MySQL test database. Format of the string is explained MySQL Backend Refernece.
SOCI_ODBC_TEST_ACCESS_CONNSTR
SOCI_ODBC_TEST_MSSQL_CONNSTR
SOCI_ODBC_TEST_MYSQL_CONNSTR
SOCI_ODBC_TEST_POSTGRESQL_CONNSTR
stringODBC Data Source Name (DSN) or ODBC File Data Source Name (FILEDSN) to test database: Microsoft Access (.mdb), Microsoft SQL Server, MySQL, PostgreSQL or any other ODBC SQL data source. See ODBC Backend Refernece for details.
SOCI_ORACLE_TEST_CONNSTRstringConnection string to Oracle test database. Format of the string is explained Oracle Backend Refernece.
SOCI_POSTGRESQL_TEST_CONNSTRstringConnection string to PostgreSQL test database. Format of the string is explained PostgreSQL Backend Refernece.
SOCI_SQLITE3_TEST_CONNSTRstringConnection string is simply a file path where SQLite3 test database will be created (e.g. /home/john/soci_test.db). Check SQLite3 Backend Refernece for details.
- -

CMake configures SOCI build performing sequence of steps. Each subsequent step is dependant on result of previous steps corresponding with particular feature. First, CMake checks system platform and compilation toolset. Next, CMake tries to find all external dependencies. Then, depending on the results of the dependency check, CMake determines SOCI backends which are possible to build. The SOCI-specific variables described above provide users with basic control of this behaviour.

- -

On Unix

- -

Short version using GNU Make makefiles:

-
-$ mkdir build
-$ cd build
-$ cmake -G "Unix Makefiles" -DWITH_BOOST=OFF -DWITH_ORACLE=OFF (...) ../soci-X.Y.Z
-$ make
-$ make test
-$ make install
-
- -

On Windows

- -

Short version using Visual Studio

- -
-C:\>MKDIR build
-C:\>cd build
-C:\build>cmake -G "Visual Studio 10" -DWITH_BOOST=OFF -DWITH_ORACLE=OFF (...) ..\soci-X.Y.Z
-C:\buikd>devenv.exe SOCI.sln
-
- - - -

Using classic Makefiles on Unix

- -

The classic set of Makefiles for Unix/Linux systems is provided for those users who need complete control over the whole process -and who can benefit from the basic scaffolding that they can extend on their own. -In this sense, the basic Makefiles are supposed to provide a minimal starting point for custom experimentation and are not intended to be a complete build/installation solution.
-At the same time, they are complete in the sense that they can compile the library with all test programs and for some users this level of support will be just fine.

- -

The core directory of the library distribution contains -the Makefile.basic that can be used to compile the core part of -the library. Run make -f Makefile.basic or make -f Makefile.basic shared to get the static and shared versions, respectively. -Similarly, the backends/name directory contains the -backend part for each supported backend with the appropriate Makefile.basic -and the backends/name/test -directory contains the test program for the given backend.

- -

For example, the simplest way to compile the static version of the -library and the test program for PostgreSQL is:

- -
-$ cd src/core
-$ make -f Makefile.basic
-$ cd ../backends/postgresql
-$ make -f Makefile.basic
-$ cd test
-$ make -f Makefile.basic
-
- -
-

Note: -For each backend and its test program, the Makefile.basics -contain the variables that can have values specific to the given -environment - they usually name the include and library paths. -These variables are placed at the beginning of the Makefile.basics. -Please review their values in case of any compilation problems.

-
- -

The Makefiles for test programs can be a good starting point to find -out correct compiler and linker options.

- - - - - - - - - - - - diff --git a/doc/interfaces.html b/doc/interfaces.html deleted file mode 100644 index ea41b568..00000000 --- a/doc/interfaces.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - SOCI - integration with Boost - - - - - -

Interfaces

- -

One of the major features of SOCI, although not immediately visible, is the variety of interfaces (APIs) that are available for the user. These can be divided into sugar, core and simple.

- -

Sugar

- -

The most exposed and promoted interface supports the syntax sugar that makes SOCI similar in look and feel to embedded SQL. The example of application code using this interface is:

- -
-session sql("postgresql://dbname=mydb");
-
-int id = 123;
-string name;
-
-sql << "select name from persons where id = :id", into(name), use(id);
-
- -

Core

- -

The above example is equivalent to the following, more explicit sequence of calls:

-
-session sql("postgresql://dbname=mydb");
-
-int id = 123;
-string name;
-
-statement st(sql);
-st.exchange(into(name));
-st.exchange(use(id));
-st.alloc();
-st.prepare("select name from persons where id = :id");
-st.define_and_bind();
-st.execute(true);
-
- -

The value of the core interface is that it is the basis for all other interfaces, and can be also used by developers to easily prepare their own convenience interfaces. Users who cannot or for some reason do not want to use the natural sugar interface should try the core one as the foundation and access point to all SOCI functionality.

- -

Note that the sugar interface wraps only those parts of the core that are related to data binding and query streaming.

- -

Simple

- -

The simple interface is provided specifically to allow easy integration of the SOCI library with other languages that have the ability to link with binaries using the "C" calling convention. To facilitate this integration, the simple interface does not use any pointers to data except C-style strings and opaque handles, but the consequence of this is that user data is managed by SOCI and not by user code. To avoid exceptions passing the module boundaries, all errors are reported as state variables of relevant objects.

- -

The above examples can be rewritten as (without error-handling):

- -
-#include <soci-simple.h>
-
-// ...
-session_handle sql = soci_create_session("postgresql://dbname=mydb");
-
-statement_handle st = soci_create_statement(sql);
-
-soci_use_int(st, "id");
-soci_set_use_int(st, "id", 123);
-
-int namePosition = soci_into_string(st);
-
-soci_prepare(st, "select name from persons where id = :id");
-
-soci_execute(st, true);
-
-char const * name = soci_get_into_string(st, namePosition);
-
-printf("name is %s\n", name);
-
-soci_destroy_statement(st);
-soci_destroy_session(sql);
-
- -

The simple interface supports single and bulk data exchange for static binding. Dynamic row description is not supported in this release.

-

See Simple client interface reference documentation for more details.

- -

Low-level backend interface

- -

The low-level backend interface allows to interact with backends directly and in principle allows to access the database without involving any other component. There is no particular reason to use this interface in the user code.

- - - - - - - - - - - diff --git a/doc/multithreading.html b/doc/multithreading.html deleted file mode 100644 index a22a742e..00000000 --- a/doc/multithreading.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - SOCI - multithreading - - - - - -

Multithreading

- -

The general rule for multithreading is that SOCI classes are not thread-safe, meaning that their instances should not be used concurrently by multiple threads.

- -

The simplest solution for multithreaded code is to set up a separate session object for each thread that needs to inteact with the database. Depending on the design of the client application this might be also the most straightforward approach.

- -

For some applications, however, it might be preferable to decouple the set of threads from the set of sessions, so that they can be optimized separately with different resources in mind. The connection_pool class is provided for this purpose:

- -
-// phase 1: preparation
-
-const size_t poolSize = 10;
-connection_pool pool(poolSize);
-
-for (size_t i = 0; i != poolSize; ++i)
-{
-    session & sql = pool.at(i);
-
-    sql.open("postgresql://dbname=mydb");
-}
-
-// phase 2: usage from working threads
-
-{
-    session sql(pool);
-
-    sql << "select something from somewhere...";
-
-} // session is returned to the pool automatically
-
- -

The connection_pool's constructor expects the size of the pool and internally creates an array of sessions in the disconnected state. Later, the at function provides non-synchronized access to each element of the array. Note that this function is not thread-safe and exists only to make it easier to set up the pool in the initialization phase.

- -

Note that it is not obligatory to use the same connection parameters for all sessions in the pool, although this will be most likely the usual case.

- -

The working threads that need to lease a single session from the pool use the dedicated constructor of the session class - this constructor blocks until some session object becomes available in the pool and attaches to it, so that all further uses will be forwarded to the session object managed by the pool. As long as the local session object exists, the associated session in the pool is locked and no other thread will gain access to it. When the local session variable goes out of scope, the related entry in the pool's internal array is released, so that it can be used by other threads. This way, the connection pool guarantees that its session objects are never used by more than one thread at a time.

- -

Note that the above scheme is the simplest way to use the connection pool, but it is also constraining in the fact that the session's constructor can block waiting for the availability of some entry in the pool. For more demanding users there are also low-level functions that allow to lease sessions from the pool with timeout on wait. Please consult the reference for details.

- - - - - - - - - - - diff --git a/doc/rationale.html b/doc/rationale.html deleted file mode 100644 index deb5faab..00000000 --- a/doc/rationale.html +++ /dev/null @@ -1,313 +0,0 @@ - - - - - - SOCI - rationale - - - - - -

Rationale FAQ

- -

This part of the documentation is supposed to gather in a single place -the usual questions (and answers) about SOCI with regard to the design -decisions that have shaped it.

- -

Q: Why "SOCI"?

- -

SOCI was initially developed in the environment where Oracle was the -main database technology in use. As a wrapper for the native OCI API -(Oracle Call Interface), the name "Simple Oracle Call Interface" was -quite obvious - until the 2.0 release, when the internal architecture -was largely redesigned to allow the use of backends that support other -database servers. We have kept the same name to indicate that Oracle is -the main supported technology in the sense -that the library includes only those features that were naturally -implemented in -Oracle. With the 2.1 release of the library, two new backends were -added (MySQL and SQLite3) and we decided to drop the original full name -so that new users looking for a library supporting any of these simpler -libraries are not discouraged by seeing "Oracle" somewhere in the name. -The other possible interpretation was "Syntax Oriented Call Interface", -which stresses the fact that SOCI was built to support the most natural -and easy interface for the user that is similar to the Embedded SQL -concept (see below). But on the other hand, SOCI also provides other -features (like object-relational mapping) and as a whole it is not just -"emulator" of the Embedded SQL. With all these considerations in mind, -SOCI is just "SOCI - The C++ Database Access Library".

- -

Still, Oracle is considered to be the main driving server technology in -terms of the set of features that are supported by the library. This -also means that backends for other servers might need to -work around some of the imposed idioms and protocols, but already -available and well-working PostgreSQL, MySQL and SQLite3 backends show -that it's actually not that -bad and the abstractions provided by the library are actually very -universal. Of -course, some of the features that were provided for Oracle might not be -supported for all other servers, but we think that it's better to have -one leading technology (where at least one group is fully happy) -instead of some "common denominator" for all databases (where nobody is happy).

- -

Q: Where the basic SOCI syntax comes from?

- -

The basic SOCI syntax was inspired by the Embedded SQL, which is part -of the SQL standard, supported by the major DB technologies and even -available as built-in part of the languages used in some DB-oriented -integrated -development environments. The term "Embedded SQL" is enough for Google -to spit millions of references - one of the typical examples is:

- -
-{
-    int a;
-    /* ... */
-    EXEC SQL SELECT salary INTO :a
-             FROM Employee
-             WHERE SSN=876543210;
-    /* ... */
-    printf("The salary is %d\n", a);
-    /* ... */
-}
-
- -

The above is not a regular C (nor C++) code, of course. It's the mix of -C and SQL and there is a separate, specialized preprocessor needed to -convert it to something that the actual C (or C++) compiler will be -able to understand. This means that the compilation of the program -using embedded SQL is two-phase: preprocess the embedded SQL part and -compile the result. This two-phase development is quite troublesome, -especially when it comes to debugging. Yet, the advantage of it is that -the code expresses the programmer's intents in a very straightforward -way: read something from the database and put it into the local -variable. Just like that.

- -

The SOCI library was born as an anwer to the following question: is it -possible to have the same expressive power without the disadvantages of -two-phase builds?

- -

The following was chosen to be the basic SOCI syntax that can mirror -the above Embedded SQL example:

- -
-int a;
-sql << "SELECT salary FROM Employee WHERE SSN=876543210", into(a);
-
- -

(as you see, SOCI changes the order of elements a little bit, so that -the SQL query is separate and not mixed with other elements)

- -

Apart from mimicking the Embedded SQL techniques in the regular, fully -standard C++ code, the above syntax has the following benefit: it is -minimal with respect to what has to -be said. Every single piece above is needed and expresses something -important, like:

-
    -
  • which session should be used (the client can be connected to many -databases at the same time) - here, the sql object -encapsulates the session,
  • -
  • what SQL query should be executed - here, it's the string -literal, but it could be also a std::string variable,
  • -
  • where to put the result - here, the local variable a -will receive the result.
  • -
- -

Everything else is just a couple of operators that allow to treat the -whole as a single expression. It's rather difficult to remove anything -from this example.

- -

The fact that the basic SOCI syntax is minimal (but without being -obscure at the same time, see below) means that the programmer does not -need to bother with unnecessary noise that some other database -libraries impose. We hope that after having written one line of code -like above by themselves, most programmers will react with something -like "how obvious!" instead of "how advanced!".

- -

Q: Why should I use SQL queries as strings in my program? I prefer the query to be generated or composed piece-by-piece by separate functions.

- -

First, you don't need to use SQL queries as string literals. In bigger -projects it is a common practice to store SQL queries externally (in a -file, or in a... database) and load them before use. This means that -they are not necessarily expected to appear in the program code, as -they do in our simple code examples and the advantage of separating -them from the source code of the main program is, among others, the -possibility to optimize and tune the SQL queries without recompilation -and relinking of the whole program.

- -

What is the most important, though, is that SOCI does not try to mess -with the -text of the query (apart from very few cases), which means that the -database server will get exactly the same text of the query as is used -in the program. The advantage of this is that there is no new SQL-like -(or even SQL-unlike) -syntax that you would need to learn, and also that it's much easier to -convince a typical -DBA to help with SQL tuning or other specialized activities, if he is -given the material in the form that is not polluted with any foreign -abstractions.

- -

Q: Why not some stream-like interface, which is well-known to all C++ programmers?

- -

An example of the stream-like interface might be something like this -(this is imaginary syntax, not supported by SOCI):

- -
-sql.exec("select a, b, c from some_table");
-
-while (!sql.eof())
-{
-    int a, b, c;
-    sql >> a >> b >> c;
-    // ...
-}
-
- -

We think that the data stored in the relational database should be -treated as a set of relations - which is exactly what it is. This means -that what is read from the database as a result of some SQL query is a -set of rows. This set might be -ordered, but it is still a set of rows, not a uniformly flat list of values. -This distinction might seem to be unnecessarily low-level and that the -uniform stream-like presentation of data is more preferable, but it's -actually the other way round - the set of rows is something more -structured - and that structure was designed -into the database - than the flat stream and -is therefore less prone to programming errors like miscounting the -number of values that is expected in each row.

- -

Consider the following programming error:

- -
-sql.exec("select a, b from some_table"); // only TWO columns
-
-while (!sql.eof())
-{
-    int a, b, c;
-    sql >> a >> b >> c; // this causes "row-tearing"
-    // ...
-}
-
- -

"How to detect the end of each line in a file" is a common beginner's question that -relates to the use of IOStreams - and this -common question clearly shows that for the record-oriented data the -stream is not an optimal abstraction. Of course, we don't claim that -IOStreams is bad - but we do insist that the record-oriented data is -better manipulated in a way that is also record-aware.

- -

Having said that, we have provided some form of the stream-like -interface, but with the important limitation that the stream is always bound to the -single row, so that the row-tearing effect is not possible. In other words, -data returned from the database is still structured into rows, but each row can be -separately traversed like a stream. We hope that it provides a good balance between -convenience and code safety.

- -

Q: Why use indicators instead of some special value to discover that something is null?

- -

Some programmers are used to indicating the null value by using some -special (which means: "unlikely" to be ever used) value - for example, -to use the smallest integer value to indicate null integer. Or to use -empty string to indicate null string. And so on.

- -

We think that it's completely wrong. Null (in the database sense) is an -information about the data. It describes the state of the data and if it's null, -then there's no data at all. -Nothing. Null. It does not make any sense to talk about some special -value if in fact there is no -value at all - especially if we take into account that, for example, the -smallest integer value (or whatever else you choose as the "special" -value) might not be that -special in the given application or domain.

- -

Thus, SOCI uses a separate indicators to describe the state of -exchanged data. It also has an additional benefit of allowing the -library to convey more than two states (null and not null). Indeed, the -SOCI library uses indicators also to report that the data was read, but -truncated (this applies to strings when reading to fixed-length -character arrays). Truncation is also an information about the data and -as such it's better to have it in addition to the data, not as part of -it.

- -

Having said that, it is important to point at the Integration with Boost -that allows to use boost::optional<T> to conveniently pack together -the data and the information about its state.

- -

Q: Overloaded comma operator is just obfuscation, I don't like it.

- -

Well, consider the following:

- -

"Send the query X to the server Y and put result into variable Z."

- -

Above, the "and" plays a role of the comma. Even if overloading the -comma operator is not a very popular practice in C++, some libraries do -this, achieving terse and easy to learn syntax. We are pretty sure that -in SOCI the comma operator was overloaded with a good effect.

- -

Q: The operator<< provides a bad abstraction for the "input" statements.

- -

Indeed, the operator<< in the basic SOCI syntax -shows that something (the query) is sent somewhere (to the server). -Some people don't like this, especially when the "select" statements -are involved. If the high-level idea is to read - data from somewhere, then operator<< -seems unintuitive to the die-hard IOStreams users. The fact is, -however, that the code containing SQL statement already indicates -that there is a client-server relationship with some other software -component (very likely remote). In such code it does not make any sense -to pretend that the communication is one-way only, because it's clear -that even the "select" statements need to be sent somewhere. This approach is -also more uniform and allows to cover other statements like "drop -table" or alike, where no data is expected to be exchanged at all (and -therefore the IOStreams analogies for data exchange have no sense at -all). No matter what is the kind of the SQL statement, it is sent - to the server and this -"sending" justifies the choice of operator<<.

- -

Using different operators (operator>> and operator<<) -as a way of distinguishing between different high-level ideas -(reading and writing from the data store, -respectively) does make sense on much higher level of abstraction, -where the SQL statement itself is already hidden - and we do encourage -programmers to use SOCI for implementing such high-level abstractions. -For this, the object-relational mapping facilities available in SOCI -might prove to be a valuable tool as well, as an effective bridge -between the low-level world of SQL statements and the high-level world -of user-defined abstract data types.

- -

Q: Why the Boost license?

- -

We decided to use the Boost license, because -it's well recognized in the C++ community, allows us to keep our -minimum copyrights, and at the same time allows SOCI to be safely used -in commercial projects, without imposing concerns (or just plain -uncertainty) typical to other open source licenses, like GPL. We also -hope that by choosing the Boost license we have made the life easier -for both us and our users. It saves us from answering law-related -questions that were already answered on the Boost license info -page and it should also give more confidence to our users - -especially to those of them, who already accepted the conditions of the -Boost license - the just have one license less to analyze.

- -

Still, if for any reason the conditions of this license are not -acceptable, we encourage the users to contact us directly (see links -on the relevant SOCI page) to discuss any remaining concerns.

- - - - - - - - - - - diff --git a/doc/reference.html b/doc/reference.html deleted file mode 100644 index bebe227c..00000000 --- a/doc/reference.html +++ /dev/null @@ -1,906 +0,0 @@ - - - - - - SOCI - reference - - - - - -

Client interface reference

- - - -

The core client interface is a set of classes and free functions declared in -the soci.h header file. All names are dbeclared in the soci -namespace.

- -

There are also additional names declared in the soci::details -namespace, but they are not supposed to be directly used by the users -of the library and are therefore not documented here. When such types -are used in the declarations that are part of the "public" interface, -they are replaced by "IT", which means "internal type". Types related -to the backend interface are named here, but documented on the next page.

- -

commonly used types

- -

The following types are commonly used in the rest of the interface:

- -
-// data types, as seen by the user
-enum data_type { dt_string, dt_date, dt_double, dt_integer,
-                 dt_unsigned_long, dt_long_long };
-
-// the enum type for indicator variables
-enum indicator { i_ok, i_null, i_truncated };
-
-// the type used for reporting exceptions
-class soci_error : public std::runtime_error { /* ... */ };
-
- -

The data_type type defines the basic SOCI data types. -User provided data types need to be associated with one of these basic -types.

- -

The indicator type defines the possible states of data.

- -

The soci_error type is used for error reporting.

- -

class session

- -

The session class encapsulates the connection to the -database.

- -
-class session
-{
-public:
-    session();
-    session(backend_factory const & factory, std::string const & connectString);
-    session(std::string const & backendName, std::string const & connectString);
-    explicit session(std::string const & connectString);
-    explicit session(connection_pool & pool);
-
-    ~session();
-
-    void open(backend_factory const & factory, std::string const & connectString);
-    void open(std::string const & backendName, std::string const & connectString);
-    void open(std::string const & connectString);
-    void close();
-    void reconnect();
-
-    void begin();
-    void commit();
-    void rollback();
-
-    IT once;
-    IT prepare;
-
-    template <typename T> IT operator<<(T const & t);
-
-    bool got_data() const;
-
-    std::ostringstream & get_query_stream();
-
-    void set_log_stream(std::ostream * s);
-    std::ostream * get_log_stream() const;
-
-    std::string get_last_query() const;
-
-    void uppercase_column_names(bool forceToUpper);
-
-    details::session_backend * get_backend();
-
-    std::string get_backend_name() const;
-};
-
- -

This class contains the following members:

-
    -
  • Various constructors. The default one creates the session in the disconnected state. - The others expect the backend factory object, or the backend name, or the URL-like - composed connection string. The last constructor creates a session proxy associated - with the session that is available in the given pool and releases it back to the pool - when its lifetime ends. Example: -
    -session sql(postgresql, "dbname=mydb");
    -session sql("postgresql", "dbname=mydb");
    -session sql("postgresql://dbname=mydb");
    -
    - The constructors that take backend name as string load the shared library (if not yet loaded) - with name computed as libsoci_ABC.so (or libsoci_ABC.dll on Windows) - where ABC is the given backend name. -
  • -
  • open, close and reconnect functions for - reusing the same session object many times; the reconnect function attempts - to establish the connection with the same parameters as most recently used with constructor - or open. The arguments for open are treated in the same way as - for constructors. -
  • -
  • begin, commit and rollback -functions for transaction control. -
  • -
  • once member, which is used for performing instant -queries that do not need to be separately prepared. Example: -
    -sql.once << "drop table persons";
    -
    -
  • -
  • prepare member, which is used for statement -preparation - the result of the statement preparation must be provided -to the constructor of the statement class. Example: -
    -int i;
    -statement st = (sql.prepare <<
    -                "insert into numbers(value) values(:val)", use(i));
    -
    -
  • -
  • operator<< that is a shortcut forwarder to the -equivalent operator of the once member. Example: -
    -sql << "drop table persons";
    -
    -
  • -
  • got_data returns true if the last executed query had non-empty result.
  • -
  • get_query_stream provides direct access to the stream object that is used - to accumulate the query text and exists in particular to allow the user to imbue specific locale - to this stream.
  • -
  • set_log_stream and get_log_stream functions for setting and getting - the current stream object used for basic query logging. By default, it is NULL, which means no logging. - The string value that is actually logged into the stream is one-line verbatim copy of the query string provided by the user, - without including any data from the use elements. The query is logged exactly once, before the preparation step.
  • -
  • get_last_query retrieves the text of the last used query.
  • -
  • uppercase_column_names allows to force all column names to uppercase in dynamic row description; - this function is particularly useful for portability, since various database servers - report column names differently (some preserve case, some change it).
  • -
  • get_backend returns the internal -pointer to the concrete backend implementation of the session. This is -provided for advanced users that need access to the functionality that -is not otherwise available.
  • -
  • get_backend_name is a convenience forwarder to the same function -of the backend object.
  • -
- -

See Connections and simple queries for more -examples.

- -

class connection_pool

- -

The connection_pool class encapsulates the thread-safe pool of connections -and ensures that only one thread at a time has access to any connection that it manages.

- -
-class connection_pool
-{
-public:
-    explicit connection_pool(std::size_t size);
-    ~connection_pool();
-
-    session & at(std::size_t pos);
-
-    std::size_t lease();
-    bool try_lease(std::size_t & pos, int timeout);
-    void give_back(std::size_t pos);
-};
-
- -

The operations of the pool are:

- -
    -
  • Constructor that takes the intended size of the pool. After construction, - the pool contains regular session objects in disconnected state.
  • -
  • at function that provides direct access to any given entry - in the pool. This function is non-synchronized.
  • -
  • lease function waits until some entry is available (which means - that it is not used) and returns the position of that entry in the pool, marking - it as locked.
  • -
  • try_lease acts like lease, but allows to set up a - time-out (relative, in milliseconds) on waiting. Negative time-out value means no time-out. - Returns true if the entry was obtained, in which case its position - is written to the pos parametr, and false if no entry - was available before the time-out.
  • -
  • give_back should be called when the entry on the given position - is no longer in use and can be passed to other requesting thread.
  • -
-

Note: calls to lease and give_back are automated by the -dedicated constructor of the session class, see above.

- -

class transaction

- -

The class transaction can be used for associating the transaction -with some code scope. It is a RAII wrapper for regular transaction operations that -automatically rolls back in its destructor if the transaction was not explicitly -committed before.

-
-class transaction
-{
-public:
-    explicit transaction(session & sql);
-
-    ~transaction();
-
-    void commit();
-    void rollback();
-
-private:
-    // ...
-};
-
- -

Note that objects of this class are not notified of other transaction related operations -that might be executed by user code explicitly or hidden inside SQL queries. -It is not recommended to mix different ways of managing transactions.

- -

function into

- -

The function into is used for binding local output data -(in other words, it defines where the results of the query are stored).

- -
-template <typename T>
-IT into(T & t);
-
-template <typename T, typename T1>
-IT into(T & t, T1 p1);
-
-template <typename T>
-IT into(T & t, indicator & ind);
-
-template <typename T, typename T1>
-IT into(T & t, indicator & ind, T1 p1);
-
-template <typename T>
-IT into(T & t, std::vector<indicator> & ind);
-
- -

Example:

- -
-int count;
-sql << "select count(*) from person", into(count);
-
- -

See Binding local data -for more examples.

- -

function use

- -

The function use is used for binding local input data (in -other words, it defines where the parameters of the query come from).

- -
-template <typename T>
-IT use(T & t);
-
-template <typename T, typename T1>
-IT use(T & t, T1 p1);
-
-template <typename T>
-IT use(T & t, indicator & ind);
-
-template <typename T, typename T1>
-IT use(T & t, indicator & ind, T1 p1);
-
-template <typename T>
-IT use(T & t, std::vector<indicator> const & ind);
-
-template <typename T, typename T1>
-IT use(T & t, std::vector<indicator> const & ind, T1 p1);
-
- -

Example:

- -
-int val = 7;
-sql << "insert into numbers(val) values(:val)", use(val);
-
- -

See Binding local data -for more examples.

- -

class statement

- -

The statement class encapsulates the prepared statement.

- -
-class statement
-{
-public:
-    statement(session & s);
-    statement(IT const & prep);
-    ~statement();
-
-    statement(statement const & other);
-    void operator=(statement const & other);
-
-    void alloc();
-    void bind(values & v);
-    void exchange(IT const & i);
-    void exchange(IT const & u);
-    void clean_up();
-
-    void prepare(std::string const & query);
-    void define_and_bind();
-
-    bool execute(bool withDataExchange = false);
-    bool fetch();
-
-    bool got_data() const;
-
-    void describe();
-    void set_row(row * r);
-    void exchange_for_rowset(IT const & i);
-
-    details::statement_backend * get_backend();
-};
-
- -

This class contains the following members:

-
    -
  • Constructor accepting the session object. This can -be used for later query preparation. Example: -
    -statement stmt(sql);
    -
    -
  • -
  • Constructor accepting the result of using prepare -on the session object, see example provided above for the - session class.
  • -
  • Copy operations.
  • -
  • alloc function, which allocates necessary internal resources.
  • -
  • bind function, which is used to bind the values -object - this is used in the object-relational mapping and normally -called automatically.
  • -
  • exchange functions for registering the binding of local data - -they expect the result of calling the into or use -functions and are normally invoked automatically.
  • -
  • clean_up function for cleaning up resources, normally -called automatically.
  • -
  • prepare function for preparing the statement for -repeated execution.
  • -
  • define_and_bind function for actually executing the -registered bindings, normally called automatically.
  • -
  • execute function for executing the statement. If its -parameter is false then there is no data exchange with -locally bound variables (this form should be used if later fetch -of multiple rows is foreseen). Returns true if there was at least -one row of data returned.
  • -
  • fetch function for retrieving the next portion of -the result. Returns true if there was new data.
  • -
  • got_data return true if the most recent -execution returned any rows.
  • -
  • describe function for extracting the type -information for the result (note: no data is exchanged). This is normally -called automatically and only when dynamic resultset binding is used.
  • -
  • set_row function for associating the statement -and row objects, normally called automatically.
  • -
  • exchange_for_rowset as a special case for binding rowset -objects.
  • -
  • get_backend function that returns the internal -pointer to -the concrete backend implementation of the statement object. This is -provided -for advanced users that need access to the functionality that is not -otherwise available.
  • -
- -

See Statement preparation and -repeated execution for example uses.

- -

Most of the functions from the statement class -interface are called automatically, but can be also used explicitly. -See Interfaces for the description of various way to use -this interface.

- -

class procedure

- -

The procedure class encapsulates the call to the stored -procedure and is aimed for higher portability of the client code.

- -
-class procedure
-{
-public:
-    procedure(IT const & prep);
-
-    bool execute(bool withDataExchange = false);
-    bool fetch();
-    bool got_data() const;
-};
-
- -

The constructor expects the result of using prepare -on the session object.

- -

See Stored procedures for -examples.

- -

class type_conversion

- -

The type_conversion class is a traits class that is -supposed to be provided (specialized) by the user for defining -conversions to and from one of the basic SOCI types.

- -
-template <typename T>
-struct type_conversion
-{
-    typedef T base_type;
-
-    static void from_base(base_type const & in, indicator ind, T & out);
-
-    static void to_base(T const & in, base_type & out, indicator & ind);
-};
-
- -

Users are supposed to properly implement the from_base and to_base -functions in their specializations of this template class.

- -

See Extending -SOCI to support custom (user-defined) C++ types.

- -

class row

- -

The row class encapsulates the data and type information -retrieved for the single row when the dynamic rowset binding is used.

- -
-class row
-{
-public:
-    row();
-    ~row();
-
-    void uppercase_column_names(bool forceToUpper);
-
-    std::size_t size() const;
-
-    indicator get_indicator(std::size_t pos) const;
-    indicator get_indicator(std::string const & name) const;
-
-    column_properties const & get_properties (std::size_t pos) const;
-    column_properties const & get_properties (std::string const & name) const;
-
-    template <typename T>
-    T get(std::size_t pos) const;
-
-    template <typename T>
-    T get(std::size_t pos, T const & nullValue) const;
-
-    template <typename T>
-    T get(std::string const & name) const;
-
-    template <typename T>
-    T get(std::string const & name, T const & nullValue) const;
-
-    template <typename T>
-    row const & operator>>(T & value) const;
-
-    void skip(std::size_t num = 1) const;
-
-    void reset_get_counter() const
-};
-
- -

This class contains the following members:

-
    -
  • Default constructor that allows to declare a row -variable.
  • -
  • uppercase_column_names - see the same function in the session class.
  • -
  • size function that returns the number of columns in -the row.
  • -
  • get_indicator function that returns the indicator value -for the given column (column is specified by position - starting from 0 -- or by name).
  • -
  • get_properties function that returns the properties -of the column given by position (starting from 0) or by name.
  • -
  • get functions that return the value of the column -given by position or name. If the column contains null, then these -functions either return the provided "default" nullValue -or throw an exception.
  • -
  • operator>> for convenience stream-like -extraction interface. Subsequent calls to this function are equivalent -to calling get with increasing position parameter, -starting from the beginning.
  • -
  • skip and reset_get_counter allow to change the -order of data extraction for the above operator.
  • -
- -

See Dynamic resultset binding for -examples.

- -

class column_properties

- -

The column_properties class provides the type and name -information about the particular column in a rowset.

- -
-class column_properties
-{
-public:
-    std::string get_name() const;
-    data_type get_data_type() const;
-};
-
- -

This class contains the following members:

-
    -
  • get_name function that returns the name of the column.
  • -
  • get_data_type that returns the type of the column.
  • -
- -

See Dynamic resultset binding for -examples.

- -

class values

- -

The values class encapsulates the data and type -information and is used for object-relational mapping.

- -
-class values
-{
-public:
-    values();
-
-    void uppercase_column_names(bool forceToUpper);
-
-    indicator get_indicator(std::size_t pos) const;
-    indicator get_indicator(std::string const & name) const;
-
-    template <typename T>
-    T get(std::size_t pos) const;
-
-    template <typename T>
-    T get(std::size_t pos, T const & nullValue) const;
-
-    template <typename T>
-    T get(std::string const & name) const;
-    
-    template <typename T>
-    T get(std::string const & name, T const & nullValue) const;
-
-    template <typename T>
-    values const & operator>>(T & value) const;
-
-    void skip(std::size_t num = 1) const;
-    void reset_get_counter() const;
-    
-    template <typename T>
-    void set(std::string const & name, T const & value, indicator indic = i_ok);
-
-    template <typename T>
-    void set(const T & value, indicator indic = i_ok);
-
-    template <typename T>
-    values & operator<<(T const & value);
-};
-
- -

This class contains the same members as the row class (with the same meaning) -plus:

-
    -
  • set function for storing values in named columns or in subsequent positions.
  • -
  • operator<< for convenience.
  • -
- -

See Object-relational mapping -for examples.

- -

class blob

- -

The blob class encapsulates the "large object" -functionality.

- -
-class blob
-{
-public:
-    explicit blob(session & s);
-    ~blob();
-
-    std::size_t getLen();
-    std::size_t read(std::size_t offset, char * buf, std::size_t toRead);
-    std::size_t write(std::size_t offset, char const * buf, std::size_t toWrite);
-    std::size_t append(char const * buf, std::size_t toWrite);
-    void trim(std::size_t newLen);
-
-    details::blob_backend * get_backend();
-};
-
- -

This class contains the following members:

-
    -
  • Constructor associating the blob object with the session object.
  • -
  • get_len function that returns the size of the BLOB -object.
  • -
  • read function that reads the BLOB data into provided -buffer.
  • -
  • write function that writes the BLOB data from -provided buffer.
  • -
  • append function that appends to the existing BLOB -data.
  • -
  • trim function that truncates the existing data to -the new length.
  • -
  • get_backend function that returns the internal -pointer to -the concrete backend implementation of the BLOB object. This is -provided -for advanced users that need access to the functionality that is not -otherwise available.
  • -
- -

See Large objects (BLOBs) for more -discussion.

- -

class rowid

- -

The rowid class encapsulates the "row identifier" object.

- -
-class rowid
-{
-public:
-    explicit rowid(Session & s);
-    ~rowid();
-
-    details::rowid_backend * get_backend();
-};
-
- -

This class contains the following members:

-
    -
  • Constructor associating the rowid object with the session -object.
  • -
  • get_backend function that returns the internal -pointer to -the concrete backend implementation of the rowid object.
  • -
- -

class backend_factory

- -

The backend_factory class provides the abstract interface -for concrete backend factories.

- -
-struct backend_factory
-{
-    virtual details::session_backend * make_session(
-        std::string const & connectString) const = 0;
-};
-
- -

The only member of this class is the make_session function -that is supposed to create concrete backend implementation of the -session object.

- -

Objects of this type are declared by each backend and should be -provided to the constructor of the session class. -In simple programs users do not need to use this class directly, but -the example use is:

- -
-backend_factory & factory = postgresql;
-std::string connectionParameters = "dbname=mydb";
-
-session sql(factory, parameters);
-
- -

Simple client interface

- -

The simple client interface is provided with other languages in mind, -to allow easy integration of the SOCI library with script interpreters and those -languages that have the ability to link directly with object files using -the "C" calling convention.

-

The functionality of this interface is limited and in particular the -dynamic rowset description and type conversions are not supported in this release. -On the other hand, the important feature of this interface is that it does not -require passing pointers to data managed by the user, because all data is handled -at the SOCI side. This should make it easier to integrate SOCI with languages that -have constrained ability to understand the C type system.

-

Users of this interface need to explicitly #include <soci-simple.h>.

- -
-typedef void * session_handle;
-session_handle soci_create_session(char const * connectionString);
-void soci_destroy_session(session_handle s);
-
-void soci_begin(session_handle s);
-void soci_commit(session_handle s);
-void soci_rollback(session_handle s);
-
-int soci_session_state(session_handle s);
-char const * soci_session_error_message(session_handle s);
-
- -

The functions above provide the session abstraction with the help of opaque handle. -The soci_session_state function returns 1 if there was no error -during the most recently executed function and 0 otherwise, in which -case the soci_session_error_message can be used to obtain a human-readable -error description.

-

Note that the only function that cannot report all errors this way is soci_create_session, -which returns NULL if it was not possible to create an internal object -representing the session. However, if the proxy object was created, but the connection -could not be established for whatever reason, the error message can be obtained in -the regular way.

- -
-typedef void * statement_handle;
-statement_handle soci_create_statement(session_handle s);
-void soci_destroy_statement(statement_handle st);
-
-int soci_statement_state(statement_handle s);
-char const * soci_statement_error_message(statement_handle s);
-
- -

The functions above create and destroy the statement object. If the statement cannot -be created by the soci_create_statement function, the error condition is set up in the related session object; -for all other functions the error condition is set in the statement object itself.

- -
-int soci_into_string   (statement_handle st);
-int soci_into_int      (statement_handle st);
-int soci_into_long_long(statement_handle st);
-int soci_into_double   (statement_handle st);
-int soci_into_date     (statement_handle st);
-
-int soci_into_string_v   (statement_handle st);
-int soci_into_int_v      (statement_handle st);
-int soci_into_long_long_v(statement_handle st);
-int soci_into_double_v   (statement_handle st);
-int soci_into_date_v     (statement_handle st);
-
- -

These functions create new data items for storing query results (into elements). -These elements can be later identified by their position, which is counted from 0. For convenience, -these function return the position of the currently added element. In case of error, --1 is returned and the error condition is set in the statement object.

-

The _v versions create a vector into elements, which can be used -to retrieve whole arrays of results.

- -
-int soci_get_into_state(statement_handle st, int position);
-int soci_get_into_state_v(statement_handle st, int position, int index);
-
- -

This function returns 1 if the into element at the given position has non-null value and 0 otherwise. -The _v version works with vector elements and expects an array index.

- -
-int  soci_into_get_size_v(statement_handle st);
-void soci_into_resize_v  (statement_handle st, int new_size);
-
- -

The functions above allow to get and set the size of vector into element.

- -

Note: the soci_into_resize_v always sets all into vectors in the given statement -to the same size, which guarantees that all vector into elements have equal size.

- -
-char const * soci_get_into_string   (statement_handle st, int position);
-int          soci_get_into_int      (statement_handle st, int position);
-long long    soci_get_into_long_long(statement_handle st, int position);
-double       soci_get_into_double   (statement_handle st, int position);
-char const * soci_get_into_date     (statement_handle st, int position);
-
-char const * soci_get_into_string_v   (statement_handle st, int position, int index);
-int          soci_get_into_int_v      (statement_handle st, int position, int index);
-long long    soci_get_into_long_long_v(statement_handle st, int position, int index);
-double       soci_get_into_double_v   (statement_handle st, int position, int index);
-char const * soci_get_into_date_v     (statement_handle st, int position, int index);
-
- -

The functions above allow to retrieve the current value of the given into element.

- -

Note: the date function returns the date value in the "YYYY MM DD HH mm ss" string format.

- -
-void soci_use_string   (statement_handle st, char const * name);
-void soci_use_int      (statement_handle st, char const * name);
-void soci_use_long_long(statement_handle st, char const * name);
-void soci_use_double   (statement_handle st, char const * name);
-void soci_use_date     (statement_handle st, char const * name);
-
-void soci_use_string_v   (statement_handle st, char const * name);
-void soci_use_int_v      (statement_handle st, char const * name);
-void soci_use_long_long_v(statement_handle st, char const * name);
-void soci_use_double_v   (statement_handle st, char const * name);
-void soci_use_date_v     (statement_handle st, char const * name);
-
- -

The functions above allow to create new data elements that will be used to provide -data to the query (use elements). The new elements can be later identified by given name, which -must be unique for the given statement.

- -
-void soci_set_use_state(statement_handle st, char const * name, int state);
-
- -

The soci_set_use_state function allows to set the state of the given use element. -If the state parameter is set to non-zero the use element is considered non-null -(which is also the default state after creating the use element).

- -
-int  soci_use_get_size_v(statement_handle st);
-void soci_use_resize_v  (statement_handle st, int new_size);
-
- -

These functions get and set the size of vector use elements (see comments for vector into elements above).

- -
-void soci_set_use_string   (statement_handle st, char const * name, char const * val);
-void soci_set_use_int      (statement_handle st, char const * name, int val);
-void soci_set_use_long_long(statement_handle st, char const * name, long long val);
-void soci_set_use_double   (statement_handle st, char const * name, double val);
-void soci_set_use_date     (statement_handle st, char const * name, char const * val);
-
-void soci_set_use_state_v    (statement_handle st, char const * name, int index, int state);
-void soci_set_use_string_v   (statement_handle st, char const * name, int index, char const * val);
-void soci_set_use_int_v      (statement_handle st, char const * name, int index, int val);
-void soci_set_use_long_long_v(statement_handle st, char const * name, int index, long long val);
-void soci_set_use_double_v   (statement_handle st, char const * name, int index, double val);
-void soci_set_use_date_v     (statement_handle st, char const * name, int index, char const * val);
-
- -

The functions above set the value of the given use element, for both single and vector elements.

- -

Note: the expected format for the data values is "YYYY MM DD HH mm ss".

- -
-int          soci_get_use_state    (statement_handle st, char const * name);
-char const * soci_get_use_string   (statement_handle st, char const * name);
-int          soci_get_use_int      (statement_handle st, char const * name);
-long long    soci_get_use_long_long(statement_handle st, char const * name);
-double       soci_get_use_double   (statement_handle st, char const * name);
-char const * soci_get_use_date     (statement_handle st, char const * name);
-
- -

These functions allow to inspect the state and value of named use elements.

-

Note: these functions are provide only for single use elements, not for vectors; -the rationale for this is that modifiable use elements are not supported for bulk operations.

- -
-void soci_prepare(statement_handle st, char const * query);
-int  soci_execute(statement_handle st, int withDataExchange);
-int  soci_fetch(statement_handle st);
-int  soci_got_data(statement_handle st);
-
- -

The functions above provide the core execution functionality for the statement object -and their meaning is equivalent to the respective functions in the core C++ interface -described above.

- - - - - - - - - - - diff --git a/doc/statements.html b/doc/statements.html deleted file mode 100644 index 79456b49..00000000 --- a/doc/statements.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - SOCI - statements, procedures and transactions - - - - - -

Statements, procedures and transactions

- - - -

Statement preparation and repeated execution

- -

Consider the following examples:

- -
-// Example 1.
-for (int i = 0; i != 100; ++i)
-{
-    sql << "insert into numbers(value) values(" << i << ")";
-}
-
-// Example 2.
-for (int i = 0; i != 100; ++i)
-{
-    sql << "insert into numbers(value) values(:val)", use(i);
-}
-
- -

Both examples will populate the table numbers with the -values from 0 to 99.

- -

The problem is that in both examples, not only the statement execution is -repeated 100 times, but also the statement parsing and preparation. -This means unnecessary overhead, even if some of the database servers -are likely to optimize the second case. In fact, more complicated queries are -likely to suffer in terms of lower performance, because finding the optimal -execution plan is quite expensive and here it would be needlessly repeated.

- -

The following example uses the class statement -explicitly, by preparing the statement only once and repeating its -execution with changing data (note the use of prepare -member of session class):

- - -
-int i;
-statement st = (sql.prepare <<
-                "insert into numbers(value) values(:val)",
-                use(i));
-for (i = 0; i != 100; ++i)
-{
-    st.execute(true);
-}
-
- -

The true parameter given to the execute -method indicates that the actual data exchange is wanted, so that the -meaning of the whole example is "prepare the statement and exchange the -data for each value of variable i".

- -
-

Portability note:

-

The above syntax is supported for all backends, even if some database server -does not actually provide this functionality - in which case the library will internally -execute the query in a single phase, without really separating -the statement preparation from execution.

-

For PostgreSQL servers older than 8.0 it is necessary to define the -SOCI_POSTGRESQL_NOPREPARE macro while compiling the library -to fall back to this one-phase behaviour. Simply, pass --DSOCI_POSTGRESQL_NOPREPARE=ON variable to CMake.

-
- -

Rowset and iterator-based access

- -

The rowset class provides an alternative means of executing queries and accessing results using STL-like iterator interface.

- -

The rowset_iterator type is compatible with requirements defined for input iterator category and is available via iterator and const_iterator definitions in the rowset class.

-

The rowset itself can be used only with select queries.

- -

The following example creates an instance of the rowset class and binds query results into elements of int type - in this query only one result column is expected. After executing the query the code iterates through the query result using rowset_iterator:

- -
-rowset<int> rs = (sql.prepare << "select values from numbers");
-
-for (rowset<int>::const_iterator it = rs.begin(); it != rs.end(); ++it)
-{
-     cout << *it << '\n';
-}
-
- -

Another example shows how to retrieve more complex results, where rowset elements are of type row and therefore use dynamic bindings:

- -
-// person table has 4 columns
-
-rowset<row> rs = (sql.prepare << "select id, firstname, lastname, gender from person");
-
-// iteration through the resultset:
-for (rowset<row>::const_iterator it = rs.begin(); it != rs.end(); ++it)
-{
-    row const& row = *it;
-
-    // dynamic data extraction from each row:
-    cout << "Id: " << row.get<int>(0) << '\n'
-         << "Name: " << row.get<string>(1) << " " << row.get<string>(2) << '\n'
-         << "Gender: " << row.get<string>(3) << endl;
-}
-
- -

rowset_iterator can be used with standard algorithms as well:

- -
-rowset<string> rs = (sql.prepare << "select firstname from person");
-
-std::copy(rs.begin(), rs.end(), std::ostream_iterator<std::string>(std::cout, "\n"));
-
- -

Above, the query result contains a single column which is bound to rowset element of type of std::string. All records are sent to standard output using the std::copy algorithm.

- -

Bulk operations

- -

When using some databases, further performance improvements may be possible by having the underlying database API group operations together to reduce network roundtrips. SOCI makes such bulk operations possible by supporting std::vector -based types:

- -
-// Example 3.
-const int BATCH_SIZE = 25;
-std::vector<int> valsIn;
-for (int i = 0; i != BATCH_SIZE; ++i)
-{
-    ids.push_back(i);
-}
-
-statement st = (sql.prepare <<
-                "insert into numbers(value) values(:val)",
-                use(valsIn));
-for (int i = 0; i != 4; ++i)
-{
-    st.execute(true);
-}
-
- -

(Of course, the size of the vector that will achieve optimum -performance will vary, depending on many environmental factors, such as -network speed.)

- -

It is also possible to read all the numbers written in the above -examples:

- -
-int i;
-statement st = (sql.prepare <<
-                "select value from numbers order by value",
-                into(i));
-st.execute();
-while (st.fetch())
-{
-    cout << i << '\n';
-}
-
- -

In the above example, the execute method is called -with the default parameter false. This means that the -statement should be executed, but the actual data exchange will be -performed later.

- -

Further fetch -calls perform the actual data retrieval and cursor traversal. The -end-of-cursor condition is indicated by the fetch -function returning false.

- -

The above code example should be treated as an idiomatic way -of reading many rows of data, one at a time.

- -

It is further possible to select records in batches into std::vector -based types, with the size of the vector specifying the number of -records to retrieve in each round trip:

- -
-std::vector<int> valsOut(100);
-sql << "select val from numbers", into(valsOut);
-
- -

Above, the value 100 indicates that no more values -should be retrieved, even if it would be otherwise possible. If there -are less rows than asked for, the vector will be appropriately -down-sized.

- -

The statement::execute() and statement::fetch() -functions can also be used to repeatedly select all rows returned by a -query into a vector based type:

- -
-const int BATCH_SIZE = 30;
-std::vector<int> valsOut(BATCH_SIZE);
-statement st = (sql.prepare <<
-                "select value from numbers",
-                into(valsOut));
-st.execute();
-while (st.fetch())
-{
-    std::vector<int>::iterator pos;
-    for(; pos != valsOut.end(); ++pos)
-    {
-        cout << *pos << '\n';
-    }
-
-    valsOut.resize(BATCH_SIZE);
-}
-
- -

Assuming there are 100 rows returned by the query, the above code -will retrieve and print all of them. Since the output vector was -created with size 30, it will take (at least) 4 calls to fetch() -to retrieve all 100 values. Each call to fetch() -can potentially resize the vector to a size less than its initial size -- how often this happens depends on the underlying database -implementation. -This explains why the resize(BATCH_SIZE) operation is -needed - it is there to ensure that each time the fetch() -is called, the vector is ready to accept the next bunch of values. -Without this operation, the vector might -be getting smaller with subsequent iterations of the loop, forcing more -iterations to be performed (because all -rows will be read anyway), than really needed.

- -

Note the following details about the above examples:

-
    -
  • After performing fetch(), the vector's size might -be less than requested, but fetch() -returning true means that there was at least one row retrieved.
  • -
  • It is forbidden to manually resize the vector to the size higher than it was initially (this -can cause the vector to reallocate its internal buffer and the library -can lose track of it).
  • -
- -

Taking these points under consideration, the above code example should -be treated as an idiomatic way of reading many rows by bunches of -requested size.

- -
-

Portability note:

-

Actually, all supported backends guarantee that the requested -number of rows will be read with each fetch and that the vector will -never be down-sized, unless for the last fetch, when the end of rowset condition is met. -This means that the manual vector -resizing is in practice not needed - the vector will keep its size until the end of -rowset. The above idiom, however, is provided with future backends in -mind, where the constant size of the vector might be too expensive to -guarantee and where allowing fetch to down-size the -vector even before reaching the end of rowset might buy some -performance gains.

-
- -

Stored procedures

- -

The procedure class provides a convenient mechanism for -calling stored procedures:

- -
-sql << "create or replace procedure echo(output out varchar2,"
-       "input in varchar2) as "
-       "begin output := input; end;";
-
-std::string in("my message");
-std::string out;
-procedure proc = (sql.prepare << "echo(:output, :input)",
-                                 use(out, "output"),
-                                 use(in, "input"));
-proc.execute(true);
-assert(out == "my message");
-
- -
-

Portability note:

-

The above way of calling stored procedures is provided for portability -of the code that might need it. It is of course still possible to call -procedures or functions using the syntax supported by the given -database server.

-
- -

Transactions

- -

The SOCI library provides the following members of the session -class for transaction management:

-
    -
  • void begin();
  • -
  • void commit();
  • -
  • void rollback();
  • -
- -

In addition to the above there is a RAII wrapper that allows to associate the transaction with the -given scope of code:

-
-class transaction
-{
-public:
-    explicit transaction(session & sql);
-
-    ~transaction();
-
-    void commit();
-    void rollback();
-
-private:
-    // ...
-};
-
- -

The object of class transaction will roll back automatically when the object is destroyed -(usually as a result of leaving the scope) and when the transaction was not explicitly committed before that.

-

A typical usage pattern for this class might be:

-
-{
-    transaction tr(sql);
-
-    sql << "insert into ...";
-    sql << "more sql queries ...";
-    // ...
-
-    tr.commit();
-}
-
-

With the above pattern the transaction is committed only when the code successfully -reaches the end of block. If some exception is thrown before that, the scope will be left -without reaching the final statement and the transaction object -will automatically roll back in its destructor.

- -
-

Portability note:

-

Different database servers have different policies with regard to the -implicit transaction management. Some of them start the implicit -transaction with the first DML statement and keep it open until -explicitly commited or rolled back (or closing the whole session). -Others will treat each statement as if it was a separate, auto-commited -transaction. For better compatibility, it is recommended to use the -above functions for explicit transaction management.

-
- -

Basic logging support

- -

The following members of the session class support the basic logging functionality:

-
    -
  • void set_log_stream(std::ostream * s);
  • -
  • std::ostream * get_log_stream() const;
  • -
  • std::string get_last_query() const;
  • -
- -

The first two functions allow to set the user-provided output stream object for logging. The NULL value, which is the default, means that there is no logging. An example use might be:

- -
-session sql(oracle, "...");
-
-ofstream file("my_log.txt");
-sql.set_log_stream(&file);
-
-// ...
-
- -

Each statement logs its query string before the preparation step (whether explicit or implicit) and therefore logging is effective whether the query succeeds or not. Note that each prepared query is logged only once, independent on how many times it is executed.

-

The get_last_query function allows to retrieve the last used query.

- - - - - - - - - - - diff --git a/doc/structure.html b/doc/structure.html deleted file mode 100644 index 7ad68915..00000000 --- a/doc/structure.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - SOCI - structure - - - - - -

Structure

- -
-Library structure diagram -
- -

The picture above presents the structure of the library, together with its -clients and servers. The boxes filled with cyan represent components that -are part of the library distribution.

- -

The SOCI library is extensible in the following ways:

-
    -
  • More backends can be added to target various database servers.
  • -
  • More interfaces can be defined on top of common backend interface.
  • -
  • Other languages can use the simple interface, which was designed specifically - for the "C" calling convention to ensure easy binding.
  • -
- -

The core part of the library and the backend interface definition are -placed in the core directory of the library distribution. -The soci-backend.h file is an internal abstract -interface to the actual backends, which are needed to perform -operations on the given database server. Normally, the C++ client -program needs to interface with the soci.h header and the -header(s) relevant to the given backend(s) (for example, soci-oracle.h), -although with dynamic backend loading this can be avoided. -It is possible for the same program to use many backends at the same -time.

- -

Everything in SOCI is -declared in the namespace soci. -All code examples presented in this documentation assume that your code -begins with something -like:

-
-#include "soci.h"
-// other includes if necessary
-
-using namespace soci;
-
-// ...
-
- -
-

Note: -In simple programs, #include for the relevant -backend is needed only in the file where the session -object is created with explicit name of the backend factory. -The example program on the previous -page shows the appropriate #include directive for the -Oracle backend. It is also possible to name backends at run-time -as part of the connection string, in which case no backend-specific -#include directive is necessary.

-
- - - - - - - - - - - diff --git a/doc/structure.odg b/doc/structure.odg deleted file mode 100644 index 64aa0761c5b71a18ad12e8164348c80433522078..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29603 zcmbrl1C%Av^CnofZQHhO+g6utcU5)SMi;u+WxJ}&wr$(q*FFE4ot^WWIeT_*oXotD z_eR7QU*yY^H{W|ovY=pSK!4kk^Eg)?C__Ijp#OJ+0&I5HcIK{Lj^@UWj<(jO#;(>5 z_KfcKW(*F-F4is#4vyybW)7xqcINi343^Huj#k#DE=vCohX5b{qu~I0q7L>J)|PJ0 z|6IASFuJ%JySllU7&|lmH#;am*uOyjhY_Gd`5)|zO-;>h%>iy4oEc5soSpw7@U*i9 z1yYiQ{0kfi`EzMmRMXX)zj2&J6 zmlUT81Fv*Jfq?#Q^Z;WeYg1P@Ku(OzO#gFZ`7h<~k(G&Cf?1To(cbchl7b{W3=Ryy z4qjSHOa*Wx`ny2^oB@dyMGgW10SYRoCJs=6fC2#m6d3q-_wNAc_Vn}s0et}k=)&kF z3?PdPpo|Ql@eH7^f5xoiKo;Xb8RJ0X<3L~ke6fB3S$qLyd;yLBjrZ3zz_$euz!WeS zF!(nTpjoi8X0Wo3v$B5u3k=XLELbxvSjR0`zy9F>3|nNdW@NCAXRv<#g9VsvG0vJX z&N@EM`t=Vbz}Vu8HRFqQ{EPMLA80@l0Mr1O09*hdfX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`}A4Qk{pXkuwI%U~YZ@b9F9H=hMvCtIul6 zX+bABhbzg4@Hfde_?S?>NJ5%NYZ+2EH*-6Zwq=gfg`q&iw84}sqrhh!oHt2UwzCqC zh5~E|!Jl_k9_f}KVp-^G_Opo?w3wWOsRkIHnHkR*%;f4eu*FFQU7cjTPaJM;6+e7<7m1Am5LW}kD4LLpgC z6jP+GXE>0Y_E1GnLgRqfERs`nP(`yZ!bE?62m*9*q8d!`U3Wk?ptw1OCH&}v zQsko&lNP42(z7-*HgfnEwX7jY&ZZX^)_3!f0)0bcuER2N-jJC4vgaM(*P=MTpKb88 z5081Cv&NTy>0Lq0)FsEoQPBR&-0>L%b|Mo}ItoLQUu>gtVa3vK>-4Vb`xCR}Z~5rF zSf6{=T-^*~5T!j8T~!!zu(4T-tH0{e^iMmFkPMlQDbjC*#uJSHw^bK-lB z&a!md8Orjq5%D-uTAG>zvU2s>%>i*k7lFj4nH+q>CNjK`|7!;iOY@NB({8a~*fw>A8I?R4_0o&RECr(gwYFld`*>`Ge z{#367oagG)Ja0AZvxcdh{a0h9TJa^Af4Pr3e!1GpN&o^O0w8`h%zx(J{p*eY^YlM7 zynkl>p98)MfAQh|gxpv0pNzS`Bk%s-v;UoY@ITzTzo2)2BJ`{HPo4jQ!291m++R+w ze`4#a_)pP40K9*{Fn_ZCSw-ZpOZiWgzXS39yUt%oygwoRpLG5WkoVt}{=Hry|3T>w zFz^4XO6Px2`2*1V?+eH6Gi0%>oB;lNA#Cx^N00cul^tEFHkc8 diff --git a/doc/structure.png b/doc/structure.png deleted file mode 100644 index 1694cb68715464bd7e21004cb38f1e3dca9f47af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26919 zcmZsBV|-=LwrzJh9jB9YY}-!9ww>(Qwr$(CjUB6F+qP{dFaLASyZ7DqyC2s2uu-+D zYOFcN9CL=sN{hfkVL*NR_6=4{R8aogx9>Y&R|*8k*WHL&xc}=5NE=Z#`)}WVjelKZ z-`(ElSHFETS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f}zpI9Y^lWORdB)_5n3>ZLmFC5+6Fm=X!)GqrA*xEC&4>59jjX{jbCF?g zyMc_qQ6MOp&cP<^CkM@;*_7l!a}mDQIBm_u&~{#j_IZT{VPVeV_i!!ZAsC%NH|pTKCzu z{NVjHR8>-vWRq*@!e{oo`gC^5f;HpQ+GF%)udsWEMwHbkN6GPq;ynJM_2F;S6vZ6% zF8*GZXEq3wx?ClGCw7cQJl(|t j0$Cn=(dH|@Qm|-- - - - - - SOCI - articles - - - - - - - - - - - - - - -
-

The following articles were published about SOCI:

- -
- - diff --git a/www/doc.html b/www/doc.html deleted file mode 100644 index 9b42ebc8..00000000 --- a/www/doc.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SOCI - - -SOCI
-The C++ Database Access Library -
-
-Documentation and tutorial
-

-The documentation was moved to http://soci.sourceforge.net/doc/index.html
-Please update your links.
-
- - diff --git a/www/events.html b/www/events.html deleted file mode 100644 index 61cc75db..00000000 --- a/www/events.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - SOCI - events - - - - - - - - - - - - - - -
-

Events:

- -2008-07-10: -
3.0.0 version is released. -
-
-2006-12-04: -
2.2.0 version is released. -
-
-2006-05-15: -
2.1.0 version is released. -
-
-2006-01-16: -
2.0.0 version is released. -
-
-2005-10-14: -
1.2.1 version is released. -
-
-2005-10-02: -
1.2.0 version is released. -
-
-2005-03-06: -
1.1.0 version is released. -
-
-2004-10-16: -
1.0.1 version is released. -
-
-2004-10-12: -
SOCI project is registered at SourceForge. -
-
-2004-09-29: -
First version of SOCI is announced on comp.lang.c++.moderated. -
-
- - diff --git a/www/index.html b/www/index.html deleted file mode 100644 index 04eb990e..00000000 --- a/www/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - SOCI - - - - - - - - - - - - - - -
-

SOCI is a database access library -for C++ that makes the illusion of embedding -SQL queries in the regular -C++ code, staying entirely within the Standard C++.

- -

The idea is to provide C++ programmers a way to access SQL -databases in the most natural and intuitive way. If you find existing -libraries too difficult for your needs or just distracting, SOCI can be -a good alternative.

- -

The simplest motivating code example for the SQL query that is supposed -to retrieve a single row is:

-
-int id = ...;
-string name;
-int salary;
-
-sql << "select name, salary from persons where id = " << id,
-       into(name), into(salary);
-
- -

and the following benefits from extensive support for object-relational -mapping:

-
-int id = ...;
-Person p;
-
-sql << "select first_name, last_name, date_of_birth "
-       "from persons where id = " << id,
-       into(p);
-
- -

Integration with STL is also supported:

- -
-Rowset<string> rs = (sql.prepare << "select name from persons");
-copy(rs.begin(), rs.end(), ostream_iterator<string>(cout, "\n"));
-
- -

SOCI offers also extensive integration with Boost datatypes (optional, tuple and fusion) and flexible support -for user-defined datatypes.

- -

Starting from its 2.0.0 release, SOCI uses the plug-in architecture for -backends - this allows to target various database servers. Currently (3.0.0), -the following database servers are supported:

-
    -
  • Oracle
  • -
  • PostgreSQL
  • -
  • MySQL
  • -
- -

Other (unsupported) backends exist in the CVS repository: ODBC, SQLite and Firebird.

- -

The intent of the library is to cover as many database technologies as -possible. For this, the project has to rely on volunteer contributions -from other programmers, who have expertise with the existing database -interfaces and would like to help writing dedicated backends.
-If you are interested in participating, please contact the project admin.

- -

The SOCI library is distributed under the terms of the Boost -Software License.

- -

The latest and experimental version of the code is always available from -the Git repository.

-

Anonymous clone of this repository can be obtained with:

-
-$ git clone git://soci.git.sourceforge.net/gitroot/soci/soci
-
- -

To meet other users, please consider subscribing to the SOCI -mailing list.

-
- - diff --git a/www/links.html b/www/links.html deleted file mode 100644 index c3dd10ea..00000000 --- a/www/links.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - SOCI - links - - - - - - - - - - - - - - -
-

Some links you may find useful:

- -ORAPP - Oracle OCI C++ Interface Library - -
- -OCI C++ Library - -
- -Oracle, ODBC and DB2-CLI Template Library - -
- -Oracle C++ Call Interface - -
- -Oracle Open Source Projects - -
- -Database Template Library - -
- -MyMySQL - A lightweight C++ wrapper around MySQL client API - -
- - diff --git a/www/people.html b/www/people.html deleted file mode 100644 index 5bf5700c..00000000 --- a/www/people.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - SOCI - people - - - - - - - - - - - - - - -
-

SOCI People:

- -Maciej Sobczak (see homepage) -
Project admin
-Core development
-Initial Oracle Call Interface support
-Plug-in backend architecture
-PostgreSQL backend
-Documentation -
-
-Steve Hutton (see homepage) -
Core development
-Bulk (vector) operations
-Dynamic result binding
-Object-Relational mapping facilities
-Common tests framework
-Documentation -
-
-David Courtney (see homepage) -
SQLite backend
-MS SQL Server (via ODBC) backend -
-
-Pawe³ Aleksander Fedoryñski (see homepage) -
MySQL backend -
-
-Rafa³ Bobrowski -
Firebird backend -
-
-Mateusz £oskot (see homepage) -
Package and build manager
-Iterator support -
-
- - diff --git a/www/style.css b/www/style.css deleted file mode 100644 index 4d203551..00000000 --- a/www/style.css +++ /dev/null @@ -1,73 +0,0 @@ -body -{ - background-color: white; - color: black; - margin-left: 100px; - margin-right: 100px; -/* font-family: arial, sans-serif; */ -} - -table.banner -{ - width: 100%; - border-bottom-color: black; - border-bottom-style: solid; - border-bottom-width: 1px; - padding-top: 16px; - padding-bottom: 5px; -} - -td.banner_left -{ - font-size: x-large; - font-weight: bold; - font-stretch: expanded; -} - -td.banner_right -{ - text-align: right; -} - -table.footer -{ - width: 100%; - border-top-color: black; - border-top-style: solid; - border-top-width: 1px; - padding-bottom: 16px; - padding-top: 5px; -} - -table.main -{ - padding-top: 25px; -} - -td.main_navigator -{ - vertical-align: top; -} - -td.main_text -{ - vertical-align: top; - padding-left: 20px; -} - -span.bold -{ - font-weight: bold; -} - -span.literal -{ - font-weight: bold; - background-color: white; - color: #8B0000; -} - -div.indent -{ - margin-left: 40px; -} From 9085f2b73fed3566751ee386a582fe6122c9be17 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 26 Dec 2010 14:16:13 +0100 Subject: [PATCH 02/19] [Branch src] tmp is now ignored by Git. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index fd0596b2..61caff87 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ m4 missing Makefile Makefile.in +tmp + From 9341a8997d5841e824c431ea9f85498c9ca87a34 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 26 Dec 2010 14:18:46 +0100 Subject: [PATCH 03/19] [Branch src] Merged latest work from the buried_headers branch. --- CMakeLists.txt | 95 +--- backends/CMakeLists.txt | 13 +- backends/empty/soci-empty.h | 10 +- backends/mysql/common.cpp | 8 +- backends/mysql/common.h | 10 +- backends/mysql/soci-mysql.h | 17 +- backends/mysql/standard-into-type.cpp | 13 +- backends/mysql/standard-use-type.cpp | 11 +- backends/mysql/test/test-mysql.cpp | 25 +- backends/mysql/vector-into-type.cpp | 11 +- backends/mysql/vector-use-type.cpp | 10 +- backends/oracle/blob.cpp | 11 +- backends/oracle/error.h | 9 +- backends/oracle/soci-oracle.h | 8 +- backends/oracle/standard-into-type.cpp | 23 +- backends/oracle/standard-use-type.cpp | 25 +- backends/oracle/statement.cpp | 15 +- backends/oracle/test/test-oracle.cpp | 17 +- backends/oracle/vector-into-type.cpp | 17 +- backends/oracle/vector-use-type.cpp | 14 +- backends/postgresql/common.cpp | 8 +- backends/postgresql/soci-postgresql.h | 8 +- backends/postgresql/standard-into-type.cpp | 14 +- backends/postgresql/standard-use-type.cpp | 17 +- backends/postgresql/test/test-postgresql.cpp | 14 +- cmake/CMakeLists.txt | 15 - cmake/SociBackend.cmake | 327 -------------- cmake/SociConfig.cmake | 49 --- cmake/SociDependencies.cmake | 81 ---- cmake/SociSystemInfo.cmake | 77 ---- cmake/SociUtilities.cmake | 416 ------------------ cmake/SociVersion.cmake | 59 --- cmake/dependencies/Boost.cmake | 14 - cmake/dependencies/MySQL.cmake | 10 - cmake/dependencies/ODBC.cmake | 10 - cmake/dependencies/Oracle.cmake | 5 - cmake/dependencies/PostgreSQL.cmake | 5 - cmake/dependencies/SQLite3.cmake | 5 - cmake/dependencies/Threads.cmake | 5 - cmake/modules/FindDL.cmake | 21 - cmake/modules/FindMySQL.cmake | 103 ----- cmake/modules/FindODBC.cmake | 55 --- cmake/modules/FindOracle.cmake | 76 ---- cmake/modules/FindPostgreSQL.cmake | 77 ---- cmake/modules/FindSQLite3.cmake | 70 --- .../vs2010-test-cmd-args.vcxproj.user.in | 7 - core/error.h | 11 +- core/exchange-traits.h | 14 +- core/soci-backend.h | 14 +- core/test/common-tests.h | 32 +- core/type-conversion-traits.h | 9 +- 51 files changed, 315 insertions(+), 1675 deletions(-) delete mode 100644 cmake/CMakeLists.txt delete mode 100644 cmake/SociBackend.cmake delete mode 100644 cmake/SociConfig.cmake delete mode 100644 cmake/SociDependencies.cmake delete mode 100644 cmake/SociSystemInfo.cmake delete mode 100644 cmake/SociUtilities.cmake delete mode 100644 cmake/SociVersion.cmake delete mode 100644 cmake/dependencies/Boost.cmake delete mode 100644 cmake/dependencies/MySQL.cmake delete mode 100644 cmake/dependencies/ODBC.cmake delete mode 100644 cmake/dependencies/Oracle.cmake delete mode 100644 cmake/dependencies/PostgreSQL.cmake delete mode 100644 cmake/dependencies/SQLite3.cmake delete mode 100644 cmake/dependencies/Threads.cmake delete mode 100644 cmake/modules/FindDL.cmake delete mode 100644 cmake/modules/FindMySQL.cmake delete mode 100644 cmake/modules/FindODBC.cmake delete mode 100644 cmake/modules/FindOracle.cmake delete mode 100644 cmake/modules/FindPostgreSQL.cmake delete mode 100644 cmake/modules/FindSQLite3.cmake delete mode 100644 cmake/resources/vs2010-test-cmd-args.vcxproj.user.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 02076206..f654e24e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,99 +1,6 @@ -################################################################################# # -# This file is part of CMake configuration for SOCI library -# -# Copyright (C) 2009-2010 Mateusz Loskot -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -# -################################################################################# -# General settings -################################################################################# -cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) - -project(SOCI) - -################################################################################# -# SOCI CMake modules -################################################################################# - -# Path to additional CMake modules -set(CMAKE_MODULE_PATH ${SOCI_SOURCE_DIR}/cmake${CMAKE_MODULE_PATH}) -set(CMAKE_MODULE_PATH ${SOCI_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) - -include(SociUtilities) - message(STATUS "") -colormsg(_HIBLUE_ "Configuring SOCI:") - -################################################################################# -# SOCI version information -################################################################################# -include(SociVersion) - -soci_version(MAJOR 3 MINOR 1 PATCH 0) - -################################################################################# -# Build features and variants -################################################################################# -include(SociSystemInfo) -include(SociConfig) - -boost_report_value(SOCI_PLATFORM_NAME) -boost_report_value(SOCI_COMPILER_NAME) - -option(SOCI_TESTS "Enable build of collection of SOCI tests" ON) -boost_report_value(SOCI_TESTS) - -# Put the libaries and binaries that get built into directories at the -# top of the build tree rather than in hard-to-find leaf -# directories. This simplifies manual testing and the use of the build -# tree rather than installed Boost libraries. -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) - -################################################################################# -# Find SOCI dependencies -################################################################################# - -set(SOCI_CORE_DEPENDENCIES) - -include(SociDependencies) - -#message("${SOCI_CORE_DEPENDENCIES}") - -################################################################################# -# Installation -################################################################################# - -if(UNIX AND CMAKE_SIZEOF_VOID_P EQUAL 4) - set(SOCI_LIBDIR "lib") -else() - set(SOCI_LIBDIR "lib64") -endif() - -set(BINDIR "bin" CACHE PATH "The directory to install binaries into.") -set(LIBDIR ${SOCI_LIBDIR} CACHE PATH "The directory to install libraries into.") -set(DATADIR "share" CACHE PATH "The directory to install data files into.") -set(INCLUDEDIR "include" CACHE PATH "The directory to install includes into.") - -################################################################################# -# Enable CTest support -################################################################################# -#include(CTest) -enable_testing() - -# Define "make check" as alias for "make test" -add_custom_target(check COMMAND ctest) - -################################################################################# -# Build configured components -################################################################################# -include(SociBackend) - -include_directories(${SOCI_SOURCE_DIR}/core) +# add_subdirectory(core) add_subdirectory(backends) diff --git a/backends/CMakeLists.txt b/backends/CMakeLists.txt index 0267bcea..45c2c890 100644 --- a/backends/CMakeLists.txt +++ b/backends/CMakeLists.txt @@ -1,12 +1,13 @@ message(STATUS "") colormsg(_HIBLUE_ "Configuring SOCI database backends:") +############################################################## # TODO: Scan and add directories automatically --mloskot -add_subdirectory(empty) -add_subdirectory(mysql) -add_subdirectory(odbc) -add_subdirectory(oracle) -add_subdirectory(postgresql) -add_subdirectory(sqlite3) +set ( _SUBDIRS_ empty mysql odbc oracle postgresql sqlite3 ) + +foreach ( subd ${_SUBDIRS_} ) + add_subdirectory( ${subd} ) +endforeach () + message(STATUS "") diff --git a/backends/empty/soci-empty.h b/backends/empty/soci-empty.h index e3d5d5e4..3c212456 100644 --- a/backends/empty/soci-empty.h +++ b/backends/empty/soci-empty.h @@ -22,9 +22,13 @@ #ifndef SOCI_EMPTY_DECL # define SOCI_EMPTY_DECL #endif - -#include "soci-backend.h" - +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// #include #include diff --git a/backends/mysql/common.cpp b/backends/mysql/common.cpp index 8721f31f..796ac1c2 100644 --- a/backends/mysql/common.cpp +++ b/backends/mysql/common.cpp @@ -6,7 +6,13 @@ // #include "common.h" -#include "soci-backend.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// #include #include #include diff --git a/backends/mysql/common.h b/backends/mysql/common.h index 8f149793..7584261e 100644 --- a/backends/mysql/common.h +++ b/backends/mysql/common.h @@ -8,7 +8,15 @@ #ifndef SOCI_MYSQL_COMMON_H_INCLUDED #define SOCI_MYSQL_COMMON_H_INCLUDED -#include "soci-mysql.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// // std #include #include diff --git a/backends/mysql/soci-mysql.h b/backends/mysql/soci-mysql.h index aa79896a..f41b98c5 100644 --- a/backends/mysql/soci-mysql.h +++ b/backends/mysql/soci-mysql.h @@ -23,12 +23,23 @@ #ifndef SOCI_MYSQL_DECL # define SOCI_MYSQL_DECL #endif - -#include "soci-backend.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// #ifdef _WIN32 #include // SOCKET #endif // _WIN32 -#include // MySQL Client +// +// MySQL Client +#if defined(SOCI_MYSQL_HEADERS_BURIED) +# include +#else +# include +#endif #include diff --git a/backends/mysql/standard-into-type.cpp b/backends/mysql/standard-into-type.cpp index c74b16f9..cad4aa51 100644 --- a/backends/mysql/standard-into-type.cpp +++ b/backends/mysql/standard-into-type.cpp @@ -7,12 +7,19 @@ // #define SOCI_MYSQL_SOURCE -#include "soci-mysql.h" -#include #include "common.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// // std -#include #include +#include #include #include #include diff --git a/backends/mysql/standard-use-type.cpp b/backends/mysql/standard-use-type.cpp index 550ae61b..75cfced7 100644 --- a/backends/mysql/standard-use-type.cpp +++ b/backends/mysql/standard-use-type.cpp @@ -7,9 +7,16 @@ // #define SOCI_MYSQL_SOURCE -#include "soci-mysql.h" #include "common.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// // std #include #include diff --git a/backends/mysql/test/test-mysql.cpp b/backends/mysql/test/test-mysql.cpp index abccd012..3374569f 100644 --- a/backends/mysql/test/test-mysql.cpp +++ b/backends/mysql/test/test-mysql.cpp @@ -6,9 +6,17 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include "soci.h" -#include "soci-mysql.h" -#include "test/common-tests.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include #include #include @@ -18,8 +26,15 @@ #include #include #include -#include -#include +// +// MySQL Client +#if defined(SOCI_MYSQL_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif using namespace soci; using namespace soci::tests; diff --git a/backends/mysql/vector-into-type.cpp b/backends/mysql/vector-into-type.cpp index 12487ceb..597900ea 100644 --- a/backends/mysql/vector-into-type.cpp +++ b/backends/mysql/vector-into-type.cpp @@ -7,9 +7,16 @@ // #define SOCI_MYSQL_SOURCE -#include "soci-mysql.h" #include "common.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// #include #include diff --git a/backends/mysql/vector-use-type.cpp b/backends/mysql/vector-use-type.cpp index 6a217651..506aae22 100644 --- a/backends/mysql/vector-use-type.cpp +++ b/backends/mysql/vector-use-type.cpp @@ -7,9 +7,15 @@ // #define SOCI_MYSQL_SOURCE -#include "soci-mysql.h" #include "common.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif // std #include #include diff --git a/backends/oracle/blob.cpp b/backends/oracle/blob.cpp index 2636e665..87362b00 100644 --- a/backends/oracle/blob.cpp +++ b/backends/oracle/blob.cpp @@ -5,9 +5,16 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include "soci-oracle.h" #include "error.h" -#include "statement.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// #include #include #include diff --git a/backends/oracle/error.h b/backends/oracle/error.h index 2dbe9214..8a6edc01 100644 --- a/backends/oracle/error.h +++ b/backends/oracle/error.h @@ -7,8 +7,13 @@ #ifndef SOCI_ORACLE_ERROR_H_INCLUDED #define SOCI_ORACLE_ERROR_H_INCLUDED - -#include "soci-oracle.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// namespace soci { diff --git a/backends/oracle/soci-oracle.h b/backends/oracle/soci-oracle.h index 32d448a9..b44b71ac 100644 --- a/backends/oracle/soci-oracle.h +++ b/backends/oracle/soci-oracle.h @@ -23,7 +23,13 @@ # define SOCI_ORACLE_DECL #endif -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// #include // OCI #include diff --git a/backends/oracle/standard-into-type.cpp b/backends/oracle/standard-into-type.cpp index 1c09b156..67d1ec23 100644 --- a/backends/oracle/standard-into-type.cpp +++ b/backends/oracle/standard-into-type.cpp @@ -6,12 +6,23 @@ // #define SOCI_ORACLE_SOURCE -#include "soci-oracle.h" -#include "blob.h" -#include "error.h" -#include "rowid.h" -#include "statement.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +# include +# include +# include +#else +# include +# include +# include +# include +# include "error.h" +# include +#endif +// #include #include #include diff --git a/backends/oracle/standard-use-type.cpp b/backends/oracle/standard-use-type.cpp index 711d93c6..bc05963f 100644 --- a/backends/oracle/standard-use-type.cpp +++ b/backends/oracle/standard-use-type.cpp @@ -5,13 +5,24 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#define soci_ORACLE_SOURCE -#include "soci-oracle.h" -#include "blob.h" -#include "error.h" -#include "rowid.h" -#include "statement.h" -#include +#define SOCI_ORACLE_SOURCE +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +# include +# include +# include +#else +# include +# include +# include +# include +# include "error.h" +# include +#endif +// #include #include #include diff --git a/backends/oracle/statement.cpp b/backends/oracle/statement.cpp index 5ea75f1e..9c377c4b 100644 --- a/backends/oracle/statement.cpp +++ b/backends/oracle/statement.cpp @@ -6,10 +6,17 @@ // #define soci_ORACLE_SOURCE - -#include "soci-oracle.h" -#include "error.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include #include #include diff --git a/backends/oracle/test/test-oracle.cpp b/backends/oracle/test/test-oracle.cpp index 89ffe11c..b85dbd31 100644 --- a/backends/oracle/test/test-oracle.cpp +++ b/backends/oracle/test/test-oracle.cpp @@ -5,11 +5,20 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include "soci.h" -#include "soci-oracle.h" -#include "common-tests.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include #include +#include #include #include @@ -1170,7 +1179,7 @@ int main(int argc, char** argv) std::cout << "\nOK, all tests passed.\n\n"; - return EXIT_SUCCESS + return EXIT_SUCCESS; } catch (std::exception const & e) { diff --git a/backends/oracle/vector-into-type.cpp b/backends/oracle/vector-into-type.cpp index 1b2d491b..8ac34a6d 100644 --- a/backends/oracle/vector-into-type.cpp +++ b/backends/oracle/vector-into-type.cpp @@ -6,10 +6,19 @@ // #define soci_ORACLE_SOURCE -#include "soci-oracle.h" -#include "statement.h" -#include "error.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +# include +#else +# include +# include +# include "error.h" +# include +#endif +// #include #include #include diff --git a/backends/oracle/vector-use-type.cpp b/backends/oracle/vector-use-type.cpp index 1dd446e2..d46f8435 100644 --- a/backends/oracle/vector-use-type.cpp +++ b/backends/oracle/vector-use-type.cpp @@ -6,9 +6,17 @@ // #define soci_ORACLE_SOURCE -#include "soci-oracle.h" -#include "error.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include #include #include diff --git a/backends/postgresql/common.cpp b/backends/postgresql/common.cpp index d099c2df..6799d222 100644 --- a/backends/postgresql/common.cpp +++ b/backends/postgresql/common.cpp @@ -6,7 +6,13 @@ // #include "common.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// #include #include diff --git a/backends/postgresql/soci-postgresql.h b/backends/postgresql/soci-postgresql.h index fcdae75d..22b74927 100644 --- a/backends/postgresql/soci-postgresql.h +++ b/backends/postgresql/soci-postgresql.h @@ -23,7 +23,13 @@ # define SOCI_POSTGRESQL_DECL #endif -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// #include #include diff --git a/backends/postgresql/standard-into-type.cpp b/backends/postgresql/standard-into-type.cpp index 6c37ade2..c429683b 100644 --- a/backends/postgresql/standard-into-type.cpp +++ b/backends/postgresql/standard-into-type.cpp @@ -6,10 +6,18 @@ // #define SOCI_POSTGRESQL_SOURCE -#include "soci-postgresql.h" #include "common.h" -#include "rowid.h" -#include "blob.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include // libpq #include #include diff --git a/backends/postgresql/standard-use-type.cpp b/backends/postgresql/standard-use-type.cpp index 05c2b942..baccb9d1 100644 --- a/backends/postgresql/standard-use-type.cpp +++ b/backends/postgresql/standard-use-type.cpp @@ -6,10 +6,19 @@ // #define SOCI_POSTGRESQL_SOURCE -#include "soci-postgresql.h" -#include "blob.h" -#include "rowid.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +# include +#else +# include +# include +# include +# include +#endif +// #include // libpq #include #include diff --git a/backends/postgresql/test/test-postgresql.cpp b/backends/postgresql/test/test-postgresql.cpp index 57379d9f..838eb214 100644 --- a/backends/postgresql/test/test-postgresql.cpp +++ b/backends/postgresql/test/test-postgresql.cpp @@ -5,9 +5,17 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include "soci.h" -#include "soci-postgresql.h" -#include "common-tests.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include #include #include diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt deleted file mode 100644 index 3c4a3b83..00000000 --- a/cmake/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ - -################################################################################# -# -# This file is part of CMake configuration for SOCI library -# -# Copyright (C) 2009 Mateusz Loskot -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -# -################################################################################# - -# install the cmake modules - -file(GLOB SOCI_CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.cmake") diff --git a/cmake/SociBackend.cmake b/cmake/SociBackend.cmake deleted file mode 100644 index d34d152d..00000000 --- a/cmake/SociBackend.cmake +++ /dev/null @@ -1,327 +0,0 @@ -################################################################################ -# SociBackend.cmake - part of CMake configuration of SOCI library -################################################################################ -# Copyright (C) 2010 Mateusz Loskot -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -################################################################################ -# Macros in this module: -# -# soci_backend -# - defines project of a database backend for SOCI library -# -# soci_backend_test -# - defines test project of a database backend for SOCI library -################################################################################ - -# Defines project of a database backend for SOCI library -# -# soci_backend(backendname -# HEADERS header1 header2 -# DEPENDS dependency1 dependency2 -# DESCRIPTION description -# AUTHORS author1 author2 -# MAINTAINERS maintainer1 maintainer2) -# -macro(soci_backend NAME) - parse_arguments(THIS_BACKEND - "HEADERS;DEPENDS;DESCRIPTION;AUTHORS;MAINTAINERS;" - "" - ${ARGN}) - - message(STATUS "") - colormsg(HIGREEN "${NAME} - ${THIS_BACKEND_DESCRIPTION}") - - # Backend name variants utils - string(TOLOWER "${PROJECT_NAME}" PROJECTNAMEL) - string(TOLOWER "${NAME}" NAMEL) - string(TOUPPER "${NAME}" NAMEU) - - # Backend option available to user - set(THIS_BACKEND_OPTION SOCI_${NAMEU}) - option(${THIS_BACKEND_OPTION} - "Attempt to build ${PROJECT_NAME} backend for ${NAME}" ON) - - # Determine required dependencies - set(THIS_BACKEND_DEPENDS_INCLUDE_DIRS) - set(THIS_BACKEND_DEPENDS_LIBRARIES) - set(THIS_BACKEND_DEPENDS_DEFS) - set(DEPENDS_NOT_FOUND) - - # CMake 2.8+ syntax only: - #foreach(dep IN LISTS THIS_BACKEND_DEPENDS) - foreach(dep ${THIS_BACKEND_DEPENDS}) - - soci_check_package_found(${dep} DEPEND_FOUND) - if(NOT DEPEND_FOUND) - list(APPEND DEPENDS_NOT_FOUND ${dep}) - else() - string(TOUPPER "${dep}" DEPU) - list(APPEND THIS_BACKEND_DEPENDS_INCLUDE_DIRS ${${DEPU}_INCLUDE_DIR}) - list(APPEND THIS_BACKEND_DEPENDS_INCLUDE_DIRS ${${DEPU}_INCLUDE_DIRS}) - list(APPEND THIS_BACKEND_DEPENDS_LIBRARIES ${${DEPU}_LIBRARIES}) - list(APPEND THIS_BACKEND_DEPENDS_DEFS -DHAVE_${DEPU}=1) - endif() - endforeach() - - list(LENGTH DEPENDS_NOT_FOUND NOT_FOUND_COUNT) - - if (NOT_FOUND_COUNT GREATER 0) - - colormsg(_RED_ "WARNING:") - colormsg(RED "Some required dependencies of ${NAME} backend not found:") - - if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8) - foreach(dep ${DEPENDS_NOT_FOUND}) - colormsg(RED " ${dep}") - endforeach() - else() - foreach(dep IN LISTS DEPENDS_NOT_FOUND) - colormsg(RED " ${dep}") - endforeach() - endif() - - # TODO: Abort or warn compilation may fail? --mloskot - colormsg(RED "Skipping") - - set(${THIS_BACKEND_OPTION} OFF) - - else(NOT_FOUND_COUNT GREATER 0) - - if(${THIS_BACKEND_OPTION}) - - # Backend-specific include directories - list(APPEND THIS_BACKEND_DEPENDS_INCLUDE_DIRS ${SOCI_SOURCE_DIR}/core) - set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES - "${THIS_BACKEND_DEPENDS_INCLUDE_DIRS}") - - # Backend-specific preprocessor definitions - add_definitions(${THIS_BACKEND_DEPENDS_DEFS}) - - # Backend installable headers and sources - if (NOT THIS_BACKEND_HEADERS) - file(GLOB THIS_BACKEND_HEADERS *.h) - endif() - file(GLOB THIS_BACKEND_SOURCES *.cpp) - set(THIS_BACKEND_HEADERS_VAR SOCI_${NAMEU}_HEADERS) - set(${THIS_BACKEND_HEADERS_VAR} ${THIS_BACKEND_HEADERS}) - - # Group source files for IDE source explorers (e.g. Visual Studio) - source_group("Header Files" FILES ${THIS_BACKEND_HEADERS}) - source_group("Source Files" FILES ${THIS_BACKEND_SOURCES}) - source_group("CMake Files" FILES CMakeLists.txt) - - # Backend target - set(THIS_BACKEND_TARGET ${PROJECTNAMEL}_${NAMEL}) - set(THIS_BACKEND_TARGET_VAR SOCI_${NAMEU}_TARGET) - set(${THIS_BACKEND_TARGET_VAR} ${THIS_BACKEND_TARGET}) - - soci_target_output_name(${THIS_BACKEND_TARGET} ${THIS_BACKEND_TARGET_VAR}_OUTPUT_NAME) - - set(THIS_BACKEND_TARGET_OUTPUT_NAME ${${THIS_BACKEND_TARGET_VAR}_OUTPUT_NAME}) - set(THIS_BACKEND_TARGET_OUTPUT_NAME_VAR ${THIS_BACKEND_TARGET_VAR}_OUTPUT_NAME) - - # TODO: Extract as macros: soci_shared_lib_target and soci_static_lib_target --mloskot - - # Shared library target - add_library(${THIS_BACKEND_TARGET} - SHARED - ${THIS_BACKEND_SOURCES} - ${THIS_BACKEND_HEADERS}) - - target_link_libraries(${THIS_BACKEND_TARGET} - ${SOCI_CORE_TARGET} - ${THIS_BACKEND_DEPENDS_LIBRARIES}) - - if(WIN32) - set_target_properties(${THIS_BACKEND_TARGET} - PROPERTIES - OUTPUT_NAME ${THIS_BACKEND_TARGET_OUTPUT_NAME} - DEFINE_SYMBOL SOCI_DLL) - else() - set_target_properties(${THIS_BACKEND_TARGET} - PROPERTIES - SOVERSION ${${PROJECT_NAME}_SOVERSION}) - endif() - - set_target_properties(${THIS_BACKEND_TARGET} - PROPERTIES - VERSION ${${PROJECT_NAME}_VERSION} - CLEAN_DIRECT_OUTPUT 1) - - # Static library target - add_library(${THIS_BACKEND_TARGET}-static - STATIC - ${THIS_BACKEND_SOURCES} - ${THIS_BACKEND_HEADERS}) - - set_target_properties(${THIS_BACKEND_TARGET}-static - PROPERTIES - OUTPUT_NAME ${THIS_BACKEND_TARGET_OUTPUT_NAME} - PREFIX "lib" - CLEAN_DIRECT_OUTPUT 1) - - # Backend installation - install(FILES ${THIS_BACKEND_HEADERS} - DESTINATION - ${INCLUDEDIR}/${PROJECTNAMEL}/${NAMEL}) - - install(TARGETS ${THIS_BACKEND_TARGET} ${THIS_BACKEND_TARGET}-static - RUNTIME DESTINATION ${BINDIR} - LIBRARY DESTINATION ${LIBDIR} - ARCHIVE DESTINATION ${LIBDIR}) - - else() - colormsg(HIRED "${NAME}" RED "backend disabled, since") - endif() - - endif(NOT_FOUND_COUNT GREATER 0) - - boost_report_value(${THIS_BACKEND_OPTION}) - - if(${THIS_BACKEND_OPTION}) - boost_report_value(${THIS_BACKEND_TARGET_VAR}) - boost_report_value(${THIS_BACKEND_TARGET_OUTPUT_NAME_VAR}) - boost_report_value(${THIS_BACKEND_HEADERS_VAR}) - - soci_report_directory_property(COMPILE_DEFINITIONS) - endif() - - # LOG - #message("soci_backend:") - #message("NAME: ${NAME}") - #message("${THIS_BACKEND_OPTION} = ${SOCI_BACKEND_SQLITE3}") - #message("DEPENDS: ${THIS_BACKEND_DEPENDS}") - #message("DESCRIPTION: ${THIS_BACKEND_DESCRIPTION}") - #message("AUTHORS: ${THIS_BACKEND_AUTHORS}") - #message("MAINTAINERS: ${THIS_BACKEND_MAINTAINERS}") - #message("HEADERS: ${THIS_BACKEND_HEADERS}") - #message("SOURCES: ${THIS_BACKEND_SOURCES}") - #message("DEPENDS_LIBRARIES: ${THIS_BACKEND_DEPENDS_LIBRARIES}") - #message("DEPENDS_INCLUDE_DIRS: ${THIS_BACKEND_DEPENDS_INCLUDE_DIRS}") -endmacro() - -# Generates .vcxproj.user for target of each test. -# -# soci_backend_test_create_vcxproj_user( -# PostgreSQLTest -# "host=localhost dbname=soci_test user=mloskot") -# -function(soci_backend_test_create_vcxproj_user TARGET_NAME TEST_CMD_ARGS) - if(MSVC) - set(SYSTEM_NAME $ENV{USERDOMAIN}) - set(USER_NAME $ENV{USERNAME}) - set(SOCI_TEST_CMD_ARGS ${TEST_CMD_ARGS}) - - if(MSVC_VERSION EQUAL 1600) - configure_file( - ${SOCI_SOURCE_DIR}/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in - ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.vcxproj.user - @ONLY) - endif() - endif() -endfunction(soci_backend_test_create_vcxproj_user) - -# Defines test project of a database backend for SOCI library -# -# soci_backend_test(BACKEND mybackend SOURCE mytest1.cpp -# NAME mytest1 -# CONNSTR "my test connection" -# DEPENDS library1 library2) -# -macro(soci_backend_test) - parse_arguments(THIS_TEST - "BACKEND;SOURCE;CONNSTR;NAME;DEPENDS;" - "" - ${ARGN}) - - # Test backend name - string(TOUPPER "${THIS_TEST_BACKEND}" BACKENDU) - string(TOLOWER "${THIS_TEST_BACKEND}" BACKENDL) - - if(SOCI_TESTS AND SOCI_${BACKENDU}) - - # Test name - if(THIS_TEST_NAME) - string(TOUPPER "${THIS_TEST_NAME}" NAMEU) - set(TEST_FULL_NAME SOCI_${BACKENDU}_TEST_${NAMEU}) - else() - set(TEST_FULL_NAME SOCI_${BACKENDU}_TEST) - endif() - - set(TEST_CONNSTR_VAR ${TEST_FULL_NAME}_CONNSTR) - set(${TEST_CONNSTR_VAR} "" - CACHE STRING "Connection string for ${BACKENDU} test") - - if(NOT ${TEST_CONNSTR_VAR} AND THIS_TEST_CONNSTR) - set(${TEST_CONNSTR_VAR} ${THIS_TEST_CONNSTR}) - endif() - boost_report_value(${TEST_CONNSTR_VAR}) - - include_directories(${SOCI_SOURCE_DIR}/core/test) - include_directories(${SOCI_SOURCE_DIR}/backends/${BACKENDL}) - - # TODO: Find more generic way of adding Boost to core and backend tests only. - # Ideally, from within Boost.cmake. - set(SOCI_TEST_DEPENDENCIES) - if(Boost_FOUND) - include_directories(${Boost_INCLUDE_DIRS}) - if(Boost_DATE_TIME_FOUND) - set(SOCI_TEST_DEPENDENCIES ${Boost_DATE_TIME_LIBRARY}) - add_definitions(-DHAVE_BOOST_DATE_TIME=1) - endif() - endif() - - string(TOLOWER "${TEST_FULL_NAME}" TEST_TARGET) - - set(TEST_HEADERS ${PROJECT_SOURCE_DIR}/core/test/common-tests.h) - - add_executable(${TEST_TARGET} ${TEST_HEADERS} ${THIS_TEST_SOURCE}) - add_executable(${TEST_TARGET}_static ${TEST_HEADERS} ${THIS_TEST_SOURCE}) - - target_link_libraries(${TEST_TARGET} - ${SOCI_CORE_TARGET} - ${SOCI_${BACKENDU}_TARGET} - ${${BACKENDU}_LIBRARIES} - ${SOCI_TEST_DEPENDENCIES}) - - target_link_libraries(${TEST_TARGET}_static - ${SOCI_CORE_TARGET}-static - ${SOCI_${BACKENDU}_TARGET}-static - ${${BACKENDU}_LIBRARIES} - ${SOCI_CORE_STATIC_DEPENDENCIES} - ${SOCI_TEST_DEPENDENCIES}) - - add_test(${TEST_TARGET} - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_TARGET} - ${${TEST_CONNSTR_VAR}}) - - add_test(${TEST_TARGET}_static - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_TARGET}_static - ${${TEST_CONNSTR_VAR}}) - - # Convenient .vcxproj.user making tests ready to run and debug from within IDE - soci_backend_test_create_vcxproj_user(${TEST_TARGET} "\"${${TEST_CONNSTR_VAR}}\"") - soci_backend_test_create_vcxproj_user(${TEST_TARGET}_static "\"${${TEST_CONNSTR_VAR}}\"") - - # Ask make check to try to build tests first before executing them - add_dependencies(check ${TEST_TARGET} ${TEST_TARGET}_static) - - # Group source files for IDE source explorers (e.g. Visual Studio) - source_group("Header Files" FILES ${TEST_HEADERS}) - source_group("Source Files" FILES ${THIS_TEST_SOURCE}) - source_group("CMake Files" FILES CMakeLists.txt) - - endif() - - # LOG - #message("NAME=${NAME}") - #message("THIS_TEST_NAME=${THIS_TEST_NAME}") - #message("THIS_TEST_BACKEND=${THIS_TEST_BACKEND}") - #message("THIS_TEST_CONNSTR=${THIS_TEST_CONNSTR}") - #message("THIS_TEST_SOURCE=${THIS_TEST_SOURCE}") - #message("THIS_TEST_OPTION=${THIS_TEST_OPTION}") - -endmacro() diff --git a/cmake/SociConfig.cmake b/cmake/SociConfig.cmake deleted file mode 100644 index 7e14171e..00000000 --- a/cmake/SociConfig.cmake +++ /dev/null @@ -1,49 +0,0 @@ -################################################################################ -# SociConfig.cmake - CMake build configuration of SOCI library -################################################################################ -# Copyright (C) 2010 Mateusz Loskot -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -################################################################################ - -# -# Force compilation flags and set desired warnings level -# - -if (MSVC) - if (MSVC80 OR MSVC90 OR MSVC10) - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) - add_definitions(-D_CRT_NONSTDC_NO_WARNING) - add_definitions(-D_SCL_SECURE_NO_WARNINGS) - endif() - - if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") - string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - endif() - -else() - - set(SOCI_GCC_CLANG_COMMON_FLAGS - "-pedantic -ansi -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long") - - if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${SOCI_GCC_CLANG_COMMON_FLAGS}") - if (CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") - endif() - - elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER}" MATCHES "clang") - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SOCI_GCC_CLANG_COMMON_FLAGS}") - - else() - message(FATAL_ERROR "CMake is unable to recognize compilation toolset to build SOCI for you!") - endif() - -endif() diff --git a/cmake/SociDependencies.cmake b/cmake/SociDependencies.cmake deleted file mode 100644 index a2a25937..00000000 --- a/cmake/SociDependencies.cmake +++ /dev/null @@ -1,81 +0,0 @@ -################################################################################ -# SociDependencies.cmake - part of CMake configuration of SOCI library -# -# Based on BoostExternals.cmake from CMake configuration for Boost -################################################################################ -# Copyright (C) 2010 Mateusz Loskot -# Copyright (C) 2009 Troy Straszheim -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -################################################################################ -# Macros in this module: -# -# soci_backend - defines a database backend for SOCI library -# -################################################################################ - -# -# List of SOCI dependncies -# -set(SOCI_BACKENDS_ALL_DEPENDENCIES - Boost - MySQL - ODBC - Oracle - PostgreSQL - SQLite3) - -# -# Perform checks -# -message(STATUS "") -colormsg(_HIBLUE_ "Looking for SOCI dependencies:") - -macro(boost_external_report NAME) - - set(VARNAME ${NAME}) - set(SUCCESS ${${VARNAME}_FOUND}) - - set(VARNAMES ${ARGV}) - list(REMOVE_AT VARNAMES 0) - - # Test both, given original name and uppercase version too - if(NOT SUCCESS) - string(TOUPPER ${NAME} VARNAME) - set(SUCCESS ${${VARNAME}_FOUND}) - if(NOT SUCCESS) - colormsg(_RED_ "WARNING:") - colormsg(RED "${NAME} not found, some libraries or features will be disabled.") - colormsg(RED "See the documentation for ${NAME} or manually set these variables:") - endif() - endif() - - foreach(variable ${VARNAMES}) - boost_report_value(${VARNAME}_${variable}) - endforeach() -endmacro() - -# -# Some externals default to OFF -# -option(WITH_VALGRIND "Run tests under valgrind" OFF) - -# -# Detect available dependencies -# -foreach(external ${SOCI_BACKENDS_ALL_DEPENDENCIES}) - - message(STATUS "") - string(TOUPPER "${external}" EXTERNAL) - option(WITH_${EXTERNAL} "Attempt to find and configure ${external}" ON) - if(WITH_${EXTERNAL}) - colormsg(HICYAN "${external}:") - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies/${external}.cmake) - else() - set(${EXTERNAL}_FOUND FALSE CACHE BOOL "${external} found" FORCE) - colormsg(HIRED "${external}:" RED "disabled, since WITH_${EXTERNAL}=OFF") - endif() -endforeach() -message(STATUS "") diff --git a/cmake/SociSystemInfo.cmake b/cmake/SociSystemInfo.cmake deleted file mode 100644 index c6690b2a..00000000 --- a/cmake/SociSystemInfo.cmake +++ /dev/null @@ -1,77 +0,0 @@ -################################################################################ -# SociSystemInfo.cmake - part of CMake configuration of SOCI library -# -# Based on idea taken from http://code.google.com/p/softart/ project -################################################################################ -# Copyright (C) 2010 Mateusz Loskot -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -################################################################################ -# The following variables are defined: -# SOCI_COMPILER_NAME - name of compiler toolset, follows Boost toolset naming. -# SOCI_PLATFORM_NAME - target platform name: x64, x86 or win32 -################################################################################ - -set(SOCI_COMPILER_NAME) -set(SOCI_PLATFORM_NAME) - -if(MINGW OR UNIX) - exec_program(gcc ARGS -dumpversion OUTPUT_VARIABLE GCC_VERSION) - string(REPLACE "." "" GCC_VERSION_STR_FULL ${GCC_VERSION}) - string(REGEX MATCH "[0-9]+\\.[0-9]+" GCC_VERSION_MAJOR_MINOR ${GCC_VERSION}) -endif() - -if(WIN32) - # Compilers, taken from http://predef.sourceforge.net/precomp.html#sec34 - if(MSVC) - if(MSVC_VERSION EQUAL 1200) - set(SOCI_COMPILER_NAME "msvc-6.0") - endif() - if(MSVC_VERSION EQUAL 1300) - set(SOCI_COMPILER_NAME "msvc-7.0") - endif() - if(MSVC_VERSION EQUAL 1310) - set(SOCI_COMPILER_NAME "msvc-7.1") #Visual Studio 2003 - endif() - if(MSVC_VERSION EQUAL 1400) - set(SOCI_COMPILER_NAME "msvc-8.0") #Visual Studio 2005 - endif() - if(MSVC_VERSION EQUAL 1500) - set(SOCI_COMPILER_NAME "msvc-9.0") #Visual Studio 2008 - endif() - if(MSVC_VERSION EQUAL 1600) - set(SOCI_COMPILER_NAME "msvc-10.0") #Visual Studio 2010 - endif() - endif(MSVC) - - if(MINGW) - set(SOCI_COMPILER_NAME "mingw-${GCC_VERSION}") - endif( MINGW ) - - if(CMAKE_GENERATOR MATCHES "Win64") - set(SOCI_PLATFORM_NAME "x64") - else() - set(SOCI_PLATFORM_NAME "win32") - endif() -endif(WIN32) - -if(UNIX) - set(SOCI_COMPILER_NAME "gcc-${GCC_VERSION}") - if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - set(SOCI_PLATFORM_NAME "x64") - else() - set(SOCI_PLATFORM_NAME "x86") - endif() -endif(UNIX) - -if(NOT SOCI_COMPILER_NAME) - colormsg(_RED_ "WARNING:") - colormsg(RED "Could not determine compiler toolset name to set SOCI_COMPILER_NAME variable.") -endif() - -if(NOT SOCI_PLATFORM_NAME) - colormsg(_RED_ "WARNING:") - colormsg(RED "Could not determine platform name to set SOCI_PLATFORM_NAME variable.") -endif() diff --git a/cmake/SociUtilities.cmake b/cmake/SociUtilities.cmake deleted file mode 100644 index 05e91532..00000000 --- a/cmake/SociUtilities.cmake +++ /dev/null @@ -1,416 +0,0 @@ -################################################################################ -# SociUtilities.cmake - part of CMake configuration of SOCI library -# -# Based on BoostUtilities.cmake from CMake configuration for Boost -################################################################################ -# Copyright (C) 2007 Douglas Gregor -# Copyright (C) 2007 Troy Straszheim -# Copyright (C) 2010 Mateusz Loskot -# -# Distributed under the Boost Software License, Version 1.0. -# See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt -################################################################################ -# Macros in this module: -# -# list_contains: Determine whether a string value is in a list. -# -# car: Return the first element in a list -# -# cdr: Return all but the first element in a list -# -# parse_arguments: Parse keyword arguments for use in other macros. -# -# soci_check_package_found: Test varname-FOUND for case-insensitive varname -# -################################################################################ - -# This utility macro determines whether a particular string value -# occurs within a list of strings: -# -# list_contains(result string_to_find arg1 arg2 arg3 ... argn) -# -# This macro sets the variable named by result equal to TRUE if -# string_to_find is found anywhere in the following arguments. -macro(list_contains var value) - set(${var}) - foreach (value2 ${ARGN}) - if (${value} STREQUAL ${value2}) - set(${var} TRUE) - endif (${value} STREQUAL ${value2}) - endforeach (value2) -endmacro(list_contains) - -# This utility macro extracts the first argument from the list of -# arguments given, and places it into the variable named var. -# -# car(var arg1 arg2 ...) -macro(car var) - set(${var} ${ARGV1}) -endmacro(car) - -# This utility macro extracts all of the arguments given except the -# first, and places them into the variable named var. -# -# car(var arg1 arg2 ...) -macro(cdr var junk) - set(${var} ${ARGN}) -endmacro(cdr) - -# The parse_arguments macro will take the arguments of another macro and -# define several variables. The first argument to parse_arguments is a -# prefix to put on all variables it creates. The second argument is a -# list of names, and the third argument is a list of options. Both of -# these lists should be quoted. The rest of parse_arguments are -# arguments from another macro to be parsed. -# -# parse_arguments(prefix arg_names options arg1 arg2...) -# -# For each item in options, parse_arguments will create a variable with -# that name, prefixed with prefix_. So, for example, if prefix is -# MY_MACRO and options is OPTION1;OPTION2, then parse_arguments will -# create the variables MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These -# variables will be set to true if the option exists in the command line -# or false otherwise. -# -# For each item in arg_names, parse_arguments will create a variable -# with that name, prefixed with prefix_. Each variable will be filled -# with the arguments that occur after the given arg_name is encountered -# up to the next arg_name or the end of the arguments. All options are -# removed from these lists. parse_arguments also creates a -# prefix_DEFAULT_ARGS variable containing the list of all arguments up -# to the first arg_name encountered. -macro(parse_arguments prefix arg_names option_names) - set(DEFAULT_ARGS) - foreach(arg_name ${arg_names}) - set(${prefix}_${arg_name}) - endforeach(arg_name) - foreach(option ${option_names}) - set(${prefix}_${option} FALSE) - endforeach(option) - - set(current_arg_name DEFAULT_ARGS) - set(current_arg_list) - foreach(arg ${ARGN}) - list_contains(is_arg_name ${arg} ${arg_names}) - if (is_arg_name) - set(${prefix}_${current_arg_name} ${current_arg_list}) - set(current_arg_name ${arg}) - set(current_arg_list) - else (is_arg_name) - list_contains(is_option ${arg} ${option_names}) - if (is_option) - set(${prefix}_${arg} TRUE) - else (is_option) - set(current_arg_list ${current_arg_list} ${arg}) - endif (is_option) - endif (is_arg_name) - endforeach(arg) - set(${prefix}_${current_arg_name} ${current_arg_list}) -endmacro(parse_arguments) - -# Perform a reverse topological sort on the given LIST. -# -# topological_sort(my_list "MY_" "_EDGES") -# -# LIST is the name of a variable containing a list of elements to be -# sorted in reverse topological order. Each element in the list has a -# set of outgoing edges (for example, those other list elements that -# it depends on). In the resulting reverse topological ordering -# (written back into the variable named LIST), an element will come -# later in the list than any of the elements that can be reached by -# following its outgoing edges and the outgoing edges of any vertices -# they target, recursively. Thus, if the edges represent dependencies -# on build targets, for example, the reverse topological ordering is -# the order in which one would build those targets. -# -# For each element E in this list, the edges for E are contained in -# the variable named ${PREFIX}${E}${SUFFIX}, where E is the -# upper-cased version of the element in the list. If no such variable -# exists, then it is assumed that there are no edges. For example, if -# my_list contains a, b, and c, one could provide a dependency graph -# using the following variables: -# -# MY_A_EDGES b -# MY_B_EDGES -# MY_C_EDGES a b -# -# With the involcation of topological_sort shown above and these -# variables, the resulting reverse topological ordering will be b, a, -# c. -function(topological_sort LIST PREFIX SUFFIX) - # Clear the stack and output variable - set(VERTICES "${${LIST}}") - set(STACK) - set(${LIST}) - - # Loop over all of the vertices, starting the topological sort from - # each one. - foreach(VERTEX ${VERTICES}) - string(TOUPPER ${VERTEX} UPPER_VERTEX) - - # If we haven't already processed this vertex, start a depth-first - # search from where. - if (NOT FOUND_${UPPER_VERTEX}) - # Push this vertex onto the stack with all of its outgoing edges - string(REPLACE ";" " " NEW_ELEMENT - "${VERTEX};${${PREFIX}${UPPER_VERTEX}${SUFFIX}}") - list(APPEND STACK ${NEW_ELEMENT}) - - # We've now seen this vertex - set(FOUND_${UPPER_VERTEX} TRUE) - - # While the depth-first search stack is not empty - list(LENGTH STACK STACK_LENGTH) - while(STACK_LENGTH GREATER 0) - # Remove the vertex and its remaining out-edges from the top - # of the stack - list(GET STACK -1 OUT_EDGES) - list(REMOVE_AT STACK -1) - - # Get the source vertex and the list of out-edges - separate_arguments(OUT_EDGES) - list(GET OUT_EDGES 0 SOURCE) - list(REMOVE_AT OUT_EDGES 0) - - # While there are still out-edges remaining - list(LENGTH OUT_EDGES OUT_DEGREE) - while (OUT_DEGREE GREATER 0) - # Pull off the first outgoing edge - list(GET OUT_EDGES 0 TARGET) - list(REMOVE_AT OUT_EDGES 0) - - string(TOUPPER ${TARGET} UPPER_TARGET) - if (NOT FOUND_${UPPER_TARGET}) - # We have not seen the target before, so we will traverse - # its outgoing edges before coming back to our - # source. This is the key to the depth-first traversal. - - # We've now seen this vertex - set(FOUND_${UPPER_TARGET} TRUE) - - # Push the remaining edges for the current vertex onto the - # stack - string(REPLACE ";" " " NEW_ELEMENT - "${SOURCE};${OUT_EDGES}") - list(APPEND STACK ${NEW_ELEMENT}) - - # Setup the new source and outgoing edges - set(SOURCE ${TARGET}) - string(TOUPPER ${SOURCE} UPPER_SOURCE) - set(OUT_EDGES - ${${PREFIX}${UPPER_SOURCE}${SUFFIX}}) - endif(NOT FOUND_${UPPER_TARGET}) - - list(LENGTH OUT_EDGES OUT_DEGREE) - endwhile (OUT_DEGREE GREATER 0) - - # We have finished all of the outgoing edges for - # SOURCE; add it to the resulting list. - list(APPEND ${LIST} ${SOURCE}) - - # Check the length of the stack - list(LENGTH STACK STACK_LENGTH) - endwhile(STACK_LENGTH GREATER 0) - endif (NOT FOUND_${UPPER_VERTEX}) - endforeach(VERTEX) - - set(${LIST} ${${LIST}} PARENT_SCOPE) -endfunction(topological_sort) - -# Small little hack that tweaks a component name (as used for CPack) -# to make sure to avoid certain names that cause problems. Sets the -# variable named varname to the "sanitized" name. -# -# FIXME: This is a complete hack. We probably need to fix the CPack -# generators (NSIS in particular) to get rid of the need for this. -macro(fix_cpack_component_name varname name) - if (${name} STREQUAL "foreach") - set(${varname} "boost_foreach") - else() - set(${varname} ${name}) - endif() -endmacro() - - -# -# A big shout out to the cmake gurus @ compiz -# -function (colormsg) - string (ASCII 27 _escape) - set(WHITE "29") - set(GRAY "30") - set(RED "31") - set(GREEN "32") - set(YELLOW "33") - set(BLUE "34") - set(MAG "35") - set(CYAN "36") - - foreach (color WHITE GRAY RED GREEN YELLOW BLUE MAG CYAN) - set(HI${color} "1\;${${color}}") - set(LO${color} "2\;${${color}}") - set(_${color}_ "4\;${${color}}") - set(_HI${color}_ "1\;4\;${${color}}") - set(_LO${color}_ "2\;4\;${${color}}") - endforeach() - - set(str "") - set(coloron FALSE) - foreach(arg ${ARGV}) - if (NOT ${${arg}} STREQUAL "") - if (CMAKE_COLOR_MAKEFILE) - set(str "${str}${_escape}[${${arg}}m") - set(coloron TRUE) - endif() - else() - set(str "${str}${arg}") - if (coloron) - set(str "${str}${_escape}[0m") - set(coloron FALSE) - endif() - set(str "${str} ") - endif() - endforeach() - message(STATUS ${str}) -endfunction() - -# colormsg("Colors:" -# WHITE "white" GRAY "gray" GREEN "green" -# RED "red" YELLOW "yellow" BLUE "blue" MAG "mag" CYAN "cyan" -# _WHITE_ "white" _GRAY_ "gray" _GREEN_ "green" -# _RED_ "red" _YELLOW_ "yellow" _BLUE_ "blue" _MAG_ "mag" _CYAN_ "cyan" -# _HIWHITE_ "white" _HIGRAY_ "gray" _HIGREEN_ "green" -# _HIRED_ "red" _HIYELLOW_ "yellow" _HIBLUE_ "blue" _HIMAG_ "mag" _HICYAN_ "cyan" -# HIWHITE "white" HIGRAY "gray" HIGREEN "green" -# HIRED "red" HIYELLOW "yellow" HIBLUE "blue" HIMAG "mag" HICYAN "cyan" -# "right?") - -# -# pretty-prints the value of a variable so that the -# equals signs align -# -function(boost_report_value NAME) - string(LENGTH "${NAME}" varlen) - # LOG - #message(STATUS "boost_report_value: NAME=${NAME} (${varlen})") - #message(STATUS "boost_report_value: \${NAME}=${${NAME}}") - math(EXPR padding_len 40-${varlen}) - string(SUBSTRING " " - 0 ${padding_len} varpadding) - colormsg("${NAME}${varpadding} = ${${NAME}}") -endfunction() - -function(trace NAME) - if(BOOST_CMAKE_TRACE) - string(LENGTH "${NAME}" varlen) - math(EXPR padding_len 40-${varlen}) - string(SUBSTRING "........................................" - 0 ${padding_len} varpadding) - message("${NAME} ${varpadding} ${${NAME}}") - endif() -endfunction() - -# -# pretty-prints the value of a variable so that the -# equals signs align -# -function(boost_report_pretty PRETTYNAME VARNAME) - string(LENGTH "${PRETTYNAME}" varlen) - math(EXPR padding_len 30-${varlen}) - string(SUBSTRING " " - 0 ${padding_len} varpadding) - message(STATUS "${PRETTYNAME}${varpadding} = ${${VARNAME}}") -endfunction() - -# -# assert that ARG is actually a library target -# -macro(dependency_check ARG) - trace(ARG) - if (NOT "${ARG}" STREQUAL "") - get_target_property(deptype ${ARG} TYPE) - if(NOT deptype MATCHES ".*_LIBRARY$") - set(DEPENDENCY_OKAY FALSE) - list(APPEND DEPENDENCY_FAILURES ${ARG}) - endif() - endif() -endmacro() - -# -# Tests package-FOUND for varname in three cases as given, lowercase and -# uppercase. -# -macro(soci_check_package_found NAME SUCCESS) - - set(${SUCCESS} FALSE) - set(VARNAME ${NAME}) - set(VARNAME_SUCCESS ${${VARNAME}_FOUND}) - - # Test both, given original name and uppercase version too - if(VARNAME_SUCCESS) - set(${SUCCESS} TRUE) - else() - string(TOUPPER ${NAME} VARNAME) - set(VARNAME_SUCCESS ${${VARNAME}_FOUND}) - if(VARNAME_SUCCESS) - set(${SUCCESS} TRUE) - endif() - endif() -endmacro() - -# -# Pretty-print of given property of current directory. -# -macro(soci_report_directory_property PROPNAME) - get_directory_property(${PROPNAME} ${PROPNAME}) - boost_report_value(${PROPNAME}) -endmacro() - -# -# Scans the current directory and returns a list of subdirectories. -# Author: Robert Fleming -# Source: http://www.cmake.org/pipermail/cmake/2008-February/020114.html -# -# Third parameter is 1 if you want relative paths returned. -# Usage: list_subdirectories(the_list_is_returned_here /path/to/project TRUE) -# -macro(list_subdirectories retval curdir return_relative) - file(GLOB sub-dir RELATIVE ${curdir} *) - set(list_of_dirs "") - foreach(dir ${sub-dir}) - if(IS_DIRECTORY ${curdir}/${dir}) - if (${return_relative}) - set(list_of_dirs ${list_of_dirs} ${dir}) - else() - set(list_of_dirs ${list_of_dirs} ${curdir}/${dir}) - endif() - endif() - endforeach() - set(${retval} ${list_of_dirs}) -endmacro() - -# -# Generates output name for given target depending on platform and version. -# For instance, on Windows, libraries get ABI version suffix soci_coreXY.{dll|lib}. -# -function(soci_target_output_name TARGET_NAME OUTPUT_NAME) - if(NOT DEFINED TARGET_NAME) - message(SEND_ERROR "Error, the variable TARGET_NAME is not defined!") - endif() - - if(NOT DEFINED ${PROJECT_NAME}_VERSION) - message(SEND_ERROR "Error, the variable ${${PROJECT_NAME}_VERSION} is not defined!") - endif() - - # On Windows, ABI version is specified using binary file name suffix. - # On Unix, suffix is empty and SOVERSION is used instead. - if (WIN32) - string(LENGTH "${${PROJECT_NAME}_ABI_VERSION}" abilen) - if(abilen GREATER 0) - set(SUFFIX "_${${PROJECT_NAME}_ABI_VERSION}") - endif() - endif() - - set(${OUTPUT_NAME} ${TARGET_NAME}${SUFFIX} PARENT_SCOPE) -endfunction() diff --git a/cmake/SociVersion.cmake b/cmake/SociVersion.cmake deleted file mode 100644 index d4923caa..00000000 --- a/cmake/SociVersion.cmake +++ /dev/null @@ -1,59 +0,0 @@ -################################################################################ -# SociVersion.cmake - part of CMake configuration of SOCI library -################################################################################ -# Copyright (C) 2010 Mateusz Loskot -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -################################################################################ -# Macros in this module: -# -# soci_version - defines version information for SOCI library -# -################################################################################ - -# Defines version information for SOCI library -# -# soci_version(MAJOR major_version MINOR minor_version PATCH patch_level) -# -# MAJOR.MINOR version is used to set SOVERSION -# -macro(soci_version) - parse_arguments(THIS_VERSION "MAJOR;MINOR;PATCH;" - "" - ${ARGN}) - - # Set version components - set(${PROJECT_NAME}_VERSION_MAJOR ${THIS_VERSION_MAJOR}) - set(${PROJECT_NAME}_VERSION_MINOR ${THIS_VERSION_MINOR}) - set(${PROJECT_NAME}_VERSION_PATCH ${THIS_VERSION_PATCH}) - - # Set VERSION string - set(${PROJECT_NAME}_VERSION - "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}") - - # Set SOVERSION based on major and minor - set(${PROJECT_NAME}_SOVERSION - "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}") - - # Set ABI version string used to name binary output and, by SOCI loader, to find binaries. - # On Windows, ABI version is specified using binary file name suffix. - # On Unix, suffix ix empty and SOVERSION is used instead. - if (UNIX) - set(${PROJECT_NAME}_ABI_VERSION ${${PROJECT_NAME}_SOVERSION}) - elseif(WIN32) - set(${PROJECT_NAME}_ABI_VERSION - "${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}") - else() - message(FATAL_ERROR "Ambiguous target platform with unknown ABI version scheme. Giving up.") - endif() - - message(STATUS "") - - boost_report_value(${PROJECT_NAME}_VERSION) - boost_report_value(${PROJECT_NAME}_ABI_VERSION) - - add_definitions(-DSOCI_ABI_VERSION=${${PROJECT_NAME}_ABI_VERSION}) - -endmacro() diff --git a/cmake/dependencies/Boost.cmake b/cmake/dependencies/Boost.cmake deleted file mode 100644 index c64af9ee..00000000 --- a/cmake/dependencies/Boost.cmake +++ /dev/null @@ -1,14 +0,0 @@ -set(Boost_FIND_QUIETLY TRUE) - -set(Boost_USE_STATIC_LIBS ON) -set(Boost_USE_MULTITHREADED ON) -find_package(Boost 1.33.1 COMPONENTS date_time) - -if (NOT Boost_date_time_FOUND) - find_package(Boost 1.33.1) -endif() - -set(Boost_RELEASE_VERSION - "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") - -boost_external_report(Boost RELEASE_VERSION INCLUDE_DIR LIBRARIES) diff --git a/cmake/dependencies/MySQL.cmake b/cmake/dependencies/MySQL.cmake deleted file mode 100644 index 9cac7a22..00000000 --- a/cmake/dependencies/MySQL.cmake +++ /dev/null @@ -1,10 +0,0 @@ -set(MySQL_FIND_QUIETLY TRUE) - -find_package(MySQL) - -boost_external_report(MySQL INCLUDE_DIR LIBRARIES) - -#if(MYSQL_FOUND) -# include_directories(${MYSQL_INCLUDE_DIR}) -# add_definitions(-DHAVE_MYSQL) -#endif() \ No newline at end of file diff --git a/cmake/dependencies/ODBC.cmake b/cmake/dependencies/ODBC.cmake deleted file mode 100644 index 93aa9410..00000000 --- a/cmake/dependencies/ODBC.cmake +++ /dev/null @@ -1,10 +0,0 @@ -set(ODBC_FIND_QUIETLY TRUE) - -find_package(ODBC) - -boost_external_report(ODBC INCLUDE_DIRECTORIES LIBRARIES) - -#if(MYSQL_FOUND) -# include_directories(${MYSQL_INCLUDE_DIR}) -# add_definitions(-DHAVE_MYSQL) -#endif() \ No newline at end of file diff --git a/cmake/dependencies/Oracle.cmake b/cmake/dependencies/Oracle.cmake deleted file mode 100644 index c6645204..00000000 --- a/cmake/dependencies/Oracle.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(ORACLE_FIND_QUIETLY TRUE) - -find_package(Oracle) - -boost_external_report(Oracle INCLUDE_DIR LIBRARIES) diff --git a/cmake/dependencies/PostgreSQL.cmake b/cmake/dependencies/PostgreSQL.cmake deleted file mode 100644 index 4a4feeec..00000000 --- a/cmake/dependencies/PostgreSQL.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(PostgreSQL_FIND_QUIETLY TRUE) - -find_package(PostgreSQL) - -boost_external_report(PostgreSQL INCLUDE_DIR LIBRARIES VERSION) \ No newline at end of file diff --git a/cmake/dependencies/SQLite3.cmake b/cmake/dependencies/SQLite3.cmake deleted file mode 100644 index 0daa9a59..00000000 --- a/cmake/dependencies/SQLite3.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(SQLITE3_FIND_QUIETLY TRUE) - -find_package(SQLite3) - -boost_external_report(SQLite3 INCLUDE_DIR LIBRARIES) diff --git a/cmake/dependencies/Threads.cmake b/cmake/dependencies/Threads.cmake deleted file mode 100644 index 953bb975..00000000 --- a/cmake/dependencies/Threads.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(Threads_FIND_QUIETLY TRUE) - -find_package(Threads) -message(STATUS "X: ${Threads_FOUND}") -boost_external_report(Threads LIBRARIES) diff --git a/cmake/modules/FindDL.cmake b/cmake/modules/FindDL.cmake deleted file mode 100644 index 3f7f889f..00000000 --- a/cmake/modules/FindDL.cmake +++ /dev/null @@ -1,21 +0,0 @@ -if(DL_INCLUDE_DIR) - set(DL_FIND_QUIETLY TRUE) -endif() - -find_path(DL_INCLUDE_DIR dlfcn.h) -find_library(DL_LIBRARY NAMES dl) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(DL DEFAULT_MSG DL_LIBRARY DL_INCLUDE_DIR) - -if(NOT DL_FOUND) - # if dlopen can be found without linking in dl then, - # dlopen is part of libc, so don't need to link extra libs. - include(CheckFunctionExists) - check_function_exists(dlopen DL_FOUND) - set(DL_LIBRARY "") -endif() - -set(DL_LIBRARIES ${DL_LIBRARY}) - -mark_as_advanced(DL_LIBRARY DL_INCLUDE_DIR) diff --git a/cmake/modules/FindMySQL.cmake b/cmake/modules/FindMySQL.cmake deleted file mode 100644 index 375fe1c1..00000000 --- a/cmake/modules/FindMySQL.cmake +++ /dev/null @@ -1,103 +0,0 @@ -# TODO: Change to use mysqlconfig -# TODO: Check library version - -find_path(MYSQL_INCLUDE_DIR mysql.h - $ENV{MYSQL_INCLUDE_DIR} - $ENV{MYSQL_DIR}/include - /usr/include/mysql - /usr/local/include/mysql - /opt/mysql/mysql/include - /opt/mysql/mysql/include/mysql - /usr/local/mysql/include - /usr/local/mysql/include/mysql - $ENV{ProgramFiles}/MySQL/*/include - $ENV{SystemDrive}/MySQL/*/include) - -if(WIN32) - # Set lib path suffixes - # dist = for mysql binary distributions - # build = for custom built tree - if(CMAKE_BUILD_TYPE STREQUAL Debug) - set(libsuffixDist debug) - set(libsuffixBuild Debug) - else() - set(libsuffixDist opt) - set(libsuffixBuild Release) - add_definitions(-DDBUG_OFF) - endif() - - # On Windows, link against dynamic library libmysql, not static mysqlclient - find_library(MYSQL_LIBRARY NAMES libmysql - PATHS - $ENV{MYSQL_DIR}/lib/${libsuffixDist} - $ENV{MYSQL_DIR}/libmysql - $ENV{MYSQL_DIR}/libmysql/${libsuffixBuild} - $ENV{MYSQL_DIR}/client/${libsuffixBuild} - $ENV{MYSQL_DIR}/libmysql/${libsuffixBuild} - $ENV{ProgramFiles}/MySQL/*/lib/${libsuffixDist} - $ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist}) - -else() - - find_library(MYSQL_LIBRARY NAMES mysqlclient_r - PATHS - $ENV{MYSQL_DIR}/libmysql_r/.libs - $ENV{MYSQL_DIR}/lib - $ENV{MYSQL_DIR}/lib/mysql - /usr/lib/mysql - /usr/local/lib/mysql - /usr/local/mysql/lib - /usr/local/mysql/lib/mysql - /opt/mysql/mysql/lib - /opt/mysql/mysql/lib/mysql) -endif() - -if(MYSQL_LIBRARY) - get_filename_component(MYSQL_LIBRARY_DIR ${MYSQL_LIBRARY} PATH) -endif() - -if(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY_DIR) - set(MYSQL_FOUND TRUE) - - include_directories(${MYSQL_INCLUDE_DIR}) - link_directories(${MYSQL_LIBRARY_DIR}) - - find_library(MYSQL_ZLIB zlib PATHS ${MYSQL_LIBRARY_DIR}) - find_library(MYSQL_YASSL yassl PATHS ${MYSQL_LIBRARY_DIR}) - find_library(MYSQL_TAOCRYPT taocrypt PATHS ${MYSQL_LIBRARY_DIR}) - - if(WIN32) - set(MYSQL_CLIENT_LIBS mysqlclient) - else() - set(MYSQL_CLIENT_LIBS libmysql) - endif() - - if(MYSQL_ZLIB) - set(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} zlib) - endif() - - if(MYSQL_YASSL) - set(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} yassl) - endif() - - if(MYSQL_TAOCRYPT) - set(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} taocrypt) - endif() - - # Added needed mysqlclient dependencies on Windows - if(WIN32) - set(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} ws2_32) - endif() -endif() - -set(MYSQL_LIBRARIES ${MYSQL_LIBRARY}) - -# Handle the QUIETLY and REQUIRED arguments and set SQLITE3_FOUND to TRUE -# if all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(MySQL - DEFAULT_MSG - MYSQL_INCLUDE_DIR - MYSQL_LIBRARIES) - -mark_as_advanced(MYSQL_INCLUDE_DIR MYSQL_LIBRARIES) diff --git a/cmake/modules/FindODBC.cmake b/cmake/modules/FindODBC.cmake deleted file mode 100644 index 4adae146..00000000 --- a/cmake/modules/FindODBC.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# -# Find the ODBC driver manager includes and library. -# -# ODBC is an open standard for connecting to different databases in a -# semi-vendor-independent fashion. First you install the ODBC driver -# manager. Then you need a driver for each separate database you want -# to connect to (unless a generic one works). VTK includes neither -# the driver manager nor the vendor-specific drivers: you have to find -# those yourself. -# -# This module defines -# ODBC_INCLUDE_DIRECTORIES, where to find sql.h -# ODBC_LIBRARIES, the libraries to link against to use ODBC -# ODBC_FOUND. If false, you cannot build anything that requires MySQL. - -# also defined, but not for general use is -# ODBC_LIBRARY, where to find the ODBC driver manager library. - -set(ODBC_FOUND FALSE) - -find_path(ODBC_INCLUDE_DIRECTORIES sql.h - /usr/include - /usr/include/odbc - /usr/local/include - /usr/local/include/odbc - /usr/local/odbc/include - "C:/Program Files/ODBC/include" - "C:/ODBC/include" - DOC "Specify the directory containing sql.h." -) - -find_library(ODBC_LIBRARY - NAMES iodbc odbc odbcinst odbc32 - PATHS - /usr/lib - /usr/lib/odbc - /usr/local/lib - /usr/local/lib/odbc - /usr/local/odbc/lib - "C:/Program Files/ODBC/lib" - "C:/ODBC/lib/debug" - "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" - DOC "Specify the ODBC driver manager library here." -) - -if(ODBC_LIBRARY) - if(ODBC_INCLUDE_DIRECTORIES) - set( ODBC_FOUND 1 ) - endif() -endif() - -set(ODBC_LIBRARIES ${ODBC_LIBRARY}) - -mark_as_advanced(ODBC_FOUND ODBC_LIBRARY ODBC_EXTRA_LIBRARIES ODBC_INCLUDE_DIRECTORIES) - diff --git a/cmake/modules/FindOracle.cmake b/cmake/modules/FindOracle.cmake deleted file mode 100644 index db39dc5e..00000000 --- a/cmake/modules/FindOracle.cmake +++ /dev/null @@ -1,76 +0,0 @@ -############################################################################### -# -# CMake module to search for Oracle client library (OCI) -# -# On success, the macro sets the following variables: -# ORACLE_FOUND = if the library found -# ORACLE_LIBRARY = full path to the library -# ORACLE_LIBRARIES = full path to the library -# ORACLE_INCLUDE_DIR = where to find the library headers also defined, -# but not for general use are -# ORACLE_VERSION = version of library which was found, e.g. "1.2.5" -# -# Copyright (c) 2009 Mateusz Loskot -# -# Developed with inspiration from Petr Vanek -# who wrote similar macro for TOra - http://torasql.com/ -# -# Module source: http://github.com/mloskot/workshop/tree/master/cmake/ -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# -############################################################################### - -# If ORACLE_HOME not defined, assume Oracle libraries not available -if(DEFINED ENV{ORACLE_HOME}) - - set(ORACLE_HOME $ENV{ORACLE_HOME}) - - find_path(ORACLE_INCLUDE_DIR - oci.h - PATHS - ${ORACLE_HOME}/rdbms/public - ${ORACLE_HOME}/include - ${ORACLE_HOME}/sdk/include # Oracle SDK - ${ORACLE_HOME}/OCI/include) # Oracle XE on Windows - - set(ORACLE_OCI_NAMES clntsh libclntsh oci) - set(ORACLE_NNZ_NAMES nnz10 libnnz10 nnz11 libnnz11 ociw32) - set(ORACLE_OCCI_NAMES libocci occi oraocci10 oraocci11) - - set(ORACLE_LIB_DIR - ${ORACLE_HOME}/lib - ${ORACLE_HOME}/OCI/lib/MSVC) # Oracle XE on Windows - - find_library(ORACLE_OCI_LIBRARY NAMES ${ORACLE_OCI_NAMES} PATHS ${ORACLE_LIB_DIR}) - find_library(ORACLE_OCCI_LIBRARY NAMES ${ORACLE_OCCI_NAMES} PATHS ${ORACLE_LIB_DIR}) - find_library(ORACLE_NNZ_LIBRARY NAMES ${ORACLE_NNZ_NAMES} PATHS ${ORACLE_LIB_DIR}) - - set(ORACLE_LIBRARY ${ORACLE_OCI_LIBRARY} ${ORACLE_OCCI_LIBRARY} ${ORACLE_NNZ_LIBRARY}) - - if(APPLE) - set(ORACLE_OCIEI_NAMES libociei ociei) - - find_library(ORACLE_OCIEI_LIBRARY - NAMES libociei ociei - PATHS ${ORACLE_LIB_DIR}) - - if(ORACLE_OCIEI_LIBRARY) - set(ORACLE_LIBRARY ${ORACLE_LIBRARY} ${ORACLE_OCIEI_LIBRARY}) - else(ORACLE_OCIEI_LIBRARY) - message(STATUS - "libociei.dylib is not found. It may cause crash if you are building BUNDLE") - endif() - endif() - - set(ORACLE_LIBRARIES ${ORACLE_LIBRARY}) - -endif(DEFINED ENV{ORACLE_HOME}) - -# Handle the QUIETLY and REQUIRED arguments and set ORACLE_FOUND to TRUE -# if all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(ORACLE DEFAULT_MSG ORACLE_LIBRARY ORACLE_INCLUDE_DIR) - -mark_as_advanced(ORACLE_INCLUDE_DIR ORACLE_LIBRARY) diff --git a/cmake/modules/FindPostgreSQL.cmake b/cmake/modules/FindPostgreSQL.cmake deleted file mode 100644 index 407b2de3..00000000 --- a/cmake/modules/FindPostgreSQL.cmake +++ /dev/null @@ -1,77 +0,0 @@ -# - Find PostgreSQL -# Find the PostgreSQL includes and client library -# This module defines -# POSTGRESQL_INCLUDE_DIR, where to find libpq-fe.h -# POSTGRESQL_LIBRARIES, libraries needed to use PostgreSQL -# POSTGRESQL_VERSION, if found, version of PostgreSQL -# POSTGRESQL_FOUND, if false, do not try to use PostgreSQL -# -# Copyright (c) 2010, Mateusz Loskot, -# Copyright (c) 2006, Jaroslaw Staniek, -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -find_program(PG_CONFIG NAMES pg_config DOC "Path to pg_config utility") - -if(PG_CONFIG) - exec_program(${PG_CONFIG} - ARGS "--version" - OUTPUT_VARIABLE PG_CONFIG_VERSION) - - if(${PG_CONFIG_VERSION} MATCHES "^[A-Za-z]+[ ](.*)$") - string(REGEX REPLACE "^[A-Za-z]+[ ](.*)$" "\\1" POSTGRESQL_VERSION "${PG_CONFIG_VERSION}") - endif() - - exec_program(${PG_CONFIG} - ARGS "--includedir" - OUTPUT_VARIABLE PG_CONFIG_INCLUDEDIR) - - exec_program(${PG_CONFIG} - ARGS "--libdir" - OUTPUT_VARIABLE PG_CONFIG_LIBDIR) -else() - set(POSTGRESQL_VERSION "unknown") -endif() - -find_path(POSTGRESQL_INCLUDE_DIR libpq-fe.h - ${PG_CONFIG_INCLUDEDIR} - /usr/include/server - /usr/include/pgsql/server - /usr/local/include/pgsql/server - /usr/include/postgresql - /usr/include/postgresql/server - /usr/include/postgresql/*/server - $ENV{ProgramFiles}/PostgreSQL/*/include - $ENV{SystemDrive}/PostgreSQL/*/include) - -find_library(POSTGRESQL_LIBRARIES NAMES pq libpq - PATHS - ${PG_CONFIG_LIBDIR} - /usr/lib - /usr/local/lib - /usr/lib/postgresql - /usr/lib64 - /usr/local/lib64 - /usr/lib64/postgresql - $ENV{ProgramFiles}/PostgreSQL/*/lib - $ENV{SystemDrive}/PostgreSQL/*/lib - $ENV{ProgramFiles}/PostgreSQL/*/lib/ms - $ENV{SystemDrive}/PostgreSQL/*/lib/ms) - -if(POSTGRESQL_INCLUDE_DIR AND POSTGRESQL_LIBRARIES) - set(POSTGRESQL_FOUND TRUE) -else() - set(POSTGRESQL_FOUND FALSE) -endif() - -# Handle the QUIETLY and REQUIRED arguments and set POSTGRESQL_FOUND to TRUE -# if all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(PostgreSQL - DEFAULT_MSG - POSTGRESQL_INCLUDE_DIR - POSTGRESQL_LIBRARIES - POSTGRESQL_VERSION) - -mark_as_advanced(POSTGRESQL_INCLUDE_DIR POSTGRESQL_LIBRARIES) diff --git a/cmake/modules/FindSQLite3.cmake b/cmake/modules/FindSQLite3.cmake deleted file mode 100644 index 6da796a9..00000000 --- a/cmake/modules/FindSQLite3.cmake +++ /dev/null @@ -1,70 +0,0 @@ -############################################################################### -# CMake module to search for SQLite 3 library -# -# On success, the macro sets the following variables: -# SQLITE3_FOUND = if the library found -# SQLITE3_LIBRARY = full path to the library -# SQLITE3_LIBRARIES = full path to the library -# SSQLITE3_INCLUDE_DIR = where to find the library headers -# -# Copyright (c) 2009 Mateusz Loskot -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# -############################################################################### - -if(WIN32) - # TODO: Make use of OSGeo4W provider optional and available on explicit request - set(OSGEO4W_IMPORT_LIBRARY sqlite3_i) - if(DEFINED ENV{OSGEO4W_ROOT}) - set(OSGEO4W_ROOT_DIR $ENV{OSGEO4W_ROOT}) - message(STATUS - "Trying OSGeo4W using environment variable OSGEO4W_ROOT=$ENV{OSGEO4W_ROOT}") - else() - set(OSGEO4W_ROOT_DIR c:/OSGeo4W) - message(STATUS - "Trying OSGeo4W using default location OSGEO4W_ROOT=${OSGEO4W_ROOT_DIR}") - endif() -endif() - -find_path(SQLITE3_INCLUDE_DIR - NAMES sqlite3.h - PATH_PREFIXES sqlite sqlite3 - PATHS - /usr/include - /usr/local/include - $ENV{LIB_DIR}/include - $ENV{LIB_DIR}/include/sqlite - $ENV{LIB_DIR}/include/sqlite3 - $ENV{ProgramFiles}/SQLite/*/include - $ENV{ProgramFiles}/SQLite3/*/include - $ENV{SystemDrive}/SQLite/*/include - $ENV{SystemDrive}/SQLite3/*/include - ${OSGEO4W_ROOT_DIR}/include) - -set(SQLITE3_NAMES ${OSGEO4W_IMPORT_LIBRARY} sqlite3) -find_library(SQLITE3_LIBRARY - NAMES ${SQLITE3_NAMES} - PATHS - /usr/lib - /usr/local/lib - $ENV{LIB_DIR}/lib - $ENV{ProgramFiles}/SQLite/*/lib - $ENV{ProgramFiles}/SQLite3/*/lib - $ENV{SystemDrive}/SQLite/*/lib - $ENV{SystemDrive}/SQLite3/*/lib - ${OSGEO4W_ROOT_DIR}/lib) - -set(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY}) - -#message(STATUS ${SQLITE3_LIBRARY}) -# Handle the QUIETLY and REQUIRED arguments and set SQLITE3_FOUND to TRUE -# if all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SQLITE3 - DEFAULT_MSG - SQLITE3_LIBRARY - SQLITE3_INCLUDE_DIR) - -mark_as_advanced(SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR SQLITE3_LIBRARY) diff --git a/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in b/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in deleted file mode 100644 index f41ec9b2..00000000 --- a/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in +++ /dev/null @@ -1,7 +0,0 @@ - - - - @SOCI_TEST_CMD_ARGS@ - WindowsLocalDebugger - - diff --git a/core/error.h b/core/error.h index 3e693757..04e2b9a9 100644 --- a/core/error.h +++ b/core/error.h @@ -7,9 +7,14 @@ #ifndef SOCI_ERROR_H_INCLUDED #define SOCI_ERROR_H_INCLUDED - -#include "soci-config.h" -// std +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// +// STL #include #include diff --git a/core/exchange-traits.h b/core/exchange-traits.h index 90314d94..63ff18e1 100644 --- a/core/exchange-traits.h +++ b/core/exchange-traits.h @@ -7,10 +7,16 @@ #ifndef SOCI_EXCHANGE_TRAITS_H_INCLUDED #define SOCI_EXCHANGE_TRAITS_H_INCLUDED - -#include "type-conversion-traits.h" -#include "soci-backend.h" -// std +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// +// STL #include #include #include diff --git a/core/soci-backend.h b/core/soci-backend.h index 0576569c..70351b9c 100644 --- a/core/soci-backend.h +++ b/core/soci-backend.h @@ -7,10 +7,16 @@ #ifndef SOCI_BACKEND_H_INCLUDED #define SOCI_BACKEND_H_INCLUDED - -#include "soci-config.h" -#include "error.h" -// std +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// +// STL #include #include #include diff --git a/core/test/common-tests.h b/core/test/common-tests.h index 594e13ed..c4098446 100644 --- a/core/test/common-tests.h +++ b/core/test/common-tests.h @@ -8,20 +8,36 @@ #ifndef SOCI_COMMON_TESTS_H_INCLUDED #define SOCI_COMMON_TESTS_H_INCLUDED -#include "soci.h" -#include "soci-config.h" - +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// #ifdef HAVE_BOOST // explicitly pull conversions for Boost's optional, tuple and fusion: +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else // SOCI_HEADERS_BURIED +# include +# include +# include +#endif // SOCI_HEADERS_BURIED +// #include -#include -#include -#include #if defined(BOOST_VERSION) && BOOST_VERSION >= 103500 -#include +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif // SOCI_HEADERS_BURIED #endif // BOOST_VERSION #endif // HAVE_BOOST - +// #include #include #include diff --git a/core/type-conversion-traits.h b/core/type-conversion-traits.h index 8ebbb3bf..1a9d61e5 100644 --- a/core/type-conversion-traits.h +++ b/core/type-conversion-traits.h @@ -7,8 +7,13 @@ #ifndef SOCI_TYPE_CONVERSION_TRAITS_H_INCLUDED #define SOCI_TYPE_CONVERSION_TRAITS_H_INCLUDED - -#include "soci-backend.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// namespace soci { From 6499b09dfd7ec1bfd71806148dbaefea7ddd1df8 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 26 Dec 2010 15:09:22 +0100 Subject: [PATCH 04/19] [Branch src] tmp is now ignored. --- .gitignore | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.gitignore b/.gitignore index 1586e959..61caff87 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,21 @@ +*~ +*.kdev[0-9] +*.swp +aclocal.m4 +autom4te.cache +confdefs.h +config.guess +config.log +config.status +config.sub +configure +depcomp +install-sh +libtool +ltmain.sh +m4 +missing +Makefile +Makefile.in tmp From bdca64e2a2d9f798c6ca51a5248ff7a10eef19b5 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 26 Dec 2010 15:09:53 +0100 Subject: [PATCH 05/19] [Branch src] Creation of the 'src' branch, from the master repository. --- src/AUTHORS => AUTHORS | 0 src/CHANGES => CHANGES | 0 src/CMakeLists.txt => CMakeLists.txt | 0 src/LICENSE_1_0.txt => LICENSE_1_0.txt | 0 src/TODO => TODO | 0 src/autogen.sh => autogen.sh | 0 {src/backends => backends}/.gitignore | 0 {src/backends => backends}/CMakeLists.txt | 0 .../empty/CMakeLists.txt | 0 .../empty/Makefile.basic | 0 {src/backends => backends}/empty/blob.cpp | 0 {src/backends => backends}/empty/factory.cpp | 0 {src/backends => backends}/empty/row-id.cpp | 0 {src/backends => backends}/empty/session.cpp | 0 {src/backends => backends}/empty/soci-empty.h | 0 .../empty/standard-into-type.cpp | 0 .../empty/standard-use-type.cpp | 0 .../backends => backends}/empty/statement.cpp | 0 .../empty/test/.gitignore | 0 .../empty/test/CMakeLists.txt | 0 .../empty/test/Makefile.basic | 0 .../empty/test/test-empty.cpp | 0 .../empty/vector-into-type.cpp | 0 .../empty/vector-use-type.cpp | 0 .../firebird/Makefile.basic | 0 {src/backends => backends}/firebird/blob.cpp | 0 .../backends => backends}/firebird/common.cpp | 0 {src/backends => backends}/firebird/common.h | 0 .../firebird/error-firebird.cpp | 0 .../firebird/error-firebird.h | 0 .../firebird/factory.cpp | 0 .../backends => backends}/firebird/row-id.cpp | 0 .../firebird/session.cpp | 0 .../firebird/soci-firebird.h | 0 .../firebird/standard-into-type.cpp | 0 .../firebird/standard-use-type.cpp | 0 .../firebird/statement.cpp | 0 .../firebird/test/Makefile.basic | 0 .../firebird/test/test-firebird.cpp | 0 .../firebird/vector-into-type.cpp | 0 .../firebird/vector-use-type.cpp | 0 .../mysql/CMakeLists.txt | 0 .../mysql/Makefile.basic | 0 {src/backends => backends}/mysql/blob.cpp | 0 {src/backends => backends}/mysql/common.cpp | 0 {src/backends => backends}/mysql/common.h | 0 {src/backends => backends}/mysql/factory.cpp | 0 {src/backends => backends}/mysql/row-id.cpp | 0 {src/backends => backends}/mysql/session.cpp | 0 {src/backends => backends}/mysql/soci-mysql.h | 0 .../mysql/standard-into-type.cpp | 0 .../mysql/standard-use-type.cpp | 0 .../backends => backends}/mysql/statement.cpp | 0 .../mysql/test/.gitignore | 0 .../mysql/test/CMakeLists.txt | 0 .../mysql/test/Makefile.basic | 0 .../mysql/test/test-mysql.cpp | 0 .../mysql/vector-into-type.cpp | 0 .../mysql/vector-use-type.cpp | 0 .../backends => backends}/odbc/CMakeLists.txt | 0 .../backends => backends}/odbc/Makefile.basic | 0 {src/backends => backends}/odbc/blob.cpp | 0 {src/backends => backends}/odbc/factory.cpp | 0 {src/backends => backends}/odbc/makefile.msvc | 0 {src/backends => backends}/odbc/row-id.cpp | 0 {src/backends => backends}/odbc/session.cpp | 0 {src/backends => backends}/odbc/soci-odbc.h | 0 .../odbc/standard-into-type.cpp | 0 .../odbc/standard-use-type.cpp | 0 {src/backends => backends}/odbc/statement.cpp | 0 .../odbc/test/CMakeLists.txt | 0 .../odbc/test/Makefile.basic | 0 .../odbc/test/makefile.msvc | 0 .../odbc/test/test-access.dsn | 0 .../odbc/test/test-mssql.dsn | 0 .../odbc/test/test-mysql.dsn | 0 .../odbc/test/test-odbc-access.cpp | 0 .../odbc/test/test-odbc-mssql.cpp | 0 .../odbc/test/test-odbc-mysql.cpp | 0 .../odbc/test/test-odbc-postgresql.cpp | 0 .../odbc/test/test-postgresql.dsn | 0 {src/backends => backends}/odbc/utility.h | 0 .../odbc/vector-into-type.cpp | 0 .../odbc/vector-use-type.cpp | 0 .../oracle/CMakeLists.txt | 0 .../oracle/Makefile.basic | 0 {src/backends => backends}/oracle/blob.cpp | 0 {src/backends => backends}/oracle/error.cpp | 0 {src/backends => backends}/oracle/error.h | 0 {src/backends => backends}/oracle/factory.cpp | 0 {src/backends => backends}/oracle/row-id.cpp | 0 {src/backends => backends}/oracle/session.cpp | 0 .../oracle/soci-oracle.h | 0 .../oracle/standard-into-type.cpp | 0 .../oracle/standard-use-type.cpp | 0 .../oracle/statement.cpp | 0 .../oracle/test/CMakeLists.txt | 0 .../oracle/test/Makefile.basic | 0 .../oracle/test/test-oracle.cpp | 0 .../oracle/vector-into-type.cpp | 0 .../oracle/vector-use-type.cpp | 0 .../postgresql/CMakeLists.txt | 0 .../postgresql/Makefile.basic | 0 .../backends => backends}/postgresql/blob.cpp | 0 .../postgresql/common.cpp | 0 .../backends => backends}/postgresql/common.h | 0 .../postgresql/factory.cpp | 0 .../postgresql/row-id.cpp | 0 .../postgresql/session.cpp | 0 .../postgresql/soci-postgresql.h | 0 .../postgresql/standard-into-type.cpp | 0 .../postgresql/standard-use-type.cpp | 0 .../postgresql/statement.cpp | 0 .../postgresql/test/.gitignore | 0 .../postgresql/test/CMakeLists.txt | 0 .../postgresql/test/Makefile.basic | 0 .../postgresql/test/test-postgresql.cpp | 0 .../postgresql/vector-into-type.cpp | 0 .../postgresql/vector-use-type.cpp | 0 .../sqlite3/CMakeLists.txt | 0 .../sqlite3/Makefile.basic | 0 {src/backends => backends}/sqlite3/blob.cpp | 0 {src/backends => backends}/sqlite3/common.cpp | 0 {src/backends => backends}/sqlite3/common.h | 0 .../backends => backends}/sqlite3/factory.cpp | 0 {src/backends => backends}/sqlite3/row-id.cpp | 0 .../backends => backends}/sqlite3/session.cpp | 0 .../sqlite3/soci-sqlite3.h | 0 .../sqlite3/standard-into-type.cpp | 0 .../sqlite3/standard-use-type.cpp | 0 .../sqlite3/statement.cpp | 0 .../sqlite3/test/.gitignore | 0 .../sqlite3/test/CMakeLists.txt | 0 .../sqlite3/test/Makefile.basic | 0 .../sqlite3/test/test-sqlite3.cpp | 0 .../sqlite3/vector-into-type.cpp | 0 .../sqlite3/vector-use-type.cpp | 0 build/README | 2 - build/unix/build-core.tcl | 37 - build/unix/build-mysql.tcl | 142 --- build/unix/build-oracle.tcl | 120 --- build/unix/build-postgresql.tcl | 148 --- build/unix/build-sqlite3.tcl | 142 --- build/unix/build.tcl | 87 -- build/unix/execute.tcl | 14 - build/unix/find-boost.tcl | 47 - build/unix/install.tcl | 74 -- build/unix/parse-parameters.tcl | 60 -- {src/cmake => cmake}/CMakeLists.txt | 0 {src/cmake => cmake}/SociBackend.cmake | 0 {src/cmake => cmake}/SociConfig.cmake | 0 {src/cmake => cmake}/SociDependencies.cmake | 0 {src/cmake => cmake}/SociSystemInfo.cmake | 0 {src/cmake => cmake}/SociUtilities.cmake | 0 {src/cmake => cmake}/SociVersion.cmake | 0 {src/cmake => cmake}/dependencies/Boost.cmake | 0 {src/cmake => cmake}/dependencies/MySQL.cmake | 0 {src/cmake => cmake}/dependencies/ODBC.cmake | 0 .../cmake => cmake}/dependencies/Oracle.cmake | 0 .../dependencies/PostgreSQL.cmake | 0 .../dependencies/SQLite3.cmake | 0 .../dependencies/Threads.cmake | 0 {src/cmake => cmake}/modules/FindDL.cmake | 0 {src/cmake => cmake}/modules/FindMySQL.cmake | 0 {src/cmake => cmake}/modules/FindODBC.cmake | 0 {src/cmake => cmake}/modules/FindOracle.cmake | 0 .../modules/FindPostgreSQL.cmake | 0 .../cmake => cmake}/modules/FindSQLite3.cmake | 0 .../vs2010-test-cmd-args.vcxproj.user.in | 0 {src/core => core}/.gitignore | 0 {src/core => core}/CMakeLists.txt | 0 {src/core => core}/Makefile.basic | 0 {src/core => core}/backend-loader.cpp | 0 {src/core => core}/backend-loader.h | 0 {src/core => core}/blob-exchange.h | 0 {src/core => core}/blob.cpp | 0 {src/core => core}/blob.h | 0 {src/core => core}/boost-fusion.h | 0 {src/core => core}/boost-gregorian-date.h | 0 {src/core => core}/boost-optional.h | 0 {src/core => core}/boost-tuple.h | 0 {src/core => core}/connection-pool.cpp | 0 {src/core => core}/connection-pool.h | 0 {src/core => core}/error.cpp | 0 {src/core => core}/error.h | 0 {src/core => core}/exchange-traits.h | 0 {src/core => core}/into-type.cpp | 0 {src/core => core}/into-type.h | 0 {src/core => core}/into.h | 0 {src/core => core}/once-temp-type.cpp | 0 {src/core => core}/once-temp-type.h | 0 {src/core => core}/prepare-temp-type.cpp | 0 {src/core => core}/prepare-temp-type.h | 0 {src/core => core}/procedure.cpp | 0 {src/core => core}/procedure.h | 0 .../ref-counted-prepare-info.cpp | 0 {src/core => core}/ref-counted-prepare-info.h | 0 {src/core => core}/ref-counted-statement.cpp | 0 {src/core => core}/ref-counted-statement.h | 0 {src/core => core}/row-exchange.h | 0 {src/core => core}/row.cpp | 0 {src/core => core}/row.h | 0 {src/core => core}/rowid-exchange.h | 0 {src/core => core}/rowid.cpp | 0 {src/core => core}/rowid.h | 0 {src/core => core}/rowset.h | 0 {src/core => core}/session.cpp | 0 {src/core => core}/session.h | 0 {src/core => core}/soci-backend.h | 0 {src/core => core}/soci-config.h | 0 {src/core => core}/soci-platform.h | 0 {src/core => core}/soci-simple.cpp | 0 {src/core => core}/soci-simple.h | 0 {src/core => core}/soci.h | 0 {src/core => core}/statement.cpp | 0 {src/core => core}/statement.h | 0 {src/core => core}/test/common-tests.h | 0 {src/core => core}/transaction.cpp | 0 {src/core => core}/transaction.h | 0 {src/core => core}/type-conversion-traits.h | 0 {src/core => core}/type-conversion.h | 0 {src/core => core}/type-holder.h | 0 {src/core => core}/type-ptr.h | 0 {src/core => core}/unsigned-types.h | 0 {src/core => core}/use-type.cpp | 0 {src/core => core}/use-type.h | 0 {src/core => core}/use.h | 0 {src/core => core}/values-exchange.h | 0 {src/core => core}/values.cpp | 0 {src/core => core}/values.h | 0 doc/backends.html | 474 --------- doc/backends/firebird.html | 240 ----- doc/backends/index.html | 115 --- doc/backends/mysql.html | 231 ----- doc/backends/odbc.html | 271 ------ doc/backends/oracle.html | 260 ----- doc/backends/postgresql.html | 231 ----- doc/backends/sqlite3.html | 205 ---- doc/basics.html | 143 --- doc/beyond.html | 90 -- doc/boost.html | 106 -- doc/errors.html | 101 -- doc/exchange.html | 742 -------------- doc/index.html | 98 -- doc/installation.html | 250 ----- doc/interfaces.html | 102 -- doc/multithreading.html | 64 -- doc/rationale.html | 313 ------ doc/reference.html | 906 ------------------ doc/statements.html | 388 -------- doc/structure.html | 80 -- doc/structure.odg | Bin 29603 -> 0 bytes doc/structure.png | Bin 26919 -> 0 bytes doc/style.css | 118 --- src/ideas.txt => ideas.txt | 0 src/.gitignore | 19 - src/README | 35 - www/articles.html | 42 - www/doc.html | 22 - www/events.html | 78 -- www/index.html | 111 --- www/links.html | 73 -- www/people.html | 74 -- www/style.css | 73 -- 264 files changed, 6928 deletions(-) rename src/AUTHORS => AUTHORS (100%) rename src/CHANGES => CHANGES (100%) rename src/CMakeLists.txt => CMakeLists.txt (100%) rename src/LICENSE_1_0.txt => LICENSE_1_0.txt (100%) rename src/TODO => TODO (100%) rename src/autogen.sh => autogen.sh (100%) rename {src/backends => backends}/.gitignore (100%) rename {src/backends => backends}/CMakeLists.txt (100%) rename {src/backends => backends}/empty/CMakeLists.txt (100%) rename {src/backends => backends}/empty/Makefile.basic (100%) rename {src/backends => backends}/empty/blob.cpp (100%) rename {src/backends => backends}/empty/factory.cpp (100%) rename {src/backends => backends}/empty/row-id.cpp (100%) rename {src/backends => backends}/empty/session.cpp (100%) rename {src/backends => backends}/empty/soci-empty.h (100%) rename {src/backends => backends}/empty/standard-into-type.cpp (100%) rename {src/backends => backends}/empty/standard-use-type.cpp (100%) rename {src/backends => backends}/empty/statement.cpp (100%) rename {src/backends => backends}/empty/test/.gitignore (100%) rename {src/backends => backends}/empty/test/CMakeLists.txt (100%) rename {src/backends => backends}/empty/test/Makefile.basic (100%) rename {src/backends => backends}/empty/test/test-empty.cpp (100%) rename {src/backends => backends}/empty/vector-into-type.cpp (100%) rename {src/backends => backends}/empty/vector-use-type.cpp (100%) rename {src/backends => backends}/firebird/Makefile.basic (100%) rename {src/backends => backends}/firebird/blob.cpp (100%) rename {src/backends => backends}/firebird/common.cpp (100%) rename {src/backends => backends}/firebird/common.h (100%) rename {src/backends => backends}/firebird/error-firebird.cpp (100%) rename {src/backends => backends}/firebird/error-firebird.h (100%) rename {src/backends => backends}/firebird/factory.cpp (100%) rename {src/backends => backends}/firebird/row-id.cpp (100%) rename {src/backends => backends}/firebird/session.cpp (100%) rename {src/backends => backends}/firebird/soci-firebird.h (100%) rename {src/backends => backends}/firebird/standard-into-type.cpp (100%) rename {src/backends => backends}/firebird/standard-use-type.cpp (100%) rename {src/backends => backends}/firebird/statement.cpp (100%) rename {src/backends => backends}/firebird/test/Makefile.basic (100%) rename {src/backends => backends}/firebird/test/test-firebird.cpp (100%) rename {src/backends => backends}/firebird/vector-into-type.cpp (100%) rename {src/backends => backends}/firebird/vector-use-type.cpp (100%) rename {src/backends => backends}/mysql/CMakeLists.txt (100%) rename {src/backends => backends}/mysql/Makefile.basic (100%) rename {src/backends => backends}/mysql/blob.cpp (100%) rename {src/backends => backends}/mysql/common.cpp (100%) rename {src/backends => backends}/mysql/common.h (100%) rename {src/backends => backends}/mysql/factory.cpp (100%) rename {src/backends => backends}/mysql/row-id.cpp (100%) rename {src/backends => backends}/mysql/session.cpp (100%) rename {src/backends => backends}/mysql/soci-mysql.h (100%) rename {src/backends => backends}/mysql/standard-into-type.cpp (100%) rename {src/backends => backends}/mysql/standard-use-type.cpp (100%) rename {src/backends => backends}/mysql/statement.cpp (100%) rename {src/backends => backends}/mysql/test/.gitignore (100%) rename {src/backends => backends}/mysql/test/CMakeLists.txt (100%) rename {src/backends => backends}/mysql/test/Makefile.basic (100%) rename {src/backends => backends}/mysql/test/test-mysql.cpp (100%) rename {src/backends => backends}/mysql/vector-into-type.cpp (100%) rename {src/backends => backends}/mysql/vector-use-type.cpp (100%) rename {src/backends => backends}/odbc/CMakeLists.txt (100%) rename {src/backends => backends}/odbc/Makefile.basic (100%) rename {src/backends => backends}/odbc/blob.cpp (100%) rename {src/backends => backends}/odbc/factory.cpp (100%) rename {src/backends => backends}/odbc/makefile.msvc (100%) rename {src/backends => backends}/odbc/row-id.cpp (100%) rename {src/backends => backends}/odbc/session.cpp (100%) rename {src/backends => backends}/odbc/soci-odbc.h (100%) rename {src/backends => backends}/odbc/standard-into-type.cpp (100%) rename {src/backends => backends}/odbc/standard-use-type.cpp (100%) rename {src/backends => backends}/odbc/statement.cpp (100%) rename {src/backends => backends}/odbc/test/CMakeLists.txt (100%) rename {src/backends => backends}/odbc/test/Makefile.basic (100%) rename {src/backends => backends}/odbc/test/makefile.msvc (100%) rename {src/backends => backends}/odbc/test/test-access.dsn (100%) rename {src/backends => backends}/odbc/test/test-mssql.dsn (100%) rename {src/backends => backends}/odbc/test/test-mysql.dsn (100%) rename {src/backends => backends}/odbc/test/test-odbc-access.cpp (100%) rename {src/backends => backends}/odbc/test/test-odbc-mssql.cpp (100%) rename {src/backends => backends}/odbc/test/test-odbc-mysql.cpp (100%) rename {src/backends => backends}/odbc/test/test-odbc-postgresql.cpp (100%) rename {src/backends => backends}/odbc/test/test-postgresql.dsn (100%) rename {src/backends => backends}/odbc/utility.h (100%) rename {src/backends => backends}/odbc/vector-into-type.cpp (100%) rename {src/backends => backends}/odbc/vector-use-type.cpp (100%) rename {src/backends => backends}/oracle/CMakeLists.txt (100%) rename {src/backends => backends}/oracle/Makefile.basic (100%) rename {src/backends => backends}/oracle/blob.cpp (100%) rename {src/backends => backends}/oracle/error.cpp (100%) rename {src/backends => backends}/oracle/error.h (100%) rename {src/backends => backends}/oracle/factory.cpp (100%) rename {src/backends => backends}/oracle/row-id.cpp (100%) rename {src/backends => backends}/oracle/session.cpp (100%) rename {src/backends => backends}/oracle/soci-oracle.h (100%) rename {src/backends => backends}/oracle/standard-into-type.cpp (100%) rename {src/backends => backends}/oracle/standard-use-type.cpp (100%) rename {src/backends => backends}/oracle/statement.cpp (100%) rename {src/backends => backends}/oracle/test/CMakeLists.txt (100%) rename {src/backends => backends}/oracle/test/Makefile.basic (100%) rename {src/backends => backends}/oracle/test/test-oracle.cpp (100%) rename {src/backends => backends}/oracle/vector-into-type.cpp (100%) rename {src/backends => backends}/oracle/vector-use-type.cpp (100%) rename {src/backends => backends}/postgresql/CMakeLists.txt (100%) rename {src/backends => backends}/postgresql/Makefile.basic (100%) rename {src/backends => backends}/postgresql/blob.cpp (100%) rename {src/backends => backends}/postgresql/common.cpp (100%) rename {src/backends => backends}/postgresql/common.h (100%) rename {src/backends => backends}/postgresql/factory.cpp (100%) rename {src/backends => backends}/postgresql/row-id.cpp (100%) rename {src/backends => backends}/postgresql/session.cpp (100%) rename {src/backends => backends}/postgresql/soci-postgresql.h (100%) rename {src/backends => backends}/postgresql/standard-into-type.cpp (100%) rename {src/backends => backends}/postgresql/standard-use-type.cpp (100%) rename {src/backends => backends}/postgresql/statement.cpp (100%) rename {src/backends => backends}/postgresql/test/.gitignore (100%) rename {src/backends => backends}/postgresql/test/CMakeLists.txt (100%) rename {src/backends => backends}/postgresql/test/Makefile.basic (100%) rename {src/backends => backends}/postgresql/test/test-postgresql.cpp (100%) rename {src/backends => backends}/postgresql/vector-into-type.cpp (100%) rename {src/backends => backends}/postgresql/vector-use-type.cpp (100%) rename {src/backends => backends}/sqlite3/CMakeLists.txt (100%) rename {src/backends => backends}/sqlite3/Makefile.basic (100%) rename {src/backends => backends}/sqlite3/blob.cpp (100%) rename {src/backends => backends}/sqlite3/common.cpp (100%) rename {src/backends => backends}/sqlite3/common.h (100%) rename {src/backends => backends}/sqlite3/factory.cpp (100%) rename {src/backends => backends}/sqlite3/row-id.cpp (100%) rename {src/backends => backends}/sqlite3/session.cpp (100%) rename {src/backends => backends}/sqlite3/soci-sqlite3.h (100%) rename {src/backends => backends}/sqlite3/standard-into-type.cpp (100%) rename {src/backends => backends}/sqlite3/standard-use-type.cpp (100%) rename {src/backends => backends}/sqlite3/statement.cpp (100%) rename {src/backends => backends}/sqlite3/test/.gitignore (100%) rename {src/backends => backends}/sqlite3/test/CMakeLists.txt (100%) rename {src/backends => backends}/sqlite3/test/Makefile.basic (100%) rename {src/backends => backends}/sqlite3/test/test-sqlite3.cpp (100%) rename {src/backends => backends}/sqlite3/vector-into-type.cpp (100%) rename {src/backends => backends}/sqlite3/vector-use-type.cpp (100%) delete mode 100644 build/README delete mode 100644 build/unix/build-core.tcl delete mode 100644 build/unix/build-mysql.tcl delete mode 100644 build/unix/build-oracle.tcl delete mode 100644 build/unix/build-postgresql.tcl delete mode 100644 build/unix/build-sqlite3.tcl delete mode 100755 build/unix/build.tcl delete mode 100644 build/unix/execute.tcl delete mode 100644 build/unix/find-boost.tcl delete mode 100644 build/unix/install.tcl delete mode 100644 build/unix/parse-parameters.tcl rename {src/cmake => cmake}/CMakeLists.txt (100%) rename {src/cmake => cmake}/SociBackend.cmake (100%) rename {src/cmake => cmake}/SociConfig.cmake (100%) rename {src/cmake => cmake}/SociDependencies.cmake (100%) rename {src/cmake => cmake}/SociSystemInfo.cmake (100%) rename {src/cmake => cmake}/SociUtilities.cmake (100%) rename {src/cmake => cmake}/SociVersion.cmake (100%) rename {src/cmake => cmake}/dependencies/Boost.cmake (100%) rename {src/cmake => cmake}/dependencies/MySQL.cmake (100%) rename {src/cmake => cmake}/dependencies/ODBC.cmake (100%) rename {src/cmake => cmake}/dependencies/Oracle.cmake (100%) rename {src/cmake => cmake}/dependencies/PostgreSQL.cmake (100%) rename {src/cmake => cmake}/dependencies/SQLite3.cmake (100%) rename {src/cmake => cmake}/dependencies/Threads.cmake (100%) rename {src/cmake => cmake}/modules/FindDL.cmake (100%) rename {src/cmake => cmake}/modules/FindMySQL.cmake (100%) rename {src/cmake => cmake}/modules/FindODBC.cmake (100%) rename {src/cmake => cmake}/modules/FindOracle.cmake (100%) rename {src/cmake => cmake}/modules/FindPostgreSQL.cmake (100%) rename {src/cmake => cmake}/modules/FindSQLite3.cmake (100%) rename {src/cmake => cmake}/resources/vs2010-test-cmd-args.vcxproj.user.in (100%) rename {src/core => core}/.gitignore (100%) rename {src/core => core}/CMakeLists.txt (100%) rename {src/core => core}/Makefile.basic (100%) rename {src/core => core}/backend-loader.cpp (100%) rename {src/core => core}/backend-loader.h (100%) rename {src/core => core}/blob-exchange.h (100%) rename {src/core => core}/blob.cpp (100%) rename {src/core => core}/blob.h (100%) rename {src/core => core}/boost-fusion.h (100%) rename {src/core => core}/boost-gregorian-date.h (100%) rename {src/core => core}/boost-optional.h (100%) rename {src/core => core}/boost-tuple.h (100%) rename {src/core => core}/connection-pool.cpp (100%) rename {src/core => core}/connection-pool.h (100%) rename {src/core => core}/error.cpp (100%) rename {src/core => core}/error.h (100%) rename {src/core => core}/exchange-traits.h (100%) rename {src/core => core}/into-type.cpp (100%) rename {src/core => core}/into-type.h (100%) rename {src/core => core}/into.h (100%) rename {src/core => core}/once-temp-type.cpp (100%) rename {src/core => core}/once-temp-type.h (100%) rename {src/core => core}/prepare-temp-type.cpp (100%) rename {src/core => core}/prepare-temp-type.h (100%) rename {src/core => core}/procedure.cpp (100%) rename {src/core => core}/procedure.h (100%) rename {src/core => core}/ref-counted-prepare-info.cpp (100%) rename {src/core => core}/ref-counted-prepare-info.h (100%) rename {src/core => core}/ref-counted-statement.cpp (100%) rename {src/core => core}/ref-counted-statement.h (100%) rename {src/core => core}/row-exchange.h (100%) rename {src/core => core}/row.cpp (100%) rename {src/core => core}/row.h (100%) rename {src/core => core}/rowid-exchange.h (100%) rename {src/core => core}/rowid.cpp (100%) rename {src/core => core}/rowid.h (100%) rename {src/core => core}/rowset.h (100%) rename {src/core => core}/session.cpp (100%) rename {src/core => core}/session.h (100%) rename {src/core => core}/soci-backend.h (100%) rename {src/core => core}/soci-config.h (100%) rename {src/core => core}/soci-platform.h (100%) rename {src/core => core}/soci-simple.cpp (100%) rename {src/core => core}/soci-simple.h (100%) rename {src/core => core}/soci.h (100%) rename {src/core => core}/statement.cpp (100%) rename {src/core => core}/statement.h (100%) rename {src/core => core}/test/common-tests.h (100%) rename {src/core => core}/transaction.cpp (100%) rename {src/core => core}/transaction.h (100%) rename {src/core => core}/type-conversion-traits.h (100%) rename {src/core => core}/type-conversion.h (100%) rename {src/core => core}/type-holder.h (100%) rename {src/core => core}/type-ptr.h (100%) rename {src/core => core}/unsigned-types.h (100%) rename {src/core => core}/use-type.cpp (100%) rename {src/core => core}/use-type.h (100%) rename {src/core => core}/use.h (100%) rename {src/core => core}/values-exchange.h (100%) rename {src/core => core}/values.cpp (100%) rename {src/core => core}/values.h (100%) delete mode 100644 doc/backends.html delete mode 100644 doc/backends/firebird.html delete mode 100644 doc/backends/index.html delete mode 100644 doc/backends/mysql.html delete mode 100644 doc/backends/odbc.html delete mode 100644 doc/backends/oracle.html delete mode 100644 doc/backends/postgresql.html delete mode 100644 doc/backends/sqlite3.html delete mode 100644 doc/basics.html delete mode 100644 doc/beyond.html delete mode 100644 doc/boost.html delete mode 100644 doc/errors.html delete mode 100644 doc/exchange.html delete mode 100644 doc/index.html delete mode 100644 doc/installation.html delete mode 100644 doc/interfaces.html delete mode 100644 doc/multithreading.html delete mode 100644 doc/rationale.html delete mode 100644 doc/reference.html delete mode 100644 doc/statements.html delete mode 100644 doc/structure.html delete mode 100644 doc/structure.odg delete mode 100644 doc/structure.png delete mode 100644 doc/style.css rename src/ideas.txt => ideas.txt (100%) delete mode 100644 src/.gitignore delete mode 100644 src/README delete mode 100644 www/articles.html delete mode 100644 www/doc.html delete mode 100644 www/events.html delete mode 100644 www/index.html delete mode 100644 www/links.html delete mode 100644 www/people.html delete mode 100644 www/style.css diff --git a/src/AUTHORS b/AUTHORS similarity index 100% rename from src/AUTHORS rename to AUTHORS diff --git a/src/CHANGES b/CHANGES similarity index 100% rename from src/CHANGES rename to CHANGES diff --git a/src/CMakeLists.txt b/CMakeLists.txt similarity index 100% rename from src/CMakeLists.txt rename to CMakeLists.txt diff --git a/src/LICENSE_1_0.txt b/LICENSE_1_0.txt similarity index 100% rename from src/LICENSE_1_0.txt rename to LICENSE_1_0.txt diff --git a/src/TODO b/TODO similarity index 100% rename from src/TODO rename to TODO diff --git a/src/autogen.sh b/autogen.sh similarity index 100% rename from src/autogen.sh rename to autogen.sh diff --git a/src/backends/.gitignore b/backends/.gitignore similarity index 100% rename from src/backends/.gitignore rename to backends/.gitignore diff --git a/src/backends/CMakeLists.txt b/backends/CMakeLists.txt similarity index 100% rename from src/backends/CMakeLists.txt rename to backends/CMakeLists.txt diff --git a/src/backends/empty/CMakeLists.txt b/backends/empty/CMakeLists.txt similarity index 100% rename from src/backends/empty/CMakeLists.txt rename to backends/empty/CMakeLists.txt diff --git a/src/backends/empty/Makefile.basic b/backends/empty/Makefile.basic similarity index 100% rename from src/backends/empty/Makefile.basic rename to backends/empty/Makefile.basic diff --git a/src/backends/empty/blob.cpp b/backends/empty/blob.cpp similarity index 100% rename from src/backends/empty/blob.cpp rename to backends/empty/blob.cpp diff --git a/src/backends/empty/factory.cpp b/backends/empty/factory.cpp similarity index 100% rename from src/backends/empty/factory.cpp rename to backends/empty/factory.cpp diff --git a/src/backends/empty/row-id.cpp b/backends/empty/row-id.cpp similarity index 100% rename from src/backends/empty/row-id.cpp rename to backends/empty/row-id.cpp diff --git a/src/backends/empty/session.cpp b/backends/empty/session.cpp similarity index 100% rename from src/backends/empty/session.cpp rename to backends/empty/session.cpp diff --git a/src/backends/empty/soci-empty.h b/backends/empty/soci-empty.h similarity index 100% rename from src/backends/empty/soci-empty.h rename to backends/empty/soci-empty.h diff --git a/src/backends/empty/standard-into-type.cpp b/backends/empty/standard-into-type.cpp similarity index 100% rename from src/backends/empty/standard-into-type.cpp rename to backends/empty/standard-into-type.cpp diff --git a/src/backends/empty/standard-use-type.cpp b/backends/empty/standard-use-type.cpp similarity index 100% rename from src/backends/empty/standard-use-type.cpp rename to backends/empty/standard-use-type.cpp diff --git a/src/backends/empty/statement.cpp b/backends/empty/statement.cpp similarity index 100% rename from src/backends/empty/statement.cpp rename to backends/empty/statement.cpp diff --git a/src/backends/empty/test/.gitignore b/backends/empty/test/.gitignore similarity index 100% rename from src/backends/empty/test/.gitignore rename to backends/empty/test/.gitignore diff --git a/src/backends/empty/test/CMakeLists.txt b/backends/empty/test/CMakeLists.txt similarity index 100% rename from src/backends/empty/test/CMakeLists.txt rename to backends/empty/test/CMakeLists.txt diff --git a/src/backends/empty/test/Makefile.basic b/backends/empty/test/Makefile.basic similarity index 100% rename from src/backends/empty/test/Makefile.basic rename to backends/empty/test/Makefile.basic diff --git a/src/backends/empty/test/test-empty.cpp b/backends/empty/test/test-empty.cpp similarity index 100% rename from src/backends/empty/test/test-empty.cpp rename to backends/empty/test/test-empty.cpp diff --git a/src/backends/empty/vector-into-type.cpp b/backends/empty/vector-into-type.cpp similarity index 100% rename from src/backends/empty/vector-into-type.cpp rename to backends/empty/vector-into-type.cpp diff --git a/src/backends/empty/vector-use-type.cpp b/backends/empty/vector-use-type.cpp similarity index 100% rename from src/backends/empty/vector-use-type.cpp rename to backends/empty/vector-use-type.cpp diff --git a/src/backends/firebird/Makefile.basic b/backends/firebird/Makefile.basic similarity index 100% rename from src/backends/firebird/Makefile.basic rename to backends/firebird/Makefile.basic diff --git a/src/backends/firebird/blob.cpp b/backends/firebird/blob.cpp similarity index 100% rename from src/backends/firebird/blob.cpp rename to backends/firebird/blob.cpp diff --git a/src/backends/firebird/common.cpp b/backends/firebird/common.cpp similarity index 100% rename from src/backends/firebird/common.cpp rename to backends/firebird/common.cpp diff --git a/src/backends/firebird/common.h b/backends/firebird/common.h similarity index 100% rename from src/backends/firebird/common.h rename to backends/firebird/common.h diff --git a/src/backends/firebird/error-firebird.cpp b/backends/firebird/error-firebird.cpp similarity index 100% rename from src/backends/firebird/error-firebird.cpp rename to backends/firebird/error-firebird.cpp diff --git a/src/backends/firebird/error-firebird.h b/backends/firebird/error-firebird.h similarity index 100% rename from src/backends/firebird/error-firebird.h rename to backends/firebird/error-firebird.h diff --git a/src/backends/firebird/factory.cpp b/backends/firebird/factory.cpp similarity index 100% rename from src/backends/firebird/factory.cpp rename to backends/firebird/factory.cpp diff --git a/src/backends/firebird/row-id.cpp b/backends/firebird/row-id.cpp similarity index 100% rename from src/backends/firebird/row-id.cpp rename to backends/firebird/row-id.cpp diff --git a/src/backends/firebird/session.cpp b/backends/firebird/session.cpp similarity index 100% rename from src/backends/firebird/session.cpp rename to backends/firebird/session.cpp diff --git a/src/backends/firebird/soci-firebird.h b/backends/firebird/soci-firebird.h similarity index 100% rename from src/backends/firebird/soci-firebird.h rename to backends/firebird/soci-firebird.h diff --git a/src/backends/firebird/standard-into-type.cpp b/backends/firebird/standard-into-type.cpp similarity index 100% rename from src/backends/firebird/standard-into-type.cpp rename to backends/firebird/standard-into-type.cpp diff --git a/src/backends/firebird/standard-use-type.cpp b/backends/firebird/standard-use-type.cpp similarity index 100% rename from src/backends/firebird/standard-use-type.cpp rename to backends/firebird/standard-use-type.cpp diff --git a/src/backends/firebird/statement.cpp b/backends/firebird/statement.cpp similarity index 100% rename from src/backends/firebird/statement.cpp rename to backends/firebird/statement.cpp diff --git a/src/backends/firebird/test/Makefile.basic b/backends/firebird/test/Makefile.basic similarity index 100% rename from src/backends/firebird/test/Makefile.basic rename to backends/firebird/test/Makefile.basic diff --git a/src/backends/firebird/test/test-firebird.cpp b/backends/firebird/test/test-firebird.cpp similarity index 100% rename from src/backends/firebird/test/test-firebird.cpp rename to backends/firebird/test/test-firebird.cpp diff --git a/src/backends/firebird/vector-into-type.cpp b/backends/firebird/vector-into-type.cpp similarity index 100% rename from src/backends/firebird/vector-into-type.cpp rename to backends/firebird/vector-into-type.cpp diff --git a/src/backends/firebird/vector-use-type.cpp b/backends/firebird/vector-use-type.cpp similarity index 100% rename from src/backends/firebird/vector-use-type.cpp rename to backends/firebird/vector-use-type.cpp diff --git a/src/backends/mysql/CMakeLists.txt b/backends/mysql/CMakeLists.txt similarity index 100% rename from src/backends/mysql/CMakeLists.txt rename to backends/mysql/CMakeLists.txt diff --git a/src/backends/mysql/Makefile.basic b/backends/mysql/Makefile.basic similarity index 100% rename from src/backends/mysql/Makefile.basic rename to backends/mysql/Makefile.basic diff --git a/src/backends/mysql/blob.cpp b/backends/mysql/blob.cpp similarity index 100% rename from src/backends/mysql/blob.cpp rename to backends/mysql/blob.cpp diff --git a/src/backends/mysql/common.cpp b/backends/mysql/common.cpp similarity index 100% rename from src/backends/mysql/common.cpp rename to backends/mysql/common.cpp diff --git a/src/backends/mysql/common.h b/backends/mysql/common.h similarity index 100% rename from src/backends/mysql/common.h rename to backends/mysql/common.h diff --git a/src/backends/mysql/factory.cpp b/backends/mysql/factory.cpp similarity index 100% rename from src/backends/mysql/factory.cpp rename to backends/mysql/factory.cpp diff --git a/src/backends/mysql/row-id.cpp b/backends/mysql/row-id.cpp similarity index 100% rename from src/backends/mysql/row-id.cpp rename to backends/mysql/row-id.cpp diff --git a/src/backends/mysql/session.cpp b/backends/mysql/session.cpp similarity index 100% rename from src/backends/mysql/session.cpp rename to backends/mysql/session.cpp diff --git a/src/backends/mysql/soci-mysql.h b/backends/mysql/soci-mysql.h similarity index 100% rename from src/backends/mysql/soci-mysql.h rename to backends/mysql/soci-mysql.h diff --git a/src/backends/mysql/standard-into-type.cpp b/backends/mysql/standard-into-type.cpp similarity index 100% rename from src/backends/mysql/standard-into-type.cpp rename to backends/mysql/standard-into-type.cpp diff --git a/src/backends/mysql/standard-use-type.cpp b/backends/mysql/standard-use-type.cpp similarity index 100% rename from src/backends/mysql/standard-use-type.cpp rename to backends/mysql/standard-use-type.cpp diff --git a/src/backends/mysql/statement.cpp b/backends/mysql/statement.cpp similarity index 100% rename from src/backends/mysql/statement.cpp rename to backends/mysql/statement.cpp diff --git a/src/backends/mysql/test/.gitignore b/backends/mysql/test/.gitignore similarity index 100% rename from src/backends/mysql/test/.gitignore rename to backends/mysql/test/.gitignore diff --git a/src/backends/mysql/test/CMakeLists.txt b/backends/mysql/test/CMakeLists.txt similarity index 100% rename from src/backends/mysql/test/CMakeLists.txt rename to backends/mysql/test/CMakeLists.txt diff --git a/src/backends/mysql/test/Makefile.basic b/backends/mysql/test/Makefile.basic similarity index 100% rename from src/backends/mysql/test/Makefile.basic rename to backends/mysql/test/Makefile.basic diff --git a/src/backends/mysql/test/test-mysql.cpp b/backends/mysql/test/test-mysql.cpp similarity index 100% rename from src/backends/mysql/test/test-mysql.cpp rename to backends/mysql/test/test-mysql.cpp diff --git a/src/backends/mysql/vector-into-type.cpp b/backends/mysql/vector-into-type.cpp similarity index 100% rename from src/backends/mysql/vector-into-type.cpp rename to backends/mysql/vector-into-type.cpp diff --git a/src/backends/mysql/vector-use-type.cpp b/backends/mysql/vector-use-type.cpp similarity index 100% rename from src/backends/mysql/vector-use-type.cpp rename to backends/mysql/vector-use-type.cpp diff --git a/src/backends/odbc/CMakeLists.txt b/backends/odbc/CMakeLists.txt similarity index 100% rename from src/backends/odbc/CMakeLists.txt rename to backends/odbc/CMakeLists.txt diff --git a/src/backends/odbc/Makefile.basic b/backends/odbc/Makefile.basic similarity index 100% rename from src/backends/odbc/Makefile.basic rename to backends/odbc/Makefile.basic diff --git a/src/backends/odbc/blob.cpp b/backends/odbc/blob.cpp similarity index 100% rename from src/backends/odbc/blob.cpp rename to backends/odbc/blob.cpp diff --git a/src/backends/odbc/factory.cpp b/backends/odbc/factory.cpp similarity index 100% rename from src/backends/odbc/factory.cpp rename to backends/odbc/factory.cpp diff --git a/src/backends/odbc/makefile.msvc b/backends/odbc/makefile.msvc similarity index 100% rename from src/backends/odbc/makefile.msvc rename to backends/odbc/makefile.msvc diff --git a/src/backends/odbc/row-id.cpp b/backends/odbc/row-id.cpp similarity index 100% rename from src/backends/odbc/row-id.cpp rename to backends/odbc/row-id.cpp diff --git a/src/backends/odbc/session.cpp b/backends/odbc/session.cpp similarity index 100% rename from src/backends/odbc/session.cpp rename to backends/odbc/session.cpp diff --git a/src/backends/odbc/soci-odbc.h b/backends/odbc/soci-odbc.h similarity index 100% rename from src/backends/odbc/soci-odbc.h rename to backends/odbc/soci-odbc.h diff --git a/src/backends/odbc/standard-into-type.cpp b/backends/odbc/standard-into-type.cpp similarity index 100% rename from src/backends/odbc/standard-into-type.cpp rename to backends/odbc/standard-into-type.cpp diff --git a/src/backends/odbc/standard-use-type.cpp b/backends/odbc/standard-use-type.cpp similarity index 100% rename from src/backends/odbc/standard-use-type.cpp rename to backends/odbc/standard-use-type.cpp diff --git a/src/backends/odbc/statement.cpp b/backends/odbc/statement.cpp similarity index 100% rename from src/backends/odbc/statement.cpp rename to backends/odbc/statement.cpp diff --git a/src/backends/odbc/test/CMakeLists.txt b/backends/odbc/test/CMakeLists.txt similarity index 100% rename from src/backends/odbc/test/CMakeLists.txt rename to backends/odbc/test/CMakeLists.txt diff --git a/src/backends/odbc/test/Makefile.basic b/backends/odbc/test/Makefile.basic similarity index 100% rename from src/backends/odbc/test/Makefile.basic rename to backends/odbc/test/Makefile.basic diff --git a/src/backends/odbc/test/makefile.msvc b/backends/odbc/test/makefile.msvc similarity index 100% rename from src/backends/odbc/test/makefile.msvc rename to backends/odbc/test/makefile.msvc diff --git a/src/backends/odbc/test/test-access.dsn b/backends/odbc/test/test-access.dsn similarity index 100% rename from src/backends/odbc/test/test-access.dsn rename to backends/odbc/test/test-access.dsn diff --git a/src/backends/odbc/test/test-mssql.dsn b/backends/odbc/test/test-mssql.dsn similarity index 100% rename from src/backends/odbc/test/test-mssql.dsn rename to backends/odbc/test/test-mssql.dsn diff --git a/src/backends/odbc/test/test-mysql.dsn b/backends/odbc/test/test-mysql.dsn similarity index 100% rename from src/backends/odbc/test/test-mysql.dsn rename to backends/odbc/test/test-mysql.dsn diff --git a/src/backends/odbc/test/test-odbc-access.cpp b/backends/odbc/test/test-odbc-access.cpp similarity index 100% rename from src/backends/odbc/test/test-odbc-access.cpp rename to backends/odbc/test/test-odbc-access.cpp diff --git a/src/backends/odbc/test/test-odbc-mssql.cpp b/backends/odbc/test/test-odbc-mssql.cpp similarity index 100% rename from src/backends/odbc/test/test-odbc-mssql.cpp rename to backends/odbc/test/test-odbc-mssql.cpp diff --git a/src/backends/odbc/test/test-odbc-mysql.cpp b/backends/odbc/test/test-odbc-mysql.cpp similarity index 100% rename from src/backends/odbc/test/test-odbc-mysql.cpp rename to backends/odbc/test/test-odbc-mysql.cpp diff --git a/src/backends/odbc/test/test-odbc-postgresql.cpp b/backends/odbc/test/test-odbc-postgresql.cpp similarity index 100% rename from src/backends/odbc/test/test-odbc-postgresql.cpp rename to backends/odbc/test/test-odbc-postgresql.cpp diff --git a/src/backends/odbc/test/test-postgresql.dsn b/backends/odbc/test/test-postgresql.dsn similarity index 100% rename from src/backends/odbc/test/test-postgresql.dsn rename to backends/odbc/test/test-postgresql.dsn diff --git a/src/backends/odbc/utility.h b/backends/odbc/utility.h similarity index 100% rename from src/backends/odbc/utility.h rename to backends/odbc/utility.h diff --git a/src/backends/odbc/vector-into-type.cpp b/backends/odbc/vector-into-type.cpp similarity index 100% rename from src/backends/odbc/vector-into-type.cpp rename to backends/odbc/vector-into-type.cpp diff --git a/src/backends/odbc/vector-use-type.cpp b/backends/odbc/vector-use-type.cpp similarity index 100% rename from src/backends/odbc/vector-use-type.cpp rename to backends/odbc/vector-use-type.cpp diff --git a/src/backends/oracle/CMakeLists.txt b/backends/oracle/CMakeLists.txt similarity index 100% rename from src/backends/oracle/CMakeLists.txt rename to backends/oracle/CMakeLists.txt diff --git a/src/backends/oracle/Makefile.basic b/backends/oracle/Makefile.basic similarity index 100% rename from src/backends/oracle/Makefile.basic rename to backends/oracle/Makefile.basic diff --git a/src/backends/oracle/blob.cpp b/backends/oracle/blob.cpp similarity index 100% rename from src/backends/oracle/blob.cpp rename to backends/oracle/blob.cpp diff --git a/src/backends/oracle/error.cpp b/backends/oracle/error.cpp similarity index 100% rename from src/backends/oracle/error.cpp rename to backends/oracle/error.cpp diff --git a/src/backends/oracle/error.h b/backends/oracle/error.h similarity index 100% rename from src/backends/oracle/error.h rename to backends/oracle/error.h diff --git a/src/backends/oracle/factory.cpp b/backends/oracle/factory.cpp similarity index 100% rename from src/backends/oracle/factory.cpp rename to backends/oracle/factory.cpp diff --git a/src/backends/oracle/row-id.cpp b/backends/oracle/row-id.cpp similarity index 100% rename from src/backends/oracle/row-id.cpp rename to backends/oracle/row-id.cpp diff --git a/src/backends/oracle/session.cpp b/backends/oracle/session.cpp similarity index 100% rename from src/backends/oracle/session.cpp rename to backends/oracle/session.cpp diff --git a/src/backends/oracle/soci-oracle.h b/backends/oracle/soci-oracle.h similarity index 100% rename from src/backends/oracle/soci-oracle.h rename to backends/oracle/soci-oracle.h diff --git a/src/backends/oracle/standard-into-type.cpp b/backends/oracle/standard-into-type.cpp similarity index 100% rename from src/backends/oracle/standard-into-type.cpp rename to backends/oracle/standard-into-type.cpp diff --git a/src/backends/oracle/standard-use-type.cpp b/backends/oracle/standard-use-type.cpp similarity index 100% rename from src/backends/oracle/standard-use-type.cpp rename to backends/oracle/standard-use-type.cpp diff --git a/src/backends/oracle/statement.cpp b/backends/oracle/statement.cpp similarity index 100% rename from src/backends/oracle/statement.cpp rename to backends/oracle/statement.cpp diff --git a/src/backends/oracle/test/CMakeLists.txt b/backends/oracle/test/CMakeLists.txt similarity index 100% rename from src/backends/oracle/test/CMakeLists.txt rename to backends/oracle/test/CMakeLists.txt diff --git a/src/backends/oracle/test/Makefile.basic b/backends/oracle/test/Makefile.basic similarity index 100% rename from src/backends/oracle/test/Makefile.basic rename to backends/oracle/test/Makefile.basic diff --git a/src/backends/oracle/test/test-oracle.cpp b/backends/oracle/test/test-oracle.cpp similarity index 100% rename from src/backends/oracle/test/test-oracle.cpp rename to backends/oracle/test/test-oracle.cpp diff --git a/src/backends/oracle/vector-into-type.cpp b/backends/oracle/vector-into-type.cpp similarity index 100% rename from src/backends/oracle/vector-into-type.cpp rename to backends/oracle/vector-into-type.cpp diff --git a/src/backends/oracle/vector-use-type.cpp b/backends/oracle/vector-use-type.cpp similarity index 100% rename from src/backends/oracle/vector-use-type.cpp rename to backends/oracle/vector-use-type.cpp diff --git a/src/backends/postgresql/CMakeLists.txt b/backends/postgresql/CMakeLists.txt similarity index 100% rename from src/backends/postgresql/CMakeLists.txt rename to backends/postgresql/CMakeLists.txt diff --git a/src/backends/postgresql/Makefile.basic b/backends/postgresql/Makefile.basic similarity index 100% rename from src/backends/postgresql/Makefile.basic rename to backends/postgresql/Makefile.basic diff --git a/src/backends/postgresql/blob.cpp b/backends/postgresql/blob.cpp similarity index 100% rename from src/backends/postgresql/blob.cpp rename to backends/postgresql/blob.cpp diff --git a/src/backends/postgresql/common.cpp b/backends/postgresql/common.cpp similarity index 100% rename from src/backends/postgresql/common.cpp rename to backends/postgresql/common.cpp diff --git a/src/backends/postgresql/common.h b/backends/postgresql/common.h similarity index 100% rename from src/backends/postgresql/common.h rename to backends/postgresql/common.h diff --git a/src/backends/postgresql/factory.cpp b/backends/postgresql/factory.cpp similarity index 100% rename from src/backends/postgresql/factory.cpp rename to backends/postgresql/factory.cpp diff --git a/src/backends/postgresql/row-id.cpp b/backends/postgresql/row-id.cpp similarity index 100% rename from src/backends/postgresql/row-id.cpp rename to backends/postgresql/row-id.cpp diff --git a/src/backends/postgresql/session.cpp b/backends/postgresql/session.cpp similarity index 100% rename from src/backends/postgresql/session.cpp rename to backends/postgresql/session.cpp diff --git a/src/backends/postgresql/soci-postgresql.h b/backends/postgresql/soci-postgresql.h similarity index 100% rename from src/backends/postgresql/soci-postgresql.h rename to backends/postgresql/soci-postgresql.h diff --git a/src/backends/postgresql/standard-into-type.cpp b/backends/postgresql/standard-into-type.cpp similarity index 100% rename from src/backends/postgresql/standard-into-type.cpp rename to backends/postgresql/standard-into-type.cpp diff --git a/src/backends/postgresql/standard-use-type.cpp b/backends/postgresql/standard-use-type.cpp similarity index 100% rename from src/backends/postgresql/standard-use-type.cpp rename to backends/postgresql/standard-use-type.cpp diff --git a/src/backends/postgresql/statement.cpp b/backends/postgresql/statement.cpp similarity index 100% rename from src/backends/postgresql/statement.cpp rename to backends/postgresql/statement.cpp diff --git a/src/backends/postgresql/test/.gitignore b/backends/postgresql/test/.gitignore similarity index 100% rename from src/backends/postgresql/test/.gitignore rename to backends/postgresql/test/.gitignore diff --git a/src/backends/postgresql/test/CMakeLists.txt b/backends/postgresql/test/CMakeLists.txt similarity index 100% rename from src/backends/postgresql/test/CMakeLists.txt rename to backends/postgresql/test/CMakeLists.txt diff --git a/src/backends/postgresql/test/Makefile.basic b/backends/postgresql/test/Makefile.basic similarity index 100% rename from src/backends/postgresql/test/Makefile.basic rename to backends/postgresql/test/Makefile.basic diff --git a/src/backends/postgresql/test/test-postgresql.cpp b/backends/postgresql/test/test-postgresql.cpp similarity index 100% rename from src/backends/postgresql/test/test-postgresql.cpp rename to backends/postgresql/test/test-postgresql.cpp diff --git a/src/backends/postgresql/vector-into-type.cpp b/backends/postgresql/vector-into-type.cpp similarity index 100% rename from src/backends/postgresql/vector-into-type.cpp rename to backends/postgresql/vector-into-type.cpp diff --git a/src/backends/postgresql/vector-use-type.cpp b/backends/postgresql/vector-use-type.cpp similarity index 100% rename from src/backends/postgresql/vector-use-type.cpp rename to backends/postgresql/vector-use-type.cpp diff --git a/src/backends/sqlite3/CMakeLists.txt b/backends/sqlite3/CMakeLists.txt similarity index 100% rename from src/backends/sqlite3/CMakeLists.txt rename to backends/sqlite3/CMakeLists.txt diff --git a/src/backends/sqlite3/Makefile.basic b/backends/sqlite3/Makefile.basic similarity index 100% rename from src/backends/sqlite3/Makefile.basic rename to backends/sqlite3/Makefile.basic diff --git a/src/backends/sqlite3/blob.cpp b/backends/sqlite3/blob.cpp similarity index 100% rename from src/backends/sqlite3/blob.cpp rename to backends/sqlite3/blob.cpp diff --git a/src/backends/sqlite3/common.cpp b/backends/sqlite3/common.cpp similarity index 100% rename from src/backends/sqlite3/common.cpp rename to backends/sqlite3/common.cpp diff --git a/src/backends/sqlite3/common.h b/backends/sqlite3/common.h similarity index 100% rename from src/backends/sqlite3/common.h rename to backends/sqlite3/common.h diff --git a/src/backends/sqlite3/factory.cpp b/backends/sqlite3/factory.cpp similarity index 100% rename from src/backends/sqlite3/factory.cpp rename to backends/sqlite3/factory.cpp diff --git a/src/backends/sqlite3/row-id.cpp b/backends/sqlite3/row-id.cpp similarity index 100% rename from src/backends/sqlite3/row-id.cpp rename to backends/sqlite3/row-id.cpp diff --git a/src/backends/sqlite3/session.cpp b/backends/sqlite3/session.cpp similarity index 100% rename from src/backends/sqlite3/session.cpp rename to backends/sqlite3/session.cpp diff --git a/src/backends/sqlite3/soci-sqlite3.h b/backends/sqlite3/soci-sqlite3.h similarity index 100% rename from src/backends/sqlite3/soci-sqlite3.h rename to backends/sqlite3/soci-sqlite3.h diff --git a/src/backends/sqlite3/standard-into-type.cpp b/backends/sqlite3/standard-into-type.cpp similarity index 100% rename from src/backends/sqlite3/standard-into-type.cpp rename to backends/sqlite3/standard-into-type.cpp diff --git a/src/backends/sqlite3/standard-use-type.cpp b/backends/sqlite3/standard-use-type.cpp similarity index 100% rename from src/backends/sqlite3/standard-use-type.cpp rename to backends/sqlite3/standard-use-type.cpp diff --git a/src/backends/sqlite3/statement.cpp b/backends/sqlite3/statement.cpp similarity index 100% rename from src/backends/sqlite3/statement.cpp rename to backends/sqlite3/statement.cpp diff --git a/src/backends/sqlite3/test/.gitignore b/backends/sqlite3/test/.gitignore similarity index 100% rename from src/backends/sqlite3/test/.gitignore rename to backends/sqlite3/test/.gitignore diff --git a/src/backends/sqlite3/test/CMakeLists.txt b/backends/sqlite3/test/CMakeLists.txt similarity index 100% rename from src/backends/sqlite3/test/CMakeLists.txt rename to backends/sqlite3/test/CMakeLists.txt diff --git a/src/backends/sqlite3/test/Makefile.basic b/backends/sqlite3/test/Makefile.basic similarity index 100% rename from src/backends/sqlite3/test/Makefile.basic rename to backends/sqlite3/test/Makefile.basic diff --git a/src/backends/sqlite3/test/test-sqlite3.cpp b/backends/sqlite3/test/test-sqlite3.cpp similarity index 100% rename from src/backends/sqlite3/test/test-sqlite3.cpp rename to backends/sqlite3/test/test-sqlite3.cpp diff --git a/src/backends/sqlite3/vector-into-type.cpp b/backends/sqlite3/vector-into-type.cpp similarity index 100% rename from src/backends/sqlite3/vector-into-type.cpp rename to backends/sqlite3/vector-into-type.cpp diff --git a/src/backends/sqlite3/vector-use-type.cpp b/backends/sqlite3/vector-use-type.cpp similarity index 100% rename from src/backends/sqlite3/vector-use-type.cpp rename to backends/sqlite3/vector-use-type.cpp diff --git a/build/README b/build/README deleted file mode 100644 index db968b7b..00000000 --- a/build/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory is dedicated for: -- other building systems contributed by SOCI team and users diff --git a/build/unix/build-core.tcl b/build/unix/build-core.tcl deleted file mode 100644 index aba8d8ec..00000000 --- a/build/unix/build-core.tcl +++ /dev/null @@ -1,37 +0,0 @@ -proc buildCore {} { - global CXXFLAGS - - puts "building static core" - - set cwd [pwd] - cd "../../src/core" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS" - } - - execute "ar cr libsoci_core.a [glob *.o]" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/core/libsoci_core.a lib" - eval exec mkdir -p "include" - execute "cp [glob ../../src/core/*.h] include" -} - -proc buildCoreSo {} { - global CXXFLAGS SHARED - - puts "building shared core" - - set cwd [pwd] - cd "../../src/core" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -fPIC" - } - - execute "g++ $SHARED -o libsoci_core.so [glob *.o]" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/core/libsoci_core.so lib" - eval exec mkdir -p "include" - execute "cp [glob ../../src/core/*.h] include" -} diff --git a/build/unix/build-mysql.tcl b/build/unix/build-mysql.tcl deleted file mode 100644 index f1371ae5..00000000 --- a/build/unix/build-mysql.tcl +++ /dev/null @@ -1,142 +0,0 @@ -source "local/parameters.tcl" - -proc findMySQL {} { - global mysqlInclude mysqlLib - - # candidate directories for local MySQL: - set includeDirs { - "/usr/local/include/mysql" - "/usr/include/mysql" - "/usr/local/include" - "/usr/include" - "/opt/local/include" - } - set libDirs { - "/usr/local/lib/mysql" - "/usr/lib/mysql" - "/usr/local/lib" - "/usr/lib" - "/opt/local/lib" - } - - if [info exists mysqlInclude] { - set includeDirs [list $mysqlInclude] - } - if [info exists mysqlLib] { - set libDirs [list $mysqlLib] - } - - set includeDir "" - foreach I $includeDirs { - set header "${I}/mysql.h" - if {[file exists $header]} { - set includeDir $I - break - } - } - if {$includeDir == ""} { - return {} - } - - set libDir "" - foreach L $libDirs { - set libraryA "${L}/libmysqlclient.a" - set librarySo "${L}/libmysqlclient.so" - if {[file exists $libraryA] || [file exists $librarySo]} { - set libDir $L - break - } - } - if {$libDir == ""} { - return {} - } - - return [list $includeDir $libDir] -} - -proc buildMySQL {} { - global CXXFLAGS - - puts "building static MySQL" - - set dirs [findMySQL] - if {$dirs == {}} { - puts "cannot find MySQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/mysql" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -I../../core -I${includeDir}" - } - - execute "ar cr libsoci_mysql.a [glob *.o]" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/mysql/libsoci_mysql.a lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/mysql/soci-mysql.h include" -} - -proc buildMySQLSo {} { - global CXXFLAGS SHARED - - puts "building shared MySQL" - - set dirs [findMySQL] - if {$dirs == {}} { - puts "cannot find MySQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/mysql" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -fPIC -I../../core -I${includeDir}" - } - - execute "g++ $SHARED -o libsoci_mysql.so [glob *.o] -L${libDir} -lmysqlclient -lz" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/mysql/libsoci_mysql.so lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/mysql/soci-mysql.h include" -} - -proc buildMySQLTest {} { - global CXXTESTFLAGS LDL - - puts "building MySQL test" - - set dirs [findMySQL] - if {$dirs == {}} { - puts "cannot find MySQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set dirs [findBoost] - if {$dirs == {}} { - puts "cannot find Boost library files, skipping this target" - return - } - - set boostIncludeDir [lindex $dirs 0] - set boostLibDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/mysql/test" - execute "g++ test-mysql.cpp -o test-mysql $CXXTESTFLAGS -I.. -I../../../core -I../../../core/test -I${includeDir} -I${boostIncludeDir} -L../../../../build/unix/lib -L${libDir} -L${boostLibDir} -lsoci_core -lsoci_mysql -lboost_date_time ${LDL} -lmysqlclient -lz" - cd $cwd - eval exec mkdir -p "tests" - execute "cp ../../src/backends/mysql/test/test-mysql tests" -} diff --git a/build/unix/build-oracle.tcl b/build/unix/build-oracle.tcl deleted file mode 100644 index ac59d0b2..00000000 --- a/build/unix/build-oracle.tcl +++ /dev/null @@ -1,120 +0,0 @@ -proc findOracle {} { - global env oracleInclude oracleLib - - if {[info exists oracleInclude] && - [info exists oracleLib]} { - set includeDir $oracleInclude - set libDir $oracleLib - } else { - if {[info exists env(ORACLE_HOME)] == 0} { - puts "The ORACLE_HOME variable is not set." - return {} - } - - set ORACLE_HOME $env(ORACLE_HOME) - - set includeDir [file join $ORACLE_HOME "rdbms/public"] - set header [file join $includeDir "oci.h"] - if {[file exists $header] == 0} { - puts "ORACLE_HOME is strange." - return {} - } - - set libDir [file join $ORACLE_HOME "lib"] - set libraryA [file join $libDir "libclntsh.a"] - set librarySo [file join $libDir "libclntsh.so"] - if {([file exists $libraryA] == 0) && ([file exists $librarySo] == 0)} { - puts "ORACLE_HOME is strange." - return {} - } - } - - return [list $includeDir $libDir] -} - -proc buildOracle {} { - global CXXFLAGS - - puts "building static Oracle" - - set dirs [findOracle] - if {$dirs == {}} { - puts "cannot find Oracle library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/oracle" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -I../../core -I${includeDir}" - } - - execute "ar cr libsoci_oracle.a [glob *.o]" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/oracle/libsoci_oracle.a lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/oracle/soci-oracle.h include" -} - -proc buildOracleSo {} { - global CXXFLAGS SHARED - - puts "building shared Oracle" - - set dirs [findOracle] - if {$dirs == {}} { - puts "cannot find Oracle library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/oracle" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -fPIC -I../../core -I${includeDir}" - } - - execute "g++ $SHARED -o libsoci_oracle.so [glob *.o] -L${libDir} -lclntsh -lnnz10" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/oracle/libsoci_oracle.so lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/oracle/soci-oracle.h include" -} - -proc buildOracleTest {} { - global CXXTESTFLAGS LDL - - puts "building Oracle test" - - set dirs [findOracle] - if {$dirs == {}} { - puts "cannot find Oracle library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set dirs [findBoost] - if {$dirs == {}} { - puts "cannot find Boost library files, skipping this target" - return - } - - set boostIncludeDir [lindex $dirs 0] - set boostLibDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/oracle/test" - execute "g++ test-oracle.cpp -o test-oracle $CXXTESTFLAGS -I.. -I../../../core -I../../../core/test -I${includeDir} -I${boostIncludeDir} -L../../../../build/unix/lib -L${libDir} -L${boostLibDir} -lsoci_core -lsoci_oracle -lboost_date_time ${LDL} -lclntsh -lnnz10" - cd $cwd - eval exec mkdir -p "tests" - execute "cp ../../src/backends/oracle/test/test-oracle tests" -} diff --git a/build/unix/build-postgresql.tcl b/build/unix/build-postgresql.tcl deleted file mode 100644 index 49a4f939..00000000 --- a/build/unix/build-postgresql.tcl +++ /dev/null @@ -1,148 +0,0 @@ -proc findPostgreSQL {} { - global postgresqlInclude postgresqlLib - - # candidate directories for local PostgreSQL: - set includeDirs { - "/usr/local/pgsql/include" - "/usr/local/postgresql/include" - "/usr/local/include/pgsql" - "/usr/local/include/postgresql" - "/usr/include/pgsql" - "/usr/include/postgresql" - "/usr/local/include" - "/usr/include" - "/opt/local/include" - } - set libDirs { - "/usr/local/pgsql/lib" - "/usr/local/postgresql/lib" - "/usr/local/lib/pgsql" - "/usr/local/lib/postgresql" - "/usr/lib/pgsql" - "/usr/lib/postgresql" - "/usr/local/lib" - "/usr/lib" - "/opt/local/lib" - } - - if [info exists postgresqlInclude] { - set includeDirs [list $postgresqlInclude] - } - if [info exists postgresqlLib] { - set libDirs [list $postgresqlLib] - } - - set includeDir "" - foreach I $includeDirs { - set header "${I}/libpq/libpq-fs.h" - if {[file exists $header]} { - set includeDir $I - break - } - } - if {$includeDir == ""} { - return {} - } - - set libDir "" - foreach L $libDirs { - set libraryA "${L}/libpq.a" - set librarySo "${L}/libpq.so" - if {[file exists $libraryA] || [file exists $librarySo]} { - set libDir $L - break - } - } - if {$libDir == ""} { - return {} - } - - return [list $includeDir $libDir] -} - -proc buildPostgreSQL {} { - global CXXFLAGS - - puts "building static PostgreSQL" - - set dirs [findPostgreSQL] - if {$dirs == {}} { - puts "cannot find PostgreSQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/postgresql" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -I../../core -I${includeDir}" - } - - execute "ar cr libsoci_postgresql.a [glob *.o]" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/postgresql/libsoci_postgresql.a lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/postgresql/soci-postgresql.h include" -} - -proc buildPostgreSQLSo {} { - global CXXFLAGS SHARED - - puts "building shared PostgreSQL" - - set dirs [findPostgreSQL] - if {$dirs == {}} { - puts "cannot find PostgreSQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/postgresql" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -fPIC -I../../core -I${includeDir}" - } - - execute "g++ $SHARED -o libsoci_postgresql.so [glob *.o] -L${libDir} -lpq" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/postgresql/libsoci_postgresql.so lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/postgresql/soci-postgresql.h include" -} - -proc buildPostgreSQLTest {} { - global CXXTESTFLAGS LDL - - puts "building PostgreSQL test" - - set dirs [findPostgreSQL] - if {$dirs == {}} { - puts "cannot find PostgreSQL library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set dirs [findBoost] - if {$dirs == {}} { - puts "cannot find Boost library files, skipping this target" - return - } - - set boostIncludeDir [lindex $dirs 0] - set boostLibDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/postgresql/test" - execute "g++ test-postgresql.cpp -o test-postgresql $CXXTESTFLAGS -I.. -I../../../core -I../../../core/test -I${includeDir} -I${boostIncludeDir} -L../../../../build/unix/lib -L${libDir} -L${boostLibDir} -lsoci_core -lsoci_postgresql -lboost_date_time ${LDL} -lpq" - cd $cwd - eval exec mkdir -p "tests" - execute "cp ../../src/backends/postgresql/test/test-postgresql tests" -} diff --git a/build/unix/build-sqlite3.tcl b/build/unix/build-sqlite3.tcl deleted file mode 100644 index a48d6516..00000000 --- a/build/unix/build-sqlite3.tcl +++ /dev/null @@ -1,142 +0,0 @@ -proc findSqlite3 {} { - global Sqlite3Include Sqlite3Lib - - # candidate directories for local sqlite3: - set includeDirs { - "/usr/local/include" - "/usr/include" - "/opt/local/include" - } - set libDirs { - "/usr/local/lib" - "/usr/lib" - "/opt/local/lib" - } - - if [info exists Sqlite3Include] { - set includeDirs [list $Sqlite3Include] - } - if [info exists Sqlite3Lib] { - set libDirs [list $Sqlite3Lib] - } - - set includeDir "" - foreach I $includeDirs { - set header "${I}/sqlite3.h" - if {[file exists $header]} { - set includeDir $I - break - } - } - if {$includeDir == ""} { - return {} - } - - set libDir "" - foreach L $libDirs { - set libraryA "${L}/libsqlite3.a" - set librarySo "${L}/libsqlite3.so" - set libraryDl "${L}/libsqlite3.dylib" - if {[file exists $libraryA] || [file exists $librarySo] || [file exists $libraryDl]} { - set libDir $L - break - } - } - if {$libDir == ""} { - return {} - } - - return [list $includeDir $libDir] -} - -proc buildSqlite3 {} { - global CXXFLAGS tcl_platform - - puts "building static Sqlite3" - - set dirs [findSqlite3] - if {$dirs == {}} { - puts "cannot find Sqlite3 library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/sqlite3" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -I../../core -I${includeDir}" - } - - execute "ar cr libsoci_sqlite3.a [glob *.o]" - if {$tcl_platform(os) == "Darwin"} { - # special case for Mac OS X - execute "ranlib libsoci_sqlite3.a" - } - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/sqlite3/libsoci_sqlite3.a lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/sqlite3/soci-sqlite3.h include" - -} - -proc buildSqlite3So {} { - global CXXFLAGS SHARED - - puts "building shared Sqlite3" - - set dirs [findSqlite3] - if {$dirs == {}} { - puts "cannot find Sqlite3 library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/sqlite3" - foreach cppFile [glob "*.cpp"] { - execute "g++ -c $cppFile $CXXFLAGS -fPIC -I../../core -I${includeDir}" - } - - execute "g++ $SHARED -o libsoci_sqlite3.so [glob *.o] -L${libDir} -lsqlite3" - cd $cwd - eval exec mkdir -p "lib" - execute "cp ../../src/backends/sqlite3/libsoci_sqlite3.so lib" - eval exec mkdir -p "include" - execute "cp ../../src/backends/sqlite3/soci-sqlite3.h include" -} - -proc buildSqlite3Test {} { - global CXXTESTFLAGS LDL - - puts "building Sqlite3 test" - - set dirs [findSqlite3] - if {$dirs == {}} { - puts "cannot find Sqlite3 library files, skipping this target" - return - } - - set includeDir [lindex $dirs 0] - set libDir [lindex $dirs 1] - - set dirs [findBoost] - if {$dirs == {}} { - puts "cannot find Boost library files, skipping this target" - return - } - - set boostIncludeDir [lindex $dirs 0] - set boostLibDir [lindex $dirs 1] - - set cwd [pwd] - cd "../../src/backends/sqlite3/test" - execute "g++ test-sqlite3.cpp -o test-sqlite3 $CXXTESTFLAGS -I.. -I../../../core -I../../../core/test -I${includeDir} -I${boostIncludeDir} -L../../../../build/unix/lib -L${libDir} -L${boostLibDir} -lsoci_core -lsoci_sqlite3 -lboost_date_time ${LDL} -lsqlite3" - cd $cwd - eval exec mkdir -p "tests" - execute "cp ../../src/backends/sqlite3/test/test-sqlite3 tests" -} diff --git a/build/unix/build.tcl b/build/unix/build.tcl deleted file mode 100755 index 7ec3d321..00000000 --- a/build/unix/build.tcl +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/tclsh - -# some common compilation settings if you need to change them: - -if [info exists env(CXXFLAGS)] { - set CXXFLAGS $env(CXXFLAGS) -} else { - set CXXFLAGS "-Wall -pedantic -Wno-long-long -O2" -} - -set CXXTESTFLAGS "-O2" - -if {$tcl_platform(os) == "Darwin"} { - # special case for Mac OS X - set SHARED "-dynamiclib -flat_namespace -undefined suppress" -} else { - set SHARED "-shared" -} - -if {$tcl_platform(os) == "FreeBSD"} { - # FreeBSD does not have the libdl library, it is part of libc. - set LDL "" -} else { - set LDL "-ldl" -} - -source "execute.tcl" -source "find-boost.tcl" -source "build-core.tcl" -source "build-oracle.tcl" -source "build-postgresql.tcl" -source "build-mysql.tcl" - -proc printUsageAndExit {} { - puts "Usage:" - puts "$ ./build.tcl list-of-targets" - puts "" - puts "list of targets can contain any of:" - puts "core - the core part of the library (static version)" - puts "core-so - the core part of the library (shared version)" - puts "oracle - the static Oracle backend" - puts "oracle-so - the shared Oracle backend" - puts " Note: before building Oracle backend" - puts " set the ORACLE_HOME variable properly." - puts "postgresql - the static PostgreSQL backend" - puts "postgresql-so - the shared PostgreSQL backend" - puts "mysql - the static MySQL backend" - puts "mysql-so - the shared MySQL backend" - puts "" - puts "oracle-test - the test for Oracle" - puts "postgresql-test - the test for PostgreSQL" - puts "mysql-test - the test for MySQL" - puts " Note: build static core and backends first." - puts "" - puts "Examples:" - puts "" - puts "$ ./build.tcl core mysql" - puts "" - puts "$ ./build.tcl core postgresql postgresql-test" - puts "" - puts "After successful build the results are in include, lib and test directories." - puts "Move/copy the contents of these directories wherever you want." - exit -} - -if {$argc == 0 || $argv == "--help"} { - printUsageAndExit -} - -foreach target $argv { - switch -exact $target { - core buildCore - core-so buildCoreSo - oracle buildOracle - oracle-so buildOracleSo - oracle-test buildOracleTest - postgresql buildPostgreSQL - postgresql-so buildPostgreSQLSo - postgresql-test buildPostgreSQLTest - mysql buildMySQL - mysql-so buildMySQLSo - mysql-test buildMySQLTest - default { - puts "unknown target $target - skipping" - } - } -} diff --git a/build/unix/execute.tcl b/build/unix/execute.tcl deleted file mode 100644 index 90d57485..00000000 --- a/build/unix/execute.tcl +++ /dev/null @@ -1,14 +0,0 @@ -proc execute {command} { - puts $command - set result [catch {eval exec $command "2>@ stdout"} output] - if {$result != 0} { - puts "The last command did not execute properly:" - puts $output - puts "Please contact the SOCI team." - exit - } else { - if {$output != ""} { - puts $output - } - } -} diff --git a/build/unix/find-boost.tcl b/build/unix/find-boost.tcl deleted file mode 100644 index 2904ac3d..00000000 --- a/build/unix/find-boost.tcl +++ /dev/null @@ -1,47 +0,0 @@ -proc findBoost {} { - global rootBoost - - # candidate directories for local Boost: - set includeDirs { - "/usr/local/include" - "/usr/include" - "/opt/local/include" - } - set libDirs { - "/usr/local/lib" - "/usr/lib" - "/opt/local/lib" - } - - if [info exists rootBoost] { - set includeDirs [list $rootBoost] - set libDirs [list $rootBoost] - } - - set includeDir "" - foreach I $includeDirs { - set header "${I}/boost/version.hpp" - if {[file exists $header]} { - set includeDir $I - break - } - } - if {$includeDir == ""} { - return {} - } - - set libDir "" - foreach L $libDirs { - set libraryA "${L}/libboost_date_time.a" - set librarySo "${L}/libboost_date_time.so" - if {[file exists $libraryA] || [file exists $librarySo]} { - set libDir $L - break - } - } - if {$libDir == ""} { - return {} - } - - return [list $includeDir $libDir] -} diff --git a/build/unix/install.tcl b/build/unix/install.tcl deleted file mode 100644 index e11eda5b..00000000 --- a/build/unix/install.tcl +++ /dev/null @@ -1,74 +0,0 @@ -set headerInstallPrefix "/usr/local/include/soci" -set libInstallPrefix "/usr/local/lib" -set sociVersion "3.0.0" -set sociMajor "3" - -source "execute.tcl" -source "local/parameters.tcl" - -if [info exists env(DESTDIR)] { - set DESTDIR $env(DESTDIR) - set headerInstallPrefix [file normalize ${DESTDIR}/${headerInstallPrefix}] - set libInstallPrefix [file normalize ${DESTDIR}/${libInstallPrefix}] -} - -set uninstallFile [open "local/uninstall.sh" "w"] - -if {[file exists $headerInstallPrefix] == 0} { - execute "mkdir -p $headerInstallPrefix" - puts $uninstallFile "rm -rf $headerInstallPrefix" -} - -foreach header [glob "include/*"] { - set tail [file tail $header] - puts "copying $tail to ${headerInstallPrefix}" - execute "cp $header $headerInstallPrefix" - puts $uninstallFile "rm -f ${headerInstallPrefix}/${tail}" -} - -if {[file exists $libInstallPrefix] == 0} { - execute "mkdir -p $libInstallPrefix" - puts $uninstallFile "rm -rf $libInstallPrefix" -} - -foreach lib [glob "lib/*.a"] { - set tail [file tail $lib] - puts "copying $tail to ${libInstallPrefix}" - execute "cp $lib $libInstallPrefix" - puts $uninstallFile "rm -f ${libInstallPrefix}/${tail}" -} - -set buildDir [pwd] -cd $libInstallPrefix -foreach lib [glob "${buildDir}/lib/*.so"] { - set rootName [file rootname [file tail $lib]] - set targetName "${rootName}-${sociVersion}.so" - set majorLink "${rootName}-${sociMajor}.so" - set link "${rootName}.so" - - puts "copying [file tail $lib] to ${targetName}" - execute "cp $lib $targetName" - puts $uninstallFile "rm -f ${libInstallPrefix}/${targetName}" - - puts "creating link ${majorLink}" - execute "ln -s $targetName [file tail $majorLink]" - puts $uninstallFile "rm -f ${libInstallPrefix}/${majorLink}" - - puts "creating ${link}" - execute "ln -s $targetName [file tail $link]" - puts $uninstallFile "rm -f ${libInstallPrefix}/${link}" -} - -close $uninstallFile - -puts "ldconfig ${libInstallPrefix}" -catch { eval exec "ldconfig ${libInstallPrefix}" } - -puts "" -puts "" -puts "Hint: the shared libraries were installed in $libInstallPrefix" -puts "- If you use dynamically loaded backends, then you might need to set" -puts " the SOCI_BACKENDS_PATH variable accordingly." -puts "" -puts "Hint: to remove all installed files and links run make uninstall" -puts "" diff --git a/build/unix/parse-parameters.tcl b/build/unix/parse-parameters.tcl deleted file mode 100644 index 574a6f60..00000000 --- a/build/unix/parse-parameters.tcl +++ /dev/null @@ -1,60 +0,0 @@ -set paramsFile [open "local/parameters"] -set tclParamsFile [open "local/parameters.tcl" "w"] - -set line [gets $paramsFile] -while {![eof $paramsFile]} { - set pair [split $line "="] - if {[llength $pair] == 2} { - set name [lindex $pair 0] - set value [lindex $pair 1] - - switch -exact -- $name { - --include-prefix { - puts $tclParamsFile "set headerInstallPrefix $value" - puts "setting prefix for SOCI headers to $value" - } - --lib-prefix { - puts $tclParamsFile "set libInstallPrefix $value" - puts "setting prefix for SOCI libraries to $value" - } - --mysql-include { - puts $tclParamsFile "set mysqlInclude $value" - puts "setting include directory for MySQL to $value" - } - --mysql-lib { - puts $tclParamsFile "set mysqlLib $value" - puts "setting lib directory for MySQL to $value" - } - --oracle-include { - puts $tclParamsFile "set oracleInclude $value" - puts "setting include directory for Oracle to $value" - } - --oracle-lib { - puts $tclParamsFile "set oracleLib $value" - puts "setting lib directory for Oracle to $value" - } - --postgresql-include { - puts $tclParamsFile "set postgresqlInclude $value" - puts "setting include directory for PostgreSQL to $value" - } - --postgresql-lib { - puts $tclParamsFile "set postgresqlLib $value" - puts "setting lib directory for PostgreSQL to $value" - } - --boost-include { - puts $tclParamsFile "set boostInclude $value" - puts "setting Boost include directory to $value" - } - --boost-lib { - puts $tclParamsFile "set boostLib $value" - puts "setting Boost lib directory to $value" - } - default { - puts "unknown option: $name : skipping it!" - } - } - } - set line [gets $paramsFile] -} -close $paramsFile -close $tclParamsFile diff --git a/src/cmake/CMakeLists.txt b/cmake/CMakeLists.txt similarity index 100% rename from src/cmake/CMakeLists.txt rename to cmake/CMakeLists.txt diff --git a/src/cmake/SociBackend.cmake b/cmake/SociBackend.cmake similarity index 100% rename from src/cmake/SociBackend.cmake rename to cmake/SociBackend.cmake diff --git a/src/cmake/SociConfig.cmake b/cmake/SociConfig.cmake similarity index 100% rename from src/cmake/SociConfig.cmake rename to cmake/SociConfig.cmake diff --git a/src/cmake/SociDependencies.cmake b/cmake/SociDependencies.cmake similarity index 100% rename from src/cmake/SociDependencies.cmake rename to cmake/SociDependencies.cmake diff --git a/src/cmake/SociSystemInfo.cmake b/cmake/SociSystemInfo.cmake similarity index 100% rename from src/cmake/SociSystemInfo.cmake rename to cmake/SociSystemInfo.cmake diff --git a/src/cmake/SociUtilities.cmake b/cmake/SociUtilities.cmake similarity index 100% rename from src/cmake/SociUtilities.cmake rename to cmake/SociUtilities.cmake diff --git a/src/cmake/SociVersion.cmake b/cmake/SociVersion.cmake similarity index 100% rename from src/cmake/SociVersion.cmake rename to cmake/SociVersion.cmake diff --git a/src/cmake/dependencies/Boost.cmake b/cmake/dependencies/Boost.cmake similarity index 100% rename from src/cmake/dependencies/Boost.cmake rename to cmake/dependencies/Boost.cmake diff --git a/src/cmake/dependencies/MySQL.cmake b/cmake/dependencies/MySQL.cmake similarity index 100% rename from src/cmake/dependencies/MySQL.cmake rename to cmake/dependencies/MySQL.cmake diff --git a/src/cmake/dependencies/ODBC.cmake b/cmake/dependencies/ODBC.cmake similarity index 100% rename from src/cmake/dependencies/ODBC.cmake rename to cmake/dependencies/ODBC.cmake diff --git a/src/cmake/dependencies/Oracle.cmake b/cmake/dependencies/Oracle.cmake similarity index 100% rename from src/cmake/dependencies/Oracle.cmake rename to cmake/dependencies/Oracle.cmake diff --git a/src/cmake/dependencies/PostgreSQL.cmake b/cmake/dependencies/PostgreSQL.cmake similarity index 100% rename from src/cmake/dependencies/PostgreSQL.cmake rename to cmake/dependencies/PostgreSQL.cmake diff --git a/src/cmake/dependencies/SQLite3.cmake b/cmake/dependencies/SQLite3.cmake similarity index 100% rename from src/cmake/dependencies/SQLite3.cmake rename to cmake/dependencies/SQLite3.cmake diff --git a/src/cmake/dependencies/Threads.cmake b/cmake/dependencies/Threads.cmake similarity index 100% rename from src/cmake/dependencies/Threads.cmake rename to cmake/dependencies/Threads.cmake diff --git a/src/cmake/modules/FindDL.cmake b/cmake/modules/FindDL.cmake similarity index 100% rename from src/cmake/modules/FindDL.cmake rename to cmake/modules/FindDL.cmake diff --git a/src/cmake/modules/FindMySQL.cmake b/cmake/modules/FindMySQL.cmake similarity index 100% rename from src/cmake/modules/FindMySQL.cmake rename to cmake/modules/FindMySQL.cmake diff --git a/src/cmake/modules/FindODBC.cmake b/cmake/modules/FindODBC.cmake similarity index 100% rename from src/cmake/modules/FindODBC.cmake rename to cmake/modules/FindODBC.cmake diff --git a/src/cmake/modules/FindOracle.cmake b/cmake/modules/FindOracle.cmake similarity index 100% rename from src/cmake/modules/FindOracle.cmake rename to cmake/modules/FindOracle.cmake diff --git a/src/cmake/modules/FindPostgreSQL.cmake b/cmake/modules/FindPostgreSQL.cmake similarity index 100% rename from src/cmake/modules/FindPostgreSQL.cmake rename to cmake/modules/FindPostgreSQL.cmake diff --git a/src/cmake/modules/FindSQLite3.cmake b/cmake/modules/FindSQLite3.cmake similarity index 100% rename from src/cmake/modules/FindSQLite3.cmake rename to cmake/modules/FindSQLite3.cmake diff --git a/src/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in b/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in similarity index 100% rename from src/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in rename to cmake/resources/vs2010-test-cmd-args.vcxproj.user.in diff --git a/src/core/.gitignore b/core/.gitignore similarity index 100% rename from src/core/.gitignore rename to core/.gitignore diff --git a/src/core/CMakeLists.txt b/core/CMakeLists.txt similarity index 100% rename from src/core/CMakeLists.txt rename to core/CMakeLists.txt diff --git a/src/core/Makefile.basic b/core/Makefile.basic similarity index 100% rename from src/core/Makefile.basic rename to core/Makefile.basic diff --git a/src/core/backend-loader.cpp b/core/backend-loader.cpp similarity index 100% rename from src/core/backend-loader.cpp rename to core/backend-loader.cpp diff --git a/src/core/backend-loader.h b/core/backend-loader.h similarity index 100% rename from src/core/backend-loader.h rename to core/backend-loader.h diff --git a/src/core/blob-exchange.h b/core/blob-exchange.h similarity index 100% rename from src/core/blob-exchange.h rename to core/blob-exchange.h diff --git a/src/core/blob.cpp b/core/blob.cpp similarity index 100% rename from src/core/blob.cpp rename to core/blob.cpp diff --git a/src/core/blob.h b/core/blob.h similarity index 100% rename from src/core/blob.h rename to core/blob.h diff --git a/src/core/boost-fusion.h b/core/boost-fusion.h similarity index 100% rename from src/core/boost-fusion.h rename to core/boost-fusion.h diff --git a/src/core/boost-gregorian-date.h b/core/boost-gregorian-date.h similarity index 100% rename from src/core/boost-gregorian-date.h rename to core/boost-gregorian-date.h diff --git a/src/core/boost-optional.h b/core/boost-optional.h similarity index 100% rename from src/core/boost-optional.h rename to core/boost-optional.h diff --git a/src/core/boost-tuple.h b/core/boost-tuple.h similarity index 100% rename from src/core/boost-tuple.h rename to core/boost-tuple.h diff --git a/src/core/connection-pool.cpp b/core/connection-pool.cpp similarity index 100% rename from src/core/connection-pool.cpp rename to core/connection-pool.cpp diff --git a/src/core/connection-pool.h b/core/connection-pool.h similarity index 100% rename from src/core/connection-pool.h rename to core/connection-pool.h diff --git a/src/core/error.cpp b/core/error.cpp similarity index 100% rename from src/core/error.cpp rename to core/error.cpp diff --git a/src/core/error.h b/core/error.h similarity index 100% rename from src/core/error.h rename to core/error.h diff --git a/src/core/exchange-traits.h b/core/exchange-traits.h similarity index 100% rename from src/core/exchange-traits.h rename to core/exchange-traits.h diff --git a/src/core/into-type.cpp b/core/into-type.cpp similarity index 100% rename from src/core/into-type.cpp rename to core/into-type.cpp diff --git a/src/core/into-type.h b/core/into-type.h similarity index 100% rename from src/core/into-type.h rename to core/into-type.h diff --git a/src/core/into.h b/core/into.h similarity index 100% rename from src/core/into.h rename to core/into.h diff --git a/src/core/once-temp-type.cpp b/core/once-temp-type.cpp similarity index 100% rename from src/core/once-temp-type.cpp rename to core/once-temp-type.cpp diff --git a/src/core/once-temp-type.h b/core/once-temp-type.h similarity index 100% rename from src/core/once-temp-type.h rename to core/once-temp-type.h diff --git a/src/core/prepare-temp-type.cpp b/core/prepare-temp-type.cpp similarity index 100% rename from src/core/prepare-temp-type.cpp rename to core/prepare-temp-type.cpp diff --git a/src/core/prepare-temp-type.h b/core/prepare-temp-type.h similarity index 100% rename from src/core/prepare-temp-type.h rename to core/prepare-temp-type.h diff --git a/src/core/procedure.cpp b/core/procedure.cpp similarity index 100% rename from src/core/procedure.cpp rename to core/procedure.cpp diff --git a/src/core/procedure.h b/core/procedure.h similarity index 100% rename from src/core/procedure.h rename to core/procedure.h diff --git a/src/core/ref-counted-prepare-info.cpp b/core/ref-counted-prepare-info.cpp similarity index 100% rename from src/core/ref-counted-prepare-info.cpp rename to core/ref-counted-prepare-info.cpp diff --git a/src/core/ref-counted-prepare-info.h b/core/ref-counted-prepare-info.h similarity index 100% rename from src/core/ref-counted-prepare-info.h rename to core/ref-counted-prepare-info.h diff --git a/src/core/ref-counted-statement.cpp b/core/ref-counted-statement.cpp similarity index 100% rename from src/core/ref-counted-statement.cpp rename to core/ref-counted-statement.cpp diff --git a/src/core/ref-counted-statement.h b/core/ref-counted-statement.h similarity index 100% rename from src/core/ref-counted-statement.h rename to core/ref-counted-statement.h diff --git a/src/core/row-exchange.h b/core/row-exchange.h similarity index 100% rename from src/core/row-exchange.h rename to core/row-exchange.h diff --git a/src/core/row.cpp b/core/row.cpp similarity index 100% rename from src/core/row.cpp rename to core/row.cpp diff --git a/src/core/row.h b/core/row.h similarity index 100% rename from src/core/row.h rename to core/row.h diff --git a/src/core/rowid-exchange.h b/core/rowid-exchange.h similarity index 100% rename from src/core/rowid-exchange.h rename to core/rowid-exchange.h diff --git a/src/core/rowid.cpp b/core/rowid.cpp similarity index 100% rename from src/core/rowid.cpp rename to core/rowid.cpp diff --git a/src/core/rowid.h b/core/rowid.h similarity index 100% rename from src/core/rowid.h rename to core/rowid.h diff --git a/src/core/rowset.h b/core/rowset.h similarity index 100% rename from src/core/rowset.h rename to core/rowset.h diff --git a/src/core/session.cpp b/core/session.cpp similarity index 100% rename from src/core/session.cpp rename to core/session.cpp diff --git a/src/core/session.h b/core/session.h similarity index 100% rename from src/core/session.h rename to core/session.h diff --git a/src/core/soci-backend.h b/core/soci-backend.h similarity index 100% rename from src/core/soci-backend.h rename to core/soci-backend.h diff --git a/src/core/soci-config.h b/core/soci-config.h similarity index 100% rename from src/core/soci-config.h rename to core/soci-config.h diff --git a/src/core/soci-platform.h b/core/soci-platform.h similarity index 100% rename from src/core/soci-platform.h rename to core/soci-platform.h diff --git a/src/core/soci-simple.cpp b/core/soci-simple.cpp similarity index 100% rename from src/core/soci-simple.cpp rename to core/soci-simple.cpp diff --git a/src/core/soci-simple.h b/core/soci-simple.h similarity index 100% rename from src/core/soci-simple.h rename to core/soci-simple.h diff --git a/src/core/soci.h b/core/soci.h similarity index 100% rename from src/core/soci.h rename to core/soci.h diff --git a/src/core/statement.cpp b/core/statement.cpp similarity index 100% rename from src/core/statement.cpp rename to core/statement.cpp diff --git a/src/core/statement.h b/core/statement.h similarity index 100% rename from src/core/statement.h rename to core/statement.h diff --git a/src/core/test/common-tests.h b/core/test/common-tests.h similarity index 100% rename from src/core/test/common-tests.h rename to core/test/common-tests.h diff --git a/src/core/transaction.cpp b/core/transaction.cpp similarity index 100% rename from src/core/transaction.cpp rename to core/transaction.cpp diff --git a/src/core/transaction.h b/core/transaction.h similarity index 100% rename from src/core/transaction.h rename to core/transaction.h diff --git a/src/core/type-conversion-traits.h b/core/type-conversion-traits.h similarity index 100% rename from src/core/type-conversion-traits.h rename to core/type-conversion-traits.h diff --git a/src/core/type-conversion.h b/core/type-conversion.h similarity index 100% rename from src/core/type-conversion.h rename to core/type-conversion.h diff --git a/src/core/type-holder.h b/core/type-holder.h similarity index 100% rename from src/core/type-holder.h rename to core/type-holder.h diff --git a/src/core/type-ptr.h b/core/type-ptr.h similarity index 100% rename from src/core/type-ptr.h rename to core/type-ptr.h diff --git a/src/core/unsigned-types.h b/core/unsigned-types.h similarity index 100% rename from src/core/unsigned-types.h rename to core/unsigned-types.h diff --git a/src/core/use-type.cpp b/core/use-type.cpp similarity index 100% rename from src/core/use-type.cpp rename to core/use-type.cpp diff --git a/src/core/use-type.h b/core/use-type.h similarity index 100% rename from src/core/use-type.h rename to core/use-type.h diff --git a/src/core/use.h b/core/use.h similarity index 100% rename from src/core/use.h rename to core/use.h diff --git a/src/core/values-exchange.h b/core/values-exchange.h similarity index 100% rename from src/core/values-exchange.h rename to core/values-exchange.h diff --git a/src/core/values.cpp b/core/values.cpp similarity index 100% rename from src/core/values.cpp rename to core/values.cpp diff --git a/src/core/values.h b/core/values.h similarity index 100% rename from src/core/values.h rename to core/values.h diff --git a/doc/backends.html b/doc/backends.html deleted file mode 100644 index 103c04bc..00000000 --- a/doc/backends.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - - - SOCI - backends - - - - - -

Backends reference

- -

This part of the documentation is provided for those who want to -write (and contribute!) their own backends. It is anyway recommended -that authors of new backend see the code of some existing backend for -hints on how things are really done.

- -

The backend interface is a set of base classes that the actual backends -are supposed to specialize. The main SOCI interface uses only the -interface and respecting the protocol (for example, the order of -function calls) described here. Note that both the interface and the -protocol were initially designed with the Oracle database in mind, -which means -that whereas it is quite natural with respect to the way Oracle API -(OCI) works, it might impose some implementation burden on other -backends, where things are done differently and therefore have to be -adjusted, cached, converted, etc.

- -

The interface to the common SOCI interface is defined in the core/soci-backend.h -header file. This file is dissected below.

- -

All names are defined in either soci or soci::details -namespace.

- -
-// data types, as seen by the user
-enum data_type
-{
-    dt_string, dt_date, dt_double, dt_integer, dt_unsigned_long, dt_long_long
-};
-
-// the enum type for indicator variables
-enum indicator { i_ok, i_null, i_truncated };
-
-// data types, as used to describe exchange format
-enum exchange_type
-{
-    x_char, x_cstring, x_stdstring, x_short, x_integer,
-    x_unsigned_long, x_long_long, x_double, x_stdtm, x_statement,
-    x_rowid, x_blob
-};
-
-struct cstring_descriptor
-{
-    cstring_descriptor(char * str, std::size_t bufSize)
-        : str_(str), bufSize_(bufSize) {}
-
-    char * str_;
-    std::size_t bufSize_;
-};
-
-// actually in error.h:
-class soci_error : public std::runtime_error
-{
-public:
-    soci_error(std::string const & msg);
-};
-
- -

The data_type enumeration type defines all types that -form the core type support for SOCI. The enum itself can be used by -clients when dealing with dynamic rowset description.

- -

The indicator enumeration type defines all recognized states of data. -The i_truncated -state is provided for the case where the string is retrieved from the -database into the char buffer that is not long enough to hold the whole -value.

- -

The exchange_type enumeration type defines all possible -types that can be used with the into and use -elements.

- -

The cstring_descriptor is a helper class that allows to -store the address of char buffer together with its size. -The objects of this class are passed to the backend when the x_cstring -type is involved.

- -

The soci_error class is an exception type used for -database-related (and -also usage-related) errors. The backends should throw exceptions of -this or derived type only.

- -
-class standard_into_type_backend
-{
-public:
-    virtual ~standard_into_type_backend() {}
-
-    virtual void define_by_pos(int & position,
-        void * data, exchange_type type) = 0;
-
-    virtual void pre_fetch() = 0;
-    virtual void post_fetch(bool gotData, bool calledFromFetch,
-        indicator * ind) = 0;
-
-    virtual void clean_up() = 0;
-};
-
- -

The standard_into_type_back_end class implements the dynamic -interactions with the simple (non-bulk) into elements. -The objects of this class (or, rather, of the derived class implemented -by the actual backend) are created by the statement -object when the into element is bound - in terms of -lifetime management, statement is the master of this -class.

-
    -
  • define_by_pos - Called when the into -element is bound, once and before the statement is executed. The data -pointer points to the variable used for into element (or -to the cstring_descriptor object, which is artificially -created when the plain char buffer is used for data -exchange). The position parameter is a "column number", -assigned by -the library. The backend should increase this parameter, according to -the number of fields actually taken (usually 1).
  • -
  • pre_fetch - Called before each row is fetched.
  • -
  • post_fetch - Called after each row is fetched. The gotData -parameter is true if the fetch operation really retrieved -some data and false otherwise; calledFromFetch -is true when the call is from the fetch operation and false -if it is from the execute operation (this is also the case for simple, -one-time queries). In particular, (calledFromFetch && -!gotData) indicates that there is an end-of-rowset condition. ind -points to the indicator provided by the user, or is NULL, -if there is no indicator.
  • -
  • clean_up - Called once when the statement is -destroyed.
  • -
- -

The intended use of pre_fetch and post_fetch -functions is to manage any internal buffer and/or data conversion for -each value retrieved from the database. If the given server supports -binary data transmission and the data format for the given type agrees -with what is used on the client machine, then these two functions need -not do anything; otherwise buffer management and data conversions -should go there.

- -
-class vector_into_type_backend
-{
-public:
-    virtual ~vector_into_type_backend() {}
-
-    virtual void define_by_pos(int & position,
-        void * data, exchange_type type) = 0;
-
-    virtual void pre_fetch() = 0;
-    virtual void post_fetch(bool gotData, indicator * ind) = 0;
-
-    virtual void resize(std::size_t sz) = 0;
-    virtual std::size_t size() = 0;
-
-    virtual void clean_up() = 0;
-};
-
- -

The vector_into_type_back_end has similar structure and -purpose as the previous one, but is used for vectors (bulk data -retrieval).

- -

The data pointer points to the variable of type std::vector<T> -(and not to its internal buffer), resize -is supposed to really resize the user-provided vector and size -is supposed to return the current size of this vector. -The important difference with regard to the previous class is that ind -points (if not NULL) to the beginning of the array of indicators. The backend -should fill this array according to the actual state of the retrieved -data.

- -
-class standard_use_type_backend
-{
-public:
-    virtual ~standard_use_type_backend() {}
-
-    virtual void bind_by_pos(int & position,
-        void * data, exchange_type type, bool readOnly) = 0;
-    virtual void bind_by_name(std::string const & name,
-        void * data, exchange_type type, bool readOnly) = 0;
-
-    virtual void pre_use(indicator const * ind) = 0;
-    virtual void post_use(bool gotData, indicator * ind) = 0;
-
-    virtual void clean_up() = 0;
-};
-
- -

The standard_use_type_backend implements the interactions -with the simple (non-bulk) use elements, created and -destroyed by the statement object.

-
    -
  • bind_by_pos - Called for each use -element, once and before the statement is executed - for those use -elements that do not provide explicit names for parameter binding. The -meaning of parameters is same as in previous classes.
  • -
  • bind_by_name - Called for those use -elements that provide the explicit name.
  • -
  • pre_use - Called before the data is transmitted to -the server (this means before the statement is executed, which can -happen many times for the prepared statement). ind points -to the indicator provided by the user (or is NULL).
  • -
  • post_use - Called after statement execution. gotData -and ind have the same meaning as in standard_into_type_back_end::post_fetch, -and this can be used by those backends whose respective servers support -two-way data exchange (like in/out parameters in stored procedures).
  • -
- -

The intended use for pre_use and post_use -methods is to manage any internal buffers and/or data conversion. They -can be called many times with the same statement.

- -
-class vector_use_type_backend
-{
-public:
-    virtual ~vector_use_type_backend() {}
-
-    virtual void bind_by_pos(int & position,
-        void * data, exchange_type type) = 0;
-    virtual void bind_by_name(std::string const & name,
-        void * data, exchange_type type) = 0;
-
-    virtual void pre_use(indicator const * ind) = 0;
-
-    virtual std::size_t size() = 0;
-
-    virtual void clean_up() = 0;
-};
-
- -

Objects of this type (or rather of type derived from this one) are used -to implement interactions with user-provided vector (bulk) use -elements and are managed by the statement object. -The data pointer points to the whole vector object -provided by the user (and not to -its internal buffer); ind points to the beginning of the -array of indicators (or is NULL). The meaning of this -interface is analogous to those presented above.

- -
-class statement_backend
-{
-public:
-    virtual ~statement_backend() {}
-
-    virtual void alloc() = 0;
-    virtual void clean_up() = 0;
-
-    virtual void prepare(std::string const & query, statement_type eType) = 0;
-
-    enum exec_fetch_result { ef_success, ef_no_data };
-    virtual exec_fetch_result execute(int number) = 0;
-    virtual exec_fetch_result fetch(int number) = 0;
-
-    virtual int get_number_of_rows() = 0;
-
-    virtual std::string rewrite_for_procedure_call(std::string const & query) = 0;
-
-    virtual int prepare_for_describe() = 0;
-    virtual void describe_column(int colNum, data_type & dtype,
-        std::string & column_name) = 0;
-
-    virtual standard_into_type_backend * make_into_type_backend() = 0;
-    virtual standard_use_type_backend * make_use_type_backend() = 0;
-    virtual vector_into_type_backend * make_vector_into_type_backend() = 0;
-    virtual vector_use_type_backend * make_vector_use_type_backend() = 0;
-};
-
- -

The statement_backend type implements the internals of the -statement objects. The objects of this class are created by the session -object.

-
    -
  • alloc - Called once to allocate everything that is -needed for the statement to work correctly.
  • -
  • clean_up - Supposed to clean up the resources, called -once.
  • -
  • prepare - Called once with the text of the SQL -query. For servers that support explicit query preparation, this is the -place to do it.
  • -
  • execute - Called to execute the query; if number is -zero, the intent is not to exchange data with the user-provided objects -(into and use elements); positive values -mean the number of rows to exchange (more than 1 is used only for bulk -operations).
  • -
  • fetch - Called to fetch next bunch of rows; number -is positive and determines the requested number of rows (more than 1 is -used only for bulk operations).
  • -
  • get_number_of_rows - Called to determine the actual -number of rows retrieved by the previous call to execute -or fetch.
  • -
  • rewrite_for_procedure_call - Used when the procedure -is used instead of statement, to call the stored -procedure. This function should rewrite the SQL query (if necessary) to -the form that will allow to execute the given procedure. -
  • -
  • prepare_for_describe - Called once when the into -element is used with the row type, which means that -dynamic rowset description should be performed. It is supposed to do -whatever is needed to later describe the column properties and should -return the number of columns.
  • -
  • describe_column - Called once for each column (column -numbers - colNum - start from 1), should fill its -parameters according to the column properties.
  • -
  • make_into_type_backend, make_use_type_backend, - make_vector_into_type_backend, make_vector_use_type_backend -- Called once for each into or use element, -to create the objects of appropriate classes (described above).
  • -
- -

Notes:

-
    -
  1. Whether the query is executed using the simple one-time syntax or -is prepared, the alloc, prepare and execute -functions are always called, in this order.
  2. -
  3. All into and use elements are bound -(their define_by_pos or bind_by_pos/bind_by_name -functions are called) between -statement preparation and execution. -
  4. -
- -
-class rowid_backend
-{
-public:
-    virtual ~rowid_backend() {}
-};
-
- -

The rowid_backend class is a hook for the backends to -provide their own state for the row identifier. It has no functions, -since the only portable interaction with the row identifier object is -to use it with into and use elements.

- -
-class blob_backend
-{
-public:
-    virtual ~blob_backend() {}
-
-    virtual std::size_t get_len() = 0;
-    virtual std::size_t read(std::size_t offset, char * buf,
-        std::size_t toRead) = 0;
-    virtual std::size_t write(std::size_t offset, char const * buf,
-        std::size_t toWrite) = 0;
-    virtual std::size_t append(char const * buf, std::size_t toWrite) = 0;
-    virtual void trim(std::size_t newLen) = 0;
-};
-
- -

The blob_backend interface provides the entry points for -the blob methods.

- -
-class session_backend
-{
-public:
-    virtual ~session_backend() {}
-
-    virtual void begin() = 0;
-    virtual void commit() = 0;
-    virtual void rollback() = 0;
-
-    virtual std::string get_backend_name() const = 0;
-
-    virtual statement_backend * make_statement_backend() = 0;
-    virtual rowid_backend * make_rowid_backend() = 0;
-    virtual blob_backend * make_blob_backend() = 0;
-};
-
- -

The object of the class derived from session_backend implements the -internals of the session object.

-
    -
  • begin, commit, rollback -- Forward-called when the same functions of session are -called by user.
  • -
  • make_statement_backend, make_rowid_backend, - make_blob_backend - Called to create respective -implementations for the statement, rowid -and blob classes. -
  • -
- -
-struct backend_factory
-{
-    virtual ~backend_factory() {}
-
-    virtual details::session_backend * make_session(
-        std::string const & connectString) const = 0;
-};
-
- -

The backend_factory is a base class for backend-provided -factory class that is able to create valid sessions. The connectString -parameter passed to make_session is provided here by the session -constructor and contains only the backend-related parameters, without the backend name -(if the dynamic backend loading is used).

- -

The actual backend factory object is supposed to be provided by the -backend implementation and declared in its header file. In addition to this, -the factory_ABC function with the "C" calling convention -and returning the pointer to concrete factory object should be provided, -where ABC is the backend name.

- -

The following example is taken from soci-postgresql.h, -which declares entities of the PostgreSQL backend:

- -
-struct postgresql_backend_factory : backend_factory
-{
-    virtual postgresql_session_backend * make_session(
-        std::string const & connectString) const;
-};
-
-extern postgresql_backend_factory const postgresql;
-
-extern "C"
-{
-
-// for dynamic backend loading
-backend_factory const * factory_postgresql();
-
-} // extern "C"
-
- -

With the above declarations, it is enough to pass the postgresql -factory name to the constructor of the session object, -which will use this factory to create concrete implementations for any -other objects that -are needed, with the help of appropriate make_XYZ -functions. Alternatively, the factory_postgresql function will -be called automatically by the backend loader if the backend name is provided -at run-time instead.

- -

Note that the backend source code is placed in the backends/name directory (for example, -backends/oracle) and the test driver is in backends/name/test. There is also backends/empty -directory provided as a skeleton for development of new backends and -their tests. It is -recommended that all backends respect naming conventions by just -appending their name to the base-class names. The backend name used for -the global factory object should clearly identify the given -database engine, like oracle, postgresql, mysql, -and so on.

- - - - - - - - - - - diff --git a/doc/backends/firebird.html b/doc/backends/firebird.html deleted file mode 100644 index c1deafb2..00000000 --- a/doc/backends/firebird.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - SOCI - Firebird Backend Reference - - - - - -

Firebird Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI Firebird backend is currently supported for use with Firebird 1.5.
-Other versions of Firebird may work as well, but they have not been tested by the SOCI team.

- -

Tested Platforms

- - - - - - - - -
Firebird versionOperating SystemCompiler
1.5.2.4731SunOS 5.10g++ 3.4.3
1.5.2.4731Windows XPVisual C++ 8.0
1.5.3.4870Windows XPVisual C++ 8.0 Professional
- -

Required Client Libraries

- -

The Firebird backend requires Firebird's libfbclient client library.

- -

Connecting to the Database

- -

To establish a connection to a Firebird database, create a Session object -using the firebird backend factory together with a connection string:

- -
-BackEndFactory const &backEnd = firebird;
-Session sql(backEnd, 
-        "service=/usr/local/firbird/db/test.fdb user=SYSDBA password=masterkey");
-
- -

or simply:

- -
-Session sql(firebird, 
-        "service=/usr/local/firbird/db/test.fdb user=SYSDBA password=masterkey");
-
- -

The set of parameters used in the connection string for Firebird is:

-
    -
  • service
  • -
  • user
  • -
  • password
  • -
  • role
  • -
  • charset
  • -
-

The following parameters have to be provided as part of the connection string : -service, user, password. Role and charset parameters are optional.

- -

Once you have created a Session object as shown above, you can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from user_tables", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the Session class.)

- -

SOCI Feature Support

-

Dynamic Binding

- -

The Firebird backend supports the use of the SOCI Row class, which facilitates retrieval of data whose type is not known at compile time.

- -

When calling Row::get<T>(), the type you should pass as T depends upon the underlying database type. For the Firebird backend, this type mapping is:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Firebird Data TypeSOCI Data TypeRow::get<T> specializations
numeric, decimal
(where scale > 0)
eDoubledouble
numeric, decimal [1]
(where scale = 0)
eInteger, eDoubleint, double
double precision, floateDoubledouble
smallint, integereIntegerint
char, varchareStringstd::string
date, time, timestampeDatestd::tm
-

 [1]  There is also 64bit integer type for larger values which is -currently not supported.

-

(See the dynamic resultset binding documentation for general information on using the Row class.)

- -

Binding by Name

- -

In addition to binding by position, the Firebird backend supports binding by name, via an overload of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

It should be noted that parameter binding by name is supported only by means of emulation, since the underlying API used by the backend doesn't provide this feature.

- -

Bulk Operations

- -

The Firebird backend has full support for SOCI's bulk operations interface. This feature is also supported by emulation.

- -

Transactions

- -

Transactions are also fully -supported by the Firebird backend. In fact, there is always a transaction which is automatically commited in Session's destructor. -
See the Configuration options section for more details.

- -

BLOB Data Type

- -

The Firebird backend supports working with data stored in columns of type Blob, via SOCI's BLOB class.

-

It should by noted, that entire Blob data is fetched from database to allow random read and write access. -This is because Firebird itself allows only writing to a new Blob or reading from existing one - -modifications of existing Blob means creating a new one. Firebird backend hides those details from user.

- -

RowID Data Type

- -

This feature is not supported by Firebird backend.

- -

Nested Statements

- -

This feature is not supported by Firebird backend.

- -

Stored Procedures

- -

Firebird stored procedures can be executed by using SOCI's Procedure class.

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several getBackEnd() functions, as described in the beyond SOCI documentation.

- -

The Firebird backend provides the following concrete classes for navite API access:

- - - - - - - - - - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
SessionBackEnd* Session::getBackEnd()FirebirdSessionBackEnd
StatementBackEnd* Statement::getBackEnd()FirebirdStatementBackEnd
BLOBBackEnd* BLOB::getBackEnd()FirebirdBLOBBackEnd
RowIDBackEnd* RowID::getBackEnd()FirebirdRowIDBackEnd
- - -

Backend-specific extensions

-

FirebirdSOCIError

- -

The Firebird backend can throw instances of class FirebirdSOCIError, -which is publicly derived from SOCIError and has an -additional public status_ member containing the Firebird status vector.

- -

Configuration options

- -

The Firebird backend recognize the following configuration macros :

-
    -
  • SOCI_FIREBIRD_NORESTARTTRANSACTION - - Transactions will not be restarted automatically after commit() or rollback(). - The default is to restart transactions.
  • -
- - - - diff --git a/doc/backends/index.html b/doc/backends/index.html deleted file mode 100644 index e63b7534..00000000 --- a/doc/backends/index.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - SOCI - Existing Backends - - - - - -

Existing backends and supported platforms

- -

Supported Features

- -

(Follow the links to learn more about each backend.)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OraclePostgreSQLMySQLSQLite3FirebirdODBC
Binding by NameYESYES (>=8.0)YESYESYESYES
Dynamic BindingYESYESYESYESYESYES
Bulk OperationsYESYESYESYESYESYES
TransactionsYESYESYES - (with servers that support them, usually >= 4.0)YESYESYES
BLOB Data TypeYESYESNOYESYESNO
RowID Data TypeYESYESNONONONO
Nested StatementsYESNONONONONO
Stored ProceduresYESYESNO (but stored functions, YES)NOYESNO
- - - - - - - - - - diff --git a/doc/backends/mysql.html b/doc/backends/mysql.html deleted file mode 100644 index 2f0bd82c..00000000 --- a/doc/backends/mysql.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - SOCI - MySQL Backend Reference - - - - - -

MySQL Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI MySQL backend should in principle work with every version -of MySQL 3.x or newer. Some of the features (transactions, stored -functions) are not available when MySQL server doesn't support them.

- -

Tested Platforms

- - - - - - -
MySQL versionOperating SystemCompiler
5.0.45Linux i686 2.6.23 (Fedora release 7)g++ 4.1.2
- -

Required Client Libraries

- -

The SOCI MySQL backend requires MySQL's libmysqlclient -client library.

-

Note that the SOCI library itself depends also on libdl, so the minimum set of libraries needed to compile a basic client program is:

-
--lsoci_core -lsoci_mysql -ldl -lmysqlclient
-
- - -

Connecting to the Database

- -

To establish a connection to a MySQL server, create a session object -using the mysql backend factory together with a connection -string:

- -
-session sql(mysql, "db=test user=root password='Ala ma kota'");
-
-// or:
-session sql("mysql", "db=test user=root password='Ala ma kota'");
-
-// or:
-session sql("mysql://db=test user=root password='Ala ma kota'");
-
- -

The set of parameters used in the connection string for MySQL is:

-
    -
  • dbname or db (required)
  • -
  • user
  • -
  • password or pass
  • -
  • host
  • -
  • port
  • -
  • unix_socket
  • -
- -

Once you have created a session object as shown above, you -can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from invoices", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the session class.)

- -

SOCI Feature Support

-

Dynamic Binding

- -

The MySQL backend supports the use of the SOCI row class, -which facilitates retrieval of data which type is not known at compile -time.

- -

When calling row::get<T>(), the type you should pass -as T depends upon the underlying database type.
-For the MySQL backend, this type mapping is:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MySQL Data TypeSOCI Data Typerow::get<T> specializations
FLOAT, DOUBLE, DECIMAL and synonymsdt_doubledouble
TINYINT, SMALLINT, INT, BIGINT (provided it's in the range)dt_integerint
STRING/BINARY, VARCHAR/VARBINARYdt_stringstd::string
TIMESTAMP (works only with MySQL >= 5.0), DATE, - TIME, DATETIMEdt_datestd::tm
- -

(See the dynamic resultset binding documentation for general information on using the Row class.)

- -

Binding by Name

- -

In addition to binding by -position, the MySQL backend supports -binding by name, via an overload -of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

It should be noted that parameter binding of any kind is supported -only by means of emulation, since the underlying API used by the backend -doesn't provide this feature.

- -

Bulk Operations

- -

The MySQL backend has full support for SOCI's bulk operations interface. This feature is also supported -by emulation.

- -

Transactions

- -

Transactions are also -supported by the MySQL backend. Please note, however, that transactions -can only be used when the MySQL server supports them (it depends on -options used during the compilation of the server; typically, but not -always, servers >=4.0 support transactions and earlier versions do not) -and only with appropriate table types. -

- -

BLOB Data Type

- -

SOCI blob interface is not supported by the MySQL backend.

- -

RowID Data Type

- -

The rowid functionality is not supported by the MySQL backend.

- -

Nested Statements

- -

Nested statements are not supported by the MySQL backend.

- -

Stored Procedures

- -

MySQL version 5.0 and later supports two kinds of -stored routines: stored procedures and stored functions -(for details, please consult the -MySQL -documentation). Stored functions can be executed by using -SOCI's procedure class. -There is currently no support for stored procedures.

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several get_backend() functions, as described in the Beyond SOCI documentation.

- -

The MySQL backend provides the following concrete classes for native API access:

- - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
session_backend * session::get_backend()mysql_session_backend
statement_backend * statement::get_backend()mysql_statement_backend
- - -

Backend-specific extensions

- -

None.

- -

Configuration options

- -

None.

- - - - diff --git a/doc/backends/odbc.html b/doc/backends/odbc.html deleted file mode 100644 index 6f63ed39..00000000 --- a/doc/backends/odbc.html +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - SOCI - ODBC Backend Reference - - - - - -

ODBC Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI ODBC backend is supported for use with ODBC 3.

- -

Tested Platforms

- - - - - - - - -
ODBC versionOperating SystemCompiler
3Windows XPVisual Studio 2005 (express)
3Windows XPVisual C++ 8.0 Professional
3Windows XP(cygwin) g++ 3.3.4
- -

Required Client Libraries

- -

The SOCI ODBC backend requires the ODBC client library.

- -

Connecting to the Database

- -

To establish a connection to the ODBC database, create a Session object -using the ODBC backend factory together with a connection string:

- -
-BackEndFactory const &backEnd = odbc;
-Session sql(backEnd, "filedsn=c:\\my.dsn");
-
- -

or simply:

- -
-Session sql(odbc, "filedsn=c:\\my.dsn");
-
- -

The set of parameters used in the connection string for ODBC is the same as accepted by the SQLDriverConnect function from the ODBC library.

- -

Once you have created a Session object as shown above, you can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from invoices", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the Session class.)

- -

SOCI Feature Support

-

Dynamic Binding

- -

The ODBC backend supports the use of the SOCI Row class, which facilitates retrieval of data whose type is not known at compile time.

- -

When calling Row::get<T>(), the type you should pass as T depends upon the underlying database type.
For the ODBC backend, this type mapping is:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ODBC Data TypeSOCI Data TypeRow::get<T> specializations
SQL_DOUBLE - , SQL_DECIMAL - , SQL_REAL - , SQL_FLOAT - , SQL_NUMERIC - eDoubledouble
SQL_TINYINT - , SQL_SMALLINT - , SQL_INTEGER - , SQL_BIGINTeIntegerint
SQL_CHAR, SQL_VARCHAReStringstd::string
SQL_TYPE_DATE - , SQL_TYPE_TIME - , SQL_TYPE_TIMESTAMPeDatestd::tm
- -

Not all ODBC drivers support all datatypes

- -

(See the dynamic resultset binding documentation for general information on using the Row class.)

- -

Binding by Name

- -

In addition to binding by position, the ODBC backend supports binding by name, via an overload of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

Apart from the portable "colon-name" syntax above, which is achieved by rewriting the query string, the backend also supports the ODBC ? syntax:

- -
-int i = 7;
-int j = 8;
-sql << "insert into t(x, y) values(?, ?)", use(i), use(j);
-
- -

Bulk Operations

- -

The ODBC backend has support for SOCI's bulk operations interface. Not all ODBC drivers support bulk operations, the following is a list of some tested backends:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ODBC DriverBulk ReadBulk Insert
MS SQL Server 2005YESYES
MS Access 2003YESNO
PostgresQL 8.1YESYES
MySQL 4.1NONO
- -

Transactions

- -

Transactions are also fully supported by the ODBC backend, provided that they are supported by the underlying database.

- -

BLOB Data Type

- -

Not currently supported

- -

RowID Data Type

- -

Not currently supported

- -

Nested Statements

- -

Not currently supported

- -

Stored Procedures

- -

Not currently supported

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several getBackEnd() functions, as described in the beyond SOCI documentation.

- -

The ODBC backend provides the following concrete classes for navite API access:

- - - - - - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
SessionBackEnd* Session::getBackEnd()ODBCSessionBackEnd
StatementBackEnd* Statement::getBackEnd()ODBCStatementBackEnd
RowIDBackEnd* RowID::getBackEnd()ODBCRowIDBackEnd
- - -

Backend-specific extensions

-

ODBCSOCIError

- -

The ODBC backend can throw instances of class ODBCSOCIError, -which is publicly derived from SOCIError and has -additional public members containing the ODBC error code, the Native database error code, and the message returned from ODBC:

- -
-int main()
-{
-    try
-    {
-        // regular code
-    }
-    catch (SOCI::ODBCSOCIError const & e)
-    {
-        cerr << "ODBC Error Code: " << e.odbcErrorCode() << endl
-             << "Native Error Code: " << e.nativeErrorCode() << endl
-             << "SOCI Message: " << e.what() << std::endl
-             << "ODBC Message: " << e.odbcErrorMessage() << endl;
-    }
-   catch (exception const &e)
-    {
-        cerr << "Some other error: " << e.what() << endl;
-    }
-}
-
-

Configuration options

- -

None

- - - - diff --git a/doc/backends/oracle.html b/doc/backends/oracle.html deleted file mode 100644 index faa46110..00000000 --- a/doc/backends/oracle.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - SOCI - Oracle Backend Reference - - - - - -

Oracle Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI Oracle backend is currently supported for use with Oracle 10 or later.
-Older versions of Oracle may work as well, but they have not been tested by the SOCI team.

- -

Tested Platforms

- - - - - - -
Oracle versionOperating SystemCompiler
10.2.0 (XE)Linux i686 2.6.9 (RedHat family)g++ 3.4.6
- -

Required Client Libraries

- -

The SOCI Oracle backend requires Oracle's libclntsh client library. -Depending on the particular system, the libnnz10 library might be needed as well.

-

Note that the SOCI library itself depends also on libdl, so the minimum set of libraries needed to compile a basic client program is:

-
--lsoci_core -lsoci_oracle -ldl -lclntsh -lnnz10
-
- -

Connecting to the Database

- -

To establish a connection to an Oracle database, create a session object -using the oracle backend factory together with a connection string:

- -
-session sql(oracle, "service=orcl user=scott password=tiger");
-
-// or:
-session sql("oracle", "service=orcl user=scott password=tiger");
-
-// or:
-session sql("oracle://service=orcl user=scott password=tiger");
-
- -

The set of parameters used in the connection string for Oracle is:

-
    -
  • service
  • -
  • user
  • -
  • password
  • -
  • mode (optional)
  • -
-

The first 3 of these parameters have to be provided as part of the connection string.

-

The mode parameter allows to specify the connection mode and can be any of:

-
    -
  • default (which is assumed if omitted)
  • -
  • sysdba
  • -
  • sysoper
  • -
- -

Once you have created a session object as shown above, you can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from user_tables", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the session class.)

- -

SOCI Feature Support

- -

Dynamic Binding

- -

The Oracle backend supports the use of the SOCI row class, which facilitates retrieval of data which type is not known at compile time.

- -

When calling row::get<T>(), the type you should pass as T depends upon the underlying database type.
For the Oracle backend, this type mapping is:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Oracle Data TypeSOCI Data Typerow::get<T> specializations
number (where scale > 0)dt_doubledouble
number
(where scale = 0 and precision < std::numeric_limits<int>::digits10)
dt_integerint
numberdt_long_longlong long
char, varchar, varchar2dt_stringstd::string
datedt_datestd::tm
- -

(See the dynamic resultset binding documentation for general information on using the row class.)

- -

Binding by Name

- -

In addition to binding by position, the Oracle backend supports binding by name, via an overload of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

SOCI's use of ':' to indicate a value to be bound within a SQL string is consistant with the underlying Oracle client library syntax.

- -

Bulk Operations

- -

The Oracle backend has full support for SOCI's bulk operations interface.

- -

Transactions

- -

Transactions are also fully supported by the Oracle backend, -although transactions with non-default isolation levels have to be managed by explicit SQL statements.

- -

blob Data Type

- -

The Oracle backend supports working with data stored in columns of type Blob, via SOCI's blob class.

- -

rowid Data Type

- -

Oracle rowid's are accessible via SOCI's rowid class.

- -

Nested Statements

- -

The Oracle backend supports selecting into objects of type statement, so that you may work with nested sql statements and PL/SQL cursors:

- -
-statement stInner(sql);
-statement stOuter = (sql.prepare <<
-    "select cursor(select name from person order by id)"
-    " from person where id = 1",
-    into(stInner));
-stInner.exchange(into(name));
-stOuter.execute();
-stOuter.fetch();
-
-while (stInner.fetch())
-{
-    std::cout << name << '\n';
-}
-
- -

Stored Procedures

- -

Oracle stored procedures can be executed by using SOCI's procedure class.

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several get_backend() functions, as described in the Beyond SOCI documentation.

- -

The Oracle backend provides the following concrete classes for navite API access:

- - - - - - - - - - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
session_backend * session::get_backend()oracle_session_backend
statement_backend * statement::get_backend()oracle_statement_backend
blob_backend * blob::get_backend()oracle_blob_backend
rowid_backend * rowid::get_backend()oracle_rowid_backend
- - -

Backend-specific extensions

-

eracle=soci_error

- -

The Oracle backend can throw instances of class oracle_soci_error, -which is publicly derived from soci_error and has an -additional public err_num_ member containing the Oracle error code:

- -
-int main()
-{
-    try
-    {
-        // regular code
-    }
-    catch (oracle_soci_error const & e)
-    {
-        cerr << "Oracle error: " << e.err_num_
-            << " " << e.what() << endl;
-    }
-    catch (exception const &e)
-    {
-        cerr << "Some other error: " << e.what() << endl;
-    }
-}
-
- - - - diff --git a/doc/backends/postgresql.html b/doc/backends/postgresql.html deleted file mode 100644 index f30123a2..00000000 --- a/doc/backends/postgresql.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - SOCI - PostgreSQL Backend Reference - - - - - -

PostgreSQL Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI PostgreSQL backend is supported for use with PostgreSQL >= 7.3, although versions older than 8.0 will suffer from limited feature support. See below for details.

- -

Tested Platforms

- - - - - - - - - - -
PostgreSQL versionOperating SystemCompiler
8.3Mac OS X 10.5.3g++ 4.0.1
8.3Mac OS X 10.5.3g++ 4.4.0
8.3FreeBSD 7.0g++ 4.2.1
8.3Linux i686 2.6.9 (RedHat family)g++ 3.4.6
8.2.7Linux i686 2.6.23 (Fedora release 7)g++ 4.1.2
- -

Required Client Libraries

- -

The SOCI PostgreSQL backend requires PostgreSQL's libpq client library.

-

Note that the SOCI library itself depends also on libdl, so the minimum set of libraries needed to compile a basic client program is:

-
--lsoci_core -lsoci_postgresql -ldl -lpq
-
- -

Connecting to the Database

- -

To establish a connection to the PostgreSQL database, create a session object -using the postgresql backend factory together with a connection string:

- -
-session sql(postgresql, "dbname=mydatabase");
-
-// or:
-session sql("postgresql", "dbname=mydatabase");
-
-// or:
-session sql("postgresql://dbname=mydatabase");
-
- -

The set of parameters used in the connection string for PostgreSQL is the same as accepted by the PQconnectdb function from the libpq library.

- -

Once you have created a session object as shown above, you can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from invoices", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the session class.)

- -

SOCI Feature Support

- -

Dynamic Binding

- -

The PostgreSQL backend supports the use of the SOCI row class, which facilitates retrieval of data whose type is not known at compile time.

- -

When calling row::get<T>(), the type you should pass as T depends upon the underlying database type.
For the PostgreSQL backend, this type mapping is:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PostgreSQL Data TypeSOCI Data Typerow::get<T> specializations
numeric, real, doubledt_doubledouble
boolean, smallint, integerdt_integerint
int8dt_long_longlong long
oiddt_unsigned_longunsigned long
char, varchar, text, cstring, bpchardt_stringstd::string
abstime, reltime, date, time, timestamp, timestamptz, timetzdt_datestd::tm
- -

(See the dynamic resultset binding documentation for general information on using the row class.)

- -

Binding by Name

- -

In addition to binding by position, the PostgreSQL backend supports binding by name, via an overload of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

Apart from the portable "colon-name" syntax above, which is achieved by rewriting the query string, the backend also supports the PostgreSQL native numbered syntax:

- -
-int i = 7;
-int j = 8;
-sql << "insert into t(x, y) values($1, $2)", use(i), use(j);
-
- -

The use of native syntax is not recommended, but can be nevertheless imposed by switching off the query rewriting. This can be achieved by defining the macro SOCI_PGSQL_NOBINDBYNAME and it is actually necessary for PostgreSQL 7.3, in which case binding of use elements is not supported at all. See the Configuration options section for details.

- -

Bulk Operations

- -

The PostgreSQL backend has full support for SOCI's bulk operations interface.

- -

Transactions

- -

Transactions are also fully supported by the PostgreSQL backend.

- -

blob Data Type

- -

The PostgreSQL backend supports working with data stored in columns of type Blob, via SOCI's blob class with the exception that trimming is not supported.

- -

rowid Data Type

- -

The concept of row identifier (OID in PostgreSQL) is supported via SOCI's rowid class.

- -

Nested Statements

- -

Nested statements are not supported by PostgreSQL backend.

- -

Stored Procedures

- -

PostgreSQL stored procedures can be executed by using SOCI's procedure class.

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several get_backend() functions, as described in the beyond SOCI documentation.

- -

The PostgreSQL backend provides the following concrete classes for navite API access:

- - - - - - - - - - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
session_backend * session::get_backend()postgresql_session_backend
statement_backend * statement::get_backend()postgresql_statement_backend
blob_backend * blob::get_backend()postgresql_blob_backend
rowid_backend * rowid::get_backend()postgresql_rowid_backend
- - -

Backend-specific extensions

- -

None.

- -

Configuration options

- -

To support older PostgreSQL versions, the following configuration macros are recognized:

-
    -
  • SOCI_PGSQL_NOBINDBYNAME - switches off the query rewriting.
  • -
  • SOCI_PGSQL_NOPARAMS - disables support for parameterized queries (binding of use elements), automatically imposes also the SOCI_PGSQL_NOBINDBYNAME macro. It is necessary for PostgreSQL 7.3.
  • -
  • SOCI_PGSQL_NOPREPARE - disables support for separate query preparation, which in this backend is significant only in terms of optimization. It is necessary for PostgreSQL 7.3 and 7.4.
  • -
- - - - - diff --git a/doc/backends/sqlite3.html b/doc/backends/sqlite3.html deleted file mode 100644 index 88b753cc..00000000 --- a/doc/backends/sqlite3.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - SOCI - SQLite3 Backend Reference - - - - - -

SQLite3 Backend Reference

- - - -

Prerequisites

-

Supported Versions

- -

The SOCI SQLite3 backend is supported for use with SQLite3 >= 3.1

- -

Tested Platforms

- - - - - - - - - - - - - - -
SQLite3 versionOperating SystemCompiler
3.5.2Mac OS X 10.5g++ 4.0.1
3.1.3Mac OS X 10.4g++ 4.0.1
3.2.1Linux i686 2.6.10-gentoo-r6g++ 3.4.5
3.3.4Ubuntu 5.1g++ 4.0.2
3.3.4Windows XP(cygwin) g++ 3.3.4
3.3.4Windows XPVisual C++ 2005 Express Edition
3.3.8Windows XPVisual C++ 2005 Professional
3.4.0Windows XP(cygwin) g++ 3.4.4
3.4.0Windows XPVisual C++ 2005 Express Edition
- -

Required Client Libraries

- -

The SOCI SQLite3 backend requires SQLite3's libsqlite3 client library.

- -

Connecting to the Database

- -

To establish a connection to the SQLite3 database, create a Session object -using the SQLite3 backend factory together with the database file name:

- -
-session sql(sqlite3, "database_filename");
-
- -

The only option for the connection string is the name of the file to use as a database.

- -

Once you have created a Session object as shown above, you can use it to access the database, for example:

-
-int count;
-sql << "select count(*) from invoices", into(count);
-
- -

(See the SOCI basics and exchanging data documentation for general information on using the Session class.)

- -

SOCI Feature Support

-

Dynamic Binding

- -

The SQLite3 backend supports the use of the SOCI Row class, which facilitates retrieval of data whose type is not known at compile time.

- -

When calling Row::get<T>(), the type you should pass as T depends upon the underlying database type.

- -

For the SQLite3 backend, this type mapping is complicated by the fact the SQLite3 does not enforce types *, and makes no attempt to validate the type names used in table creation or alteration statements. SQLite3 will return the type as a string, SOCI will recognize the following strings and match them the corresponding SOCI types:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SQLite3 Data TypeSOCI Data TypeRow::get<T> specializations
*float*eDoubledouble
*int*eIntegerint
*char*eStringstd::string
*date*, *time*eDatestd::tm
- -

* There is one case where SQLite3 enforces type. If a column is declared as "integer primary key", then SQLite3 uses that as an alias to the internal ROWID column that exists for every table. Only integers are allowed in this column.

- -

(See the dynamic resultset binding documentation for general information on using the Row class.)

- -

Binding by Name

- -

In addition to binding by position, the SQLite3 backend supports binding by name, via an overload of the use() function:

- -
-int id = 7;
-sql << "select name from person where id = :id", use(id, "id")
-
- -

The backend also supports the SQLite3 native numbered syntax, "one or more literals can be replace by a parameter "?" or ":AAA" or "@AAA" or "$VVV" where AAA is an alphanumeric identifier and VVV is a variable name according to the syntax rules of the TCL programming language." [1]:

- -
-int i = 7;
-int j = 8;
-sql << "insert into t(x, y) values(?, ?)", use(i), use(j);
-
- -

Bulk Operations

- -

The SQLite3 backend has full support for SOCI's bulk operations interface. However, this support is emulated and is not native.

- -

Transactions

- -

Transactions are also fully supported by the SQLite3 backend.

- -

BLOB Data Type

- -

The SQLite3 backend supports working with data stored in columns of type Blob, via SOCI's blob class. Because of SQLite3 general typelessness the column does not have to be declared any particular type.

-

RowID Data Type

- -

In SQLite3 RowID is an integer. "Each entry in an SQLite table has a unique integer key called the "rowid". The rowid is always available as an undeclared column named ROWID, OID, or _ROWID_. If the table has a column of type INTEGER PRIMARY KEY then that column is another an alias for the rowid."[2]

- -

Nested Statements

- -

Nested statements are not supported by SQLite3 backend.

- -

Stored Procedures

- -

Stored procedures are not supported by SQLite3 backend

- -

Acessing the native database API

- -

SOCI provides access to underlying datbabase APIs via several getBackEnd() functions, as described in the beyond SOCI documentation.

- -

The SQLite3 backend provides the following concrete classes for navite API access:

- - - - - - - - - - - - - - - - - - - - -
Accessor FunctionConcrete Class
SessionBackEnd* Session::getBackEnd()SQLite3SessionBackEnd
StatementBackEnd* Statement::getBackEnd()SQLite3StatementBackEnd
RowIDBackEnd* RowID::getBackEnd()SQLite3RowIDBackEnd
- - -

Backend-specific extensions

- -

None.

- -

Configuration options

- -

None

- - - - diff --git a/doc/basics.html b/doc/basics.html deleted file mode 100644 index 70d002ff..00000000 --- a/doc/basics.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - SOCI - basics - - - - - -

Connections and simple queries

- -

Connecting to the database

- -

The session class encapsulates the database connection -and other backend-related details, which are common to all the -statements -that will be later executed. It has a couple of overloaded constructors.

- -

The most basic one expects two parameters: -the requested backend factory object and the generic connection string, -which meaning is backend-dependent.

-

Example:

- -
-session sql(oracle, "service=orcl user=scott password=tiger");
-
- -

Another example might be:

- -
-session sql(postgresql, "dbname=mydb");
-
- -

Above, the sql object is a local (automatic) object -that encapsulates the connection.

- -

This session constructor either connects successfully, or -throws an exception.

- -

Another constructor allows to name backends at run-time and supports -the dynamically loadable backends, which have to be compiled as shared libraries. The usage is similar to the above, but instead of providing the factory object, the backend name is expected:

- -
-session sql("postgresql", "dbname=mydb");
-
- -

For convenience, the URL-like form that combines both the backend name with connection parameters is supported as well:

- -
-session sql("postgresql://dbname=mydb");
-
- -

The last two constructors described above try to locate the shared library with the name libsoci_ABC.so (or libsoci_ABC.dll on Windows), where ABC is the backend name. In the above examples, the expected library name will be libsoci_postgresql.so for Unix-like systems.

- -
-

Environment configuration:

-

The SOCI_BACKENDS_PATH environment variable defines the set of paths where the shared libraries will be searched for. There can be many paths, separated by colons, and they are used from left to right until the library with the appropriate name is found. If this variable is not set or is empty, the current directory is used as a default path for dynamically loaded backends.

-
- -

An alternative way to set up the session is to create it in the disconnected state and connect later:

- -
-session sql;
-
-// some time later:
-sql.open(postgresql, "dbname=mydb");
-
-// or:
-sql.open("postgresql://dbname=mydb");
-
- -

The rules for backend naming are the same as with the constructors described above.

-

The session can be also explicitly closed and reconnected, which can help with basic session error recovery. The reconnect function has no parameters and attempts to use the same values as those provided with earlier constructor or open calls.

- -

See also the page devoted to multithreading for a detailed description of connection pools.

- -

It is possible to have many active sessions at the same -time, even using different backends.

- -
-

Portability note:

-

The following backend factories are currently (as of 3.0.0 release) available:

-
    -
  • mysql (requires #include "soci-mysql.h")
  • -
  • oracle (requires #include "soci-oracle.h")
  • -
  • postgresql (requires #include "soci-postgresql.h")
  • -
-

The following backends are also available, with various levels of completeness:

-
    -
  • sqlite3 (requires #include "soci-sqlite3.h")
  • -
  • odbc (requires #include "soci-odbc.h")
  • -
  • firebird (requires #include "soci-firebird.h")
  • -
-
- -

Simple SQL statements

- -

In many cases, the SQL query is intended to be executed only once, -which means that statement parsing and execution can go together. -The session class provides a special once -member, which triggers parsing and execution of such one-time -statements:

- -
-sql.once << "drop table persons";
-
- -

For shorter syntax, the following form is also allowed:

- -
-sql << "drop table persons";
-
- -

The IOStream-like interface is exactly what it looks like, so that -the -statement text can be composed of many parts, involving anything that -is streamable (including custom classes, if they have -appropriate operator<<):

- -
-string tableName = "persons";
-sql << "drop table " << tableName;
-
-int id = 123;
-sql << "delete from companies where id = " << id;
-
- - - - - - - - - - - diff --git a/doc/beyond.html b/doc/beyond.html deleted file mode 100644 index 3647c5d7..00000000 --- a/doc/beyond.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - SOCI - beyond - - - - - -

Beyond SOCI

- -

As the original name of the library (Simple Oracle Call Interface) -clearly stated, SOCI is intended to be a simple library, targetting the -majority of needs in regular C++ application. We do not claim that -everything can be done with SOCI and it was never the intent of the -library. What is important, though, is that the simplicity of the -library does not prevent the -client applications from reaching into the low-level specifics of each -database backend in order to achieve special configuration or -performance goals.

- -

Most of the SOCI classes have the getBackEnd method, -which -returns the pointer to the actual backend object that implements the -given functionality. The knowledge of the actual backend allows the -client application to get access to all low-level details that are -involved.

- -
-blob b(sql);
-
-oracle_session_back_end * sessionBackEnd = static_cast<oracle_session_back_end *>(sql.get_back_end());
-oracle_blob_back_end * blobBackEnd = static_cast<oracle_blob_back_end *>(b.get_back_end());
-
-OCILobDisableBuffering(sessionBackEnd->svchp_, sessionBackEnd->errhp_, blobBackEnd->lobp_);
-
- -

The above code creates the blob object and uses two calls -to the get_back_end function (on both the session -and the blob objects) to get access to the actual backend -objects. Assuming that it is the "oracle" backend which -is in use, the downcasts allow to access all relevant low-level handles -and use them in the call -to the OCILobDisableBuffering function. This way, the -BLOB handle was configured in a way that the SOCI library alone would -not allow.

- -
-rowid rid(sql); // sql is a session object
-sql << "select oid from mytable where id = 7", into(rid);
-
-postgresql_rowid_back_end * rbe = static_cast<postgresql_rowid_back_end *>(rid.get_back_end());
-
-unsigned long oid = rbe->value_;
-
- -

The above example retrieves the rowid ("something" that -identifies the -row in the table) from the table and uses the get_back_end -function to -extract the actual object that implements this functionality. Assuming -that it is the "postgresql" backend which is in use, the -downcast is -performed to use the postgresql_rowid_back_end interface to -get the actual -OID value that is a physical, low-level implementation of row -identifier on PostgreSQL databases.

- -

In order for any of the above to compile, you have to explicitly #include -the appropriate backend's header file.

- -

Please see the header file related to the given backend to learn what -low-level handles and descriptors are available.

- - - - - - - - - - - diff --git a/doc/boost.html b/doc/boost.html deleted file mode 100644 index dc441e8b..00000000 --- a/doc/boost.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - SOCI - integration with Boost - - - - - -

Integration with Boost

- -

The SOCI user code can be easily integrated with the Boost library thanks to the very flexible type conversion facility. There are three important Boost types that are supported out of the box.

- -

boost::optional<T>

- -

boost::optional<T> provides an alternative way to support the null data condition and as such relieves the user from necessity to handle separate indicator values.

-

The boost::optional<T> objects can be used everywhere where the regular user provided -values are expected.

-

Example:

- -
-boost::optional<string> name;
-sql << "select name from person where id = 7", into(name);
-
-if (name.is_initialized())
-{
-    // OK, the name was retrieved and is not-null
-    cout << "The name is " << name.get();
-}
-else
-{
-    // the name is null
-}
-
- -

The boost::optional<T> objects are fully supported for both into and use elements, in both single and vector forms. They can be also used for user-defined data types.

- -

boost::tuple<T1, ...>

- -

boost::tuple<T1, ...> allows to work with whole rows of information and in some cases can be more convenient to use than the more dynamically-oriented row type.

-

Example:

- -
-boost::tuple<string, string, int> person;
-
-sql << "select name, phone, salary from persons where ...",
-    into(person);
-
- -

Tuples are supported for both into and use elements. They can be used with rowset as well.

- -

Tuples can be also composed with boost::optional<T>:

- -
-boost::tuple<string, boost::optional<string>, int> person;
-
-sql << "select name, phone, salary from persons where ...",
-    into(person);
-
-if (person.get<1>().is_initialized())
-{
-    // the given person has a phone number
-}
-else
-{
-    // this person does not have a phone number
-}
-
- -

boost::fusion::vector<T1, ...>

- -

The boost::fusion::vector types are supported in the same way as tuples.

- -

boost::gregorian::date

- -

The boost::gregorian::date is provided as a conversion for base type std::tm and can be used as a replacement for it.

- -
-

Optional integration:

-

The integration with Boost types is optional and not enabled by default, which means that SOCI can be compiled and used without any dependency on Boost.

-

In order to enable the support for any of the above types, the user needs to either include one of these headers:

-
-#include <boost-optional.h>
-#include <boost-tuple.h>
-#include <boost-fusion.h>
-#include <boost-gregorian-date.h>
-
-

or to define the SOCI_USE_BOOST macro before including the soci.h main header file. Note that in this case the support for boost::fusion::vector is enabled only if the detected Boost version is at least 1.35.

-
- - - - - - - - - - - diff --git a/doc/errors.html b/doc/errors.html deleted file mode 100644 index 82beccd1..00000000 --- a/doc/errors.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - SOCI - errors - - - - - -

Errors

- -

All DB-related errors manifest themselves as exceptions of type soci_error, -which is derived from std::runtime_error.
-This allows to -handle database errors within the standard exception framework:

- -
-int main()
-{
-    try
-    {
-        // regular code
-    }
-    catch (exception const & e)
-    {
-        cerr << "Bang! " << e.what() << endl;
-    }
-}
-
- -
-

Portability note:

-

The Oracle backend can also throw the instances of the oracle_soci_error, -which is publicly derived from soci_error and has an -additional public err_num_ -member containing the Oracle error code:

- -
-int main()
-{
-    try
-    {
-        // regular code
-    }
-    catch (oracle_soci_error const & e)
-    {
-        cerr << "Oracle error: " << e.err_num_
-            << " " << e.what() << endl;
-    }
-    catch (exception const & e)
-    {
-        cerr << "Some other error: " << e.what() << endl;
-    }
-}
-
-
- -
-

Portability note:

-

The MySQL backend can throw instances of the mysql_soci_error, -which is publicly derived from soci_error and has an -additional public err_num_ -member containing the MySQL error code (as returned by -mysql_errno()):

- -
-int main()
-{
-    try
-    {
-        // regular code
-    }
-    catch (mysql_soci_error const & e)
-    {
-        cerr << "MySQL error: " << e.err_num_
-            << " " << e.what() << endl;
-    }
-    catch (exception const & e)
-    {
-        cerr << "Some other error: " << e.what() << endl;
-    }
-}
-
-
- - - - - - - - - - - diff --git a/doc/exchange.html b/doc/exchange.html deleted file mode 100644 index 86391a6d..00000000 --- a/doc/exchange.html +++ /dev/null @@ -1,742 +0,0 @@ - - - - - - SOCI - exchanging data - - - - - -

Exchanging data

- - - -

Binding local data

- -
-

Note: -The Oracle documentation uses two terms: defining (for -instructing the library where the output data should go) and binding -(for the input data and input/output PL/SQL -parameters). For the sake of simplicity, SOCI uses the term binding -for both of these.

-
- -

Binding output data

- -

The into expression is used to add binding information to -the statement:

- -
-int count;
-sql << "select count(*) from person", into(count);
-
-string name;
-sql << "select name from person where id = 7", into(name);
-
- -

In the above examples, some data is retrieved from the database and -transmitted into the given local variable.

- -

There should be as many into elements as there are -expected columns in the result (see dynamic -resultset binding for the exception to this rule).

- -

Binding input data

- -

The use expression associates the SQL placeholder (written with colon) with the local data:

- -
-int val = 7;
-sql << "insert into numbers(val) values(:val)", use(val);
-
- -

In the above statement, the first "val" is a column name (assuming -that -there is appropriate table numbers with this column), the -second "val" (with colon) is a -placeholder and its name is ignored here, and the third "val" is a name -of local variable.

- -

To better understand the meaning of each "val" above, consider also:

- -
-int number = 7;
-sql << "insert into numbers(val) values(:blabla)", use(number);
-
- -

Both examples above will insert the value of some local variable into -the table numbers - we say that the local variable is used in the SQL statement.

- -

There should be as many use elements as there are -parameters used in the SQL query.

- -
-

Portability note:

-

Older versions of the PostgreSQL client API do not allow to use input -parameters at all. In order to compile SOCI with those old client -libraries, define the SOCI_POSTGRESQL_NOPARAMS preprocessor -name passing -DSOCI_POSTGRESQL_NOPARAMS=ON variable to CMake.

-
- -

Binding by position

- -

If there is more output or input "holes" in the single statement, it -is possible to use many into and use -expressions, separated by commas, where each expression will be -responsible for the consecutive "hole" in the statement:

- -
-string firstName = "John", lastName = "Smith";
-int personId = 7;
-
-sql << "insert into person(id, firstname, lastname) values(:id, :fn, :ln)",
-    use(personId), use(firstName), use(lastName);
-
-sql << "select firstname, lastname from person where id = :id",
-    into(firstName), into(lastName), use(personId);
-
- -

In the code above, the order of "holes" in the SQL statement and the -order of into and use expression should -match.

- -

Binding by name

- -

The SQL placeholders that have their names (with colon) can be bound -by name to clearly associate the local variable with the given placehorder.

- -

This explicit naming allows to use different order of elements:

- -
-string firstName = "John", lastName = "Smith";
-int personId = 7;
-sql << "insert into person(id, firstname, lastname) values(:id, :fn, :ln)",
-    use(firstName, "fn"), use(lastName, "ln"), use(personId, "id");
-
- -

or bind the same local data to many "holes" at the same time:

- -
-string addr = "...";
-sql << "update person"
-       " set mainaddress = :addr, contactaddress = :addr"
-       " where id = 7",
-       use(addr, "addr");
-
- -
-

Object lifetime and immutability:

-

SOCI assumes that local variables provided as use elements -live at least as long at it takes to execute the whole statement. -In short statement forms like above, the statement is executed sometime -at the end of the full expression and the whole process is driven by the invisible -temporary object handled by the library. If the data provided by user comes -from another temporary variable, it might be possible for the compiler to arrange -them in a way that the user data will be destroyed before the statement will -have its chance to execute, referencing objects that no longer exist:

-
-// dangerous code:
-
-string getNameFromSomewhere();
-
-sql << "insert into person(name) values(:n)",
-    use(getNameFromSomewhere());
-
-

In the above example, the data passed to the database comes from the temporary -variable that is a result of call to getNameFromSomewhere - this -should be avoided and named variables should be used to ensure safe lifetime relations:

-
-// safe code:
-
-string getNameFromSomewhere();
-
-string name = getNameFromSomewhere();
-sql << "insert into person(name) values(:n)",
-    use(name);
-
- -

It is still possible to provide const data for use elements. -Note that some database servers, like Oracle, allow PL/SQL procedures to modify their -in/out parameters - this is detected by the SOCI library and an error is reported -if the database attempts to modify the use element that holds const -data.

-

The above example can be ultimately written in the following way:

-
-// safe and efficient code:
-
-string getNameFromSomewhere();
-
-const string & name = getNameFromSomewhere();
-sql << "insert into person(name) values(:n)",
-    use(name);
-
-
- -
-

Portability notes:

-

The PostgreSQL backend allows to use the "native" PostgreSQL way of -naming parameters in the query, which is by numbers like $1, -$2, $3, etc. In fact, the backend rewrites -the given query to the native form - and this is also one of the very few places -where SOCI intrudes into the SQL query. For portability reasons, it is -recommended to use named parameters, as shown in the examples above.
-The query rewriting can be switched off by compiling the backend with -the SOCI_POSTGRESQL_NOBINDBYNAME name defined (pass --DSOCI_POSTGRESQL_NOBINDBYNAME=ON variable to CMake). -Note that in this case it is also necessary to define SOCI_POSTGRESQL_NOPREPARE -(controlled by CMake variable -DSOCI_POSTGRESQL_NOPREPARE=ON), -because statement preparation relies on successful query rewriting. -In practice, both macros will be needed for PostgreSQL server older than 8.0.

-
- -

Handling nulls and other conditions

- -

Indicators

- -

In order to support null values and other conditions which are not -real errors, the concept of indicator is provided.

- -

For example, when the following SQL query is executed:

-
-select name from person where id = 7
-
- -

there are three possible outcomes:

-
    -
  1. there is a person with id = 7 and his name is returned
  2. -
  3. there is a person with id = 7, but he has no name (his name is -null in the database table)
  4. -
  5. there is no such person
  6. -
- -

Whereas the first alternative is easy to handle, the other two are more -complex. Moreover, they are not necessarily errors from the -application's point of view and what's more interesting, they are different -and the application may wish to detect which is the case.
-The following example does this:

- -
-string name;
-indicator ind;
-
-sql << "select name from person where id = 7", into(name, ind);
-
-if (sql.got_data())
-{
-    switch (ind)
-    {
-    case i_ok:
-        // the data was returned without problems
-        break;
-    case i_null:
-        // there is a person, but he has no name (his name is null)
-        break;
-    case i_truncated:
-        // the name was returned only in part,
-        // because the provided buffer was too short
-        // (not possible with std::string, but possible with char* and char[])
-        break;
-    }
-}
-else
-{
-    // no such person in the database
-}
-
- -

The use of indicator variable is optional, but if it is not used and -the result would be i_null, -then the exception is thrown. This means that you should use indicator -variables everywhere where the application logic (and database schema) -allow the "attribute not set" condition.

- -

Indicator variables can be also used when binding input data, to -control whether the data is to be used as provided, or explicitly -overrided to be null:

- -
-int id = 7;
-string name;
-indicator ind = i_null;
-sql << "insert into person(id, name) values(:id, :name)",
-    use(id), use(name, ind);
-
- -

In the above example, the row is inserted with name -attribute set to null.

- -

Indicator variables can also be used in conjunction with vector -based insert, update, and select statements:

- -
-vector<string> names(100);
-vector<indicator> inds;
-sql << "select name from person where id = 7", into(names, inds);
-
- -

The above example retrieves first 100 rows of data (or less). The -initial size of names vector provides the (maximum) -number of rows that should be read. Both vectors will be -automatically resized according to the number of rows that were -actually read.

- -

The following example inserts null for each value of name:

- -
-vector<int> ids;
-vector<string> names;
-vector<indicator> nameIndicators;
-
-for (int i = 0; i != 10; ++i)
-{
-    ids.push_back(i);
-    names.push_back("");
-    nameIndicators.push_back(i_null);
-}
-
-sql << "insert into person(id, name) values(:id, :name)",
-    use(ids), use(name, nameIndicators);
-
- -

See also Integration with Boost to learn -how the Boost.Optional library can be used to handle null data conditions -in a more natural way.

- -

Types

- -

Static type binding

- -

The static binding for types is most useful when the types used in -the database are known at compile time - this was already presented -above with the help of into and use -functions.

- -

The following types are currently supported for use with into -and use expressions:

-
    -
  • char (for character values)
  • -
  • short, int, unsigned -long, long long, double (for numeric values)
  • -
  • char*, char[], std::string -(for string values)
  • -
  • std::tm (for datetime -values)
  • -
  • soci::statement (for nested statements and PL/SQL -cursors)
  • -
  • soci::blob (for Binary Large OBjects)
  • -
  • soci::row_id (for row identifiers)
  • -
- -

See the test code that accompanies the library to see how each of -these types is used.

- -

Static type binding for bulk operations

- -

Bulk inserts, updates, and selects are supported through the -following std::vector based into and use types: -

-
    -
  • std::vector<char>
  • -
  • std::vector<short>
  • -
  • std::vector<int>
  • -
  • std::vector<unsigned long>
  • -
  • std::vector<long long>
  • -
  • std::vector<double>
  • -
  • std::vector<std::string>
  • -
  • std::vector<std::tm>
  • -
- -

Use of the vector based types mirrors that of the standard types, with -the size of the vector used to specify the number of records to process -at a time. See below for examples.

- -

Note that bulk operations are supported only for std::vectors of the types listed above.

- -

Dynamic resultset binding

- -

For certain applications it is desirable to be able to select data from -arbitrarily structured tables (e.g. via "select * from ...") and format the -resulting data based upon its type. -SOCI supports this through the soci::row and soci::column_properties -classes.

- -

Data is selected into a row object, which holds column_properties -objects describing -the attributes of data contained in each column. Once the data type for each -column is known, the data can be formatted appropriately.

- -

For example, the code below creates an XML document from a selected row -of data from an arbitrary table:

- -
-row r;
-sql << "select * from some_table", into(r);
-
-std::ostringstream doc;
-doc << "<row>" << std::endl;
-for(std::size_t i = 0; i != r.size(); ++i)
-{
-    const column_properties & props = r.get_properties(i);
-
-    doc << '<' << props.get_name() << '>';
-
-    switch(props.get_data_type())
-    {
-    case dt_string:
-        doc << r.get<std::string>(i);
-        break;
-    case dt_double:
-        doc << r.get<double>(i);
-        break;
-    case dt_integer:
-        doc << r.get<int>(i);
-        break;
-    case dt_unsigned_long:
-        doc << r.get<unsigned long>(i);
-        break;
-    case dt_long_long:
-        doc << r.get<long long>(i);
-        break;
-    case dt_date:
-        std::tm when = r.get<std::tm>(i);
-        doc << asctime(&when);
-        break;
-    }
-
-    doc << "</" << props.get_name() << '>' << std::endl;
-}
-doc << "</row>";
-
- -

The type T parameter that should be passed to -row::get<T>() depends on the SOCI data type that -is returned from -column_properties::get_data_type().

-

row::get<T>() -throws an exception of type -std::bad_cast if an incorrect type T is -requested.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SOCI Data Typerow::get<T> specialization
dt_doubledouble
dt_integerint
dt_unsigned_longunsigned long
dt_long_longlong long
dt_stringstd::string
dt_datestd::tm
- -

The mapping of underlying database column types to SOCI datatypes is database specific. -See the backend documentation for details.

- -

It is also possible to extract data from the row object using its stream-like -interface, where each extracted variable should have matching type respective to its position in the chain:

- -
-row r;
-sql << "select name, address, age from persons where id = 123", into(r);
-
-string name, address;
-int age;
-
-r >> name >> address >> age;
-
- -

Note, however, that this interface is not compatible with the standard -std::istream class and that it is only possible to extract a single row at a time -- for "safety" reasons the row boundary is preserved and it is necessary to perform the -fetch operation explicitly for each consecutive row -(see next page).

- -

Extending SOCI to support custom (user-defined) C++ types

- -

SOCI can be easily extended with support for user-defined datatypes.

- -

The extension mechanism relies on appropriate specialization of the type_conversion -struct that converts to and from one of the following SOCI base types:

- -
    -
  • double
  • -
  • int
  • -
  • unsigned long
  • -
  • long long
  • -
  • std::string
  • -
  • char
  • -
  • std::tm
  • -
- -

There are three required class members for a valid type_conversion -specialization:

-
    -
  • the base_type type definition, aliasing either one of the base types or another ser-defined type
  • -
  • the from_base() static member function, converting from -the base type
  • -
  • the to_base() static member function, converting to the -base type
  • -
- -

Note that no database-specific code is required to define user conversion.

- -

The following example shows how the user can extend SOCI to -support his own type MyInt, which here is some wrapper -for the fundamental int type:

- -
-class MyInt
-{
-public:
-    MyInt() {}
-    MyInt(int i) : i_(i) {}
-
-    void set(int i) { i_ = i; }
-    int get() const { return i_; }
-
-private:
-    int i_;
-};
-
-namespace soci
-{
-    template <>
-    struct type_conversion<MyInt>
-    {
-        typedef int base_type;
-
-        static void from_base(int i, indicator ind, MyInt & mi)
-        {
-            if (ind == i_null)
-            {
-                throw soci_error("Null value not allowed for this type");
-            }
-
-            mi.set(i);
-        }
-
-        static void to_base(const MyInt & mi, int & i, indicator & ind)
-        {
-            i = mi.get();
-            ind = i_ok;
-        }
-    };
-}
-
- -

The above specialization for soci::type_conversion<MyInt> is enough -to enable the following:

- -
-MyInt i;
-
-sql << "select count(*) from person", into(i);
-
-cout << "We have " << i.get() << " persons in the database.\n";
-
- -

Note that there is a number of types from the Boost library integrated with SOCI out of the box, see Integration with Boost for complete description. Use these as examples of conversions for more complext data types.

- -

Note also that user-defined datatypes are not supported with bulk data transfer.

- -

Another possibility to extend SOCI with custom data types is to use -the into_type<T> and use_type<T> -class templates, which specializations can be user-provided. These -specializations need to implement the interface defined by, -respectively, the into_type_base and use_type_base -classes.

- -

Note that when specializing these template classes the only convention -is that when the indicator -variable is used (see below), it should appear in the second position. -Please refer to the library source code to see how this is done for the -standard types.

- -

Object-relational mapping

- -

SOCI provides a class called values specifically to -enable object-relational mapping via type_conversion -specializations.

- -

For example, the following code maps a Person object to -and from a -database table containing columns "ID", "FIRST_NAME", "LAST_NAME", and -"GENDER".

- -

Note that the mapping is non-invasive - the Person object -itself does not contain any SOCI-specific code:

- -
-struct Person
-{
-    int id;
-    std::string firstName;
-    std::string lastName;
-    std::string gender;
-};
-
-namespace soci
-{
-template<> struct TypeConversion<Person>
-{
-    typedef values base_type;
-    static void from_base(values const & v, indicator /* ind */, Person & p)
-    {
-        p.id = v.get<int>("ID");
-        p.firstName = v.get<std::string>("FIRST_NAME");
-        p.lastName = v.get<std::string>("LAST_NAME");
-
-        // p.gender will be set to the default value "unknown"
-        // when the column is null:
-        p.gender = v.get<std::string>("GENDER", "unknown");
-
-        // alternatively, the indicator can be tested directly:
-        // if (v.indicator("GENDER") == i_null)
-        // {
-        //     p.gender = "unknown";
-        // }
-        // else
-        // {
-        //     p.gender = v.get<std::string>("GENDER");
-        // }
-    }
-    static void to_base(const Person & p, values & v, indicator & ind)
-    {
-        v.set("ID", p.id);
-        v.set("FIRST_NAME", p.firstName);
-        v.set("LAST_NAME", p.lastName);
-        v.set("GENDER", p.gender, p.gender.empty() ? i_null : i_ok);
-        ind = i_ok;
-    }
-};
-}
-
- -

With the above type_conversion specialization in place, it -is possible to use Person directly with SOCI:

- -
-session sql(oracle, "service=db1 user=scott password=tiger");
-
-Person p;
-p.id = 1;
-p.lastName = "Smith";
-p.firstName = "Pat";
-sql << "insert into person(id, first_name, last_name) "
-       "values(:ID, :FIRST_NAME, :LAST_NAME)", use(p);
-
-Person p1;
-sql << "select * from person", into(p1);
-assert(p1.id == 1);
-assert(p1.firstName + p.lastName == "PatSmith");
-assert(p1.gender == "unknown");
-
-p.firstName = "Patricia";
-sql << "update person set first_name = :FIRST_NAME "
-       "where id = :ID", use(p);
-
- -
-

Note: The values -class is currently not suited for use outside of type_conversion -specializations. It is specially designed to facilitate -object-relational mapping when used as shown above.

-
- -

Large objects (BLOBs)

- -

The SOCI library provides also an interface for basic operations on -large objects (BLOBs - Binary Large OBjects).

- -
-blob b(sql); // sql is a session object
-sql << "select mp3 from mymusic where id = 123", into(b);
-
- -

The following functions are provided in the blob -interface, mimicking the file-like operations:

-
    -
  • std::size_t get_len();
  • -
  • std::size_t read(std::size_t offset, char *buf, std::size_t -toRead);
  • -
  • std::size_t write(std::size_t offset, char const *buf, -std::size_t toWrite);
  • -
  • std::size_t append(char const *buf, std::size_t toWrite);
  • -
  • void trim(std::size_t newLen);
  • -
- -

The offset parameter is always counted from the beginning -of the BLOB's data.

- -
-

Portability notes:

-
    -
  1. The way to define BLOB table columns and create or destroy BLOB -objects in the database varies between different database engines. -Please see the SQL documentation relevant for the given server to learn -how this is actually done. The test programs provided with the SOCI -library can be also a simple source of full working examples.
  2. -
  3. The trim function is not currently available for -the PostgreSQL backend.
  4. -
-
- - - - - - - - - - - diff --git a/doc/index.html b/doc/index.html deleted file mode 100644 index f72520cc..00000000 --- a/doc/index.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - SOCI - - - - - -

Documentation and tutorial

- - - -

The following (complete!) example is purposedly provided without any explanation.

- -
-#include "soci.h"
-#include "soci-oracle.h"
-#include <iostream>
-#include <istream>
-#include <ostream>
-#include <string>
-#include <exception>
-
-using namespace soci;
-using namespace std;
-
-bool getName(string &name)
-{
-    cout << "Enter name: ";
-    return cin >> name;
-}
-
-int main()
-{
-    try
-    {
-        session sql(oracle, "service=mydb user=john password=secret");
-
-        int count;
-        sql << "select count(*) from phonebook", into(count);
-
-        cout << "We have " << count << " entries in the phonebook.\n";
-
-        string name;
-        while (getName(name))
-        {
-            string phone;
-            indicator ind;
-            sql << "select phone from phonebook where name = :name",
-                into(phone, ind), use(name);
-
-            if (ind == i_ok)
-            {
-                cout << "The phone number is " << phone << '\n';
-            }
-            else
-            {
-                cout << "There is no phone for " << name << '\n';
-            }
-        }
-    }
-    catch (exception const &e)
-    {
-        cerr << "Error: " << e.what() << '\n';
-    }
-}
-
- - - - - - - - - - - diff --git a/doc/installation.html b/doc/installation.html deleted file mode 100644 index 03052f52..00000000 --- a/doc/installation.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - SOCI - structure - - - - - -

Installation

- - - -

Downloading

- -

Download package with latest release of the SOCI source code: soci-X.Y.Z.tar.gz|tar.bz2|zip, where X.Y.Z is the version number. Unpack this file.

- -

If you intend to hack SOCI, you can clone the Git repository:

- -
git clone git://soci.git.sourceforge.net/gitroot/soci/soci 
- -

Compilation

- -

SOCI is configured to build using CMake system in version 2.6+.

- -

The build configuration allows to control various aspects of compilation and installation by setting common CMake variables that change behaviour, describe system or control build (see CMake help) as well as SOCI-specific variables described below. All these variables are available regardless of platform or compilation toolset used.

- -

Running CMake from the command line allows to set variables in the CMake cache with the following syntax: -DVARIABLE:TYPE=VALUE. If you are new to CMake, you may find Running CMake helpful.

- -

TODO: group CMake variables specific to SOCI by backends + add variables used to defined LIB and INCLUDE for backend deps.

- - - - - - - - - - - - - - - - - - - -
List of a few essential and common CMake variables
CMAKE_BUILD_TYPEstringSpecifies the build type for make based generators (see CMake help).
CMAKE_INSTALL_PREFIXpathInstall directory used by install command (see CMake help).
CMAKE_VERBOSE_MAKEFILEbooleanIf ON, create verbose makefile (see CMake help).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
List of variables used to control detection of SOCI external dependencies
WITH_BOOSTbooleanShould CMake try to detect Boost C++ Libraries. If ON, CMake will try to find Boost headers and binaries of Boost.Date_Time library.
WITH_MYSQLbooleanShould CMake try to detect mysqlclient libraries providing MySQL C API. Note, currently the mysql_config program is not being used.
WITH_ODBCbooleanShould CMake try to detect ODBC libraries. On Unix systems, CMake tries to find unixODBC or iODBC implementations.
WITH_ORACLEbooleanShould CMake try to detect Oracle Call Interface (OCI) libraries.
WITH_POSTGRESQLbooleanShould CMake try to detect PostgreSQL client interface libraries. SOCI relies on libpq C library.
WITH_SQLITE3booleanShould CMak try to detect SQLite C/C++ library. As bonus, the configuration tries OSGeo4W distribution if OSGEO4W_ROOT environment variable is set.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
List of variables used to control selection of SOCI backends. All these variables are automatically switched on if corresponding WITH_ variable explained above is set to ON.
SOCI_EMPTYbooleanBuilds the sample backend called Empty. Always ON by default.
SOCI_MYSQLbooleanRequests to build MySQL backend. Automatically switched on, if WITH_MYSQL is set to ON.
SOCI_ODBCbooleanRequests to build ODBC backend. Automatically switched on, if WITH_ODBC is set to ON.
SOCI_ORACLEbooleanRequests to build Oracle backend. Automatically switched on, if WITH_ORACLE is set to ON.
SOCI_POSTGRESQLbooleanRequests to build PostgreSQL backend. Automatically switched on, if WITH_POSTGRESQL is set to ON.
SOCI_SQLITE3booleanRequests to build SQLite3 backend. Automatically switched on, if WITH_SQLITE3 is set to ON.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
List of variables used to control SOCI tests
SOCI_TESTSbooleanShould CMake build unit tests for all enabled backends. If OFF, all the connection string variables below are ignored.
SOCI_EMPTY_TEST_CONNSTRstringConnection string passed to Empty backend test program (e.g. "dummy connection")
SOCI_MYSQL_TEST_CONNSTRstringConnection string to MySQL test database. Format of the string is explained MySQL Backend Refernece.
SOCI_ODBC_TEST_ACCESS_CONNSTR
SOCI_ODBC_TEST_MSSQL_CONNSTR
SOCI_ODBC_TEST_MYSQL_CONNSTR
SOCI_ODBC_TEST_POSTGRESQL_CONNSTR
stringODBC Data Source Name (DSN) or ODBC File Data Source Name (FILEDSN) to test database: Microsoft Access (.mdb), Microsoft SQL Server, MySQL, PostgreSQL or any other ODBC SQL data source. See ODBC Backend Refernece for details.
SOCI_ORACLE_TEST_CONNSTRstringConnection string to Oracle test database. Format of the string is explained Oracle Backend Refernece.
SOCI_POSTGRESQL_TEST_CONNSTRstringConnection string to PostgreSQL test database. Format of the string is explained PostgreSQL Backend Refernece.
SOCI_SQLITE3_TEST_CONNSTRstringConnection string is simply a file path where SQLite3 test database will be created (e.g. /home/john/soci_test.db). Check SQLite3 Backend Refernece for details.
- -

CMake configures SOCI build performing sequence of steps. Each subsequent step is dependant on result of previous steps corresponding with particular feature. First, CMake checks system platform and compilation toolset. Next, CMake tries to find all external dependencies. Then, depending on the results of the dependency check, CMake determines SOCI backends which are possible to build. The SOCI-specific variables described above provide users with basic control of this behaviour.

- -

On Unix

- -

Short version using GNU Make makefiles:

-
-$ mkdir build
-$ cd build
-$ cmake -G "Unix Makefiles" -DWITH_BOOST=OFF -DWITH_ORACLE=OFF (...) ../soci-X.Y.Z
-$ make
-$ make test
-$ make install
-
- -

On Windows

- -

Short version using Visual Studio

- -
-C:\>MKDIR build
-C:\>cd build
-C:\build>cmake -G "Visual Studio 10" -DWITH_BOOST=OFF -DWITH_ORACLE=OFF (...) ..\soci-X.Y.Z
-C:\buikd>devenv.exe SOCI.sln
-
- - - -

Using classic Makefiles on Unix

- -

The classic set of Makefiles for Unix/Linux systems is provided for those users who need complete control over the whole process -and who can benefit from the basic scaffolding that they can extend on their own. -In this sense, the basic Makefiles are supposed to provide a minimal starting point for custom experimentation and are not intended to be a complete build/installation solution.
-At the same time, they are complete in the sense that they can compile the library with all test programs and for some users this level of support will be just fine.

- -

The core directory of the library distribution contains -the Makefile.basic that can be used to compile the core part of -the library. Run make -f Makefile.basic or make -f Makefile.basic shared to get the static and shared versions, respectively. -Similarly, the backends/name directory contains the -backend part for each supported backend with the appropriate Makefile.basic -and the backends/name/test -directory contains the test program for the given backend.

- -

For example, the simplest way to compile the static version of the -library and the test program for PostgreSQL is:

- -
-$ cd src/core
-$ make -f Makefile.basic
-$ cd ../backends/postgresql
-$ make -f Makefile.basic
-$ cd test
-$ make -f Makefile.basic
-
- -
-

Note: -For each backend and its test program, the Makefile.basics -contain the variables that can have values specific to the given -environment - they usually name the include and library paths. -These variables are placed at the beginning of the Makefile.basics. -Please review their values in case of any compilation problems.

-
- -

The Makefiles for test programs can be a good starting point to find -out correct compiler and linker options.

- - - - - - - - - - - - diff --git a/doc/interfaces.html b/doc/interfaces.html deleted file mode 100644 index ea41b568..00000000 --- a/doc/interfaces.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - SOCI - integration with Boost - - - - - -

Interfaces

- -

One of the major features of SOCI, although not immediately visible, is the variety of interfaces (APIs) that are available for the user. These can be divided into sugar, core and simple.

- -

Sugar

- -

The most exposed and promoted interface supports the syntax sugar that makes SOCI similar in look and feel to embedded SQL. The example of application code using this interface is:

- -
-session sql("postgresql://dbname=mydb");
-
-int id = 123;
-string name;
-
-sql << "select name from persons where id = :id", into(name), use(id);
-
- -

Core

- -

The above example is equivalent to the following, more explicit sequence of calls:

-
-session sql("postgresql://dbname=mydb");
-
-int id = 123;
-string name;
-
-statement st(sql);
-st.exchange(into(name));
-st.exchange(use(id));
-st.alloc();
-st.prepare("select name from persons where id = :id");
-st.define_and_bind();
-st.execute(true);
-
- -

The value of the core interface is that it is the basis for all other interfaces, and can be also used by developers to easily prepare their own convenience interfaces. Users who cannot or for some reason do not want to use the natural sugar interface should try the core one as the foundation and access point to all SOCI functionality.

- -

Note that the sugar interface wraps only those parts of the core that are related to data binding and query streaming.

- -

Simple

- -

The simple interface is provided specifically to allow easy integration of the SOCI library with other languages that have the ability to link with binaries using the "C" calling convention. To facilitate this integration, the simple interface does not use any pointers to data except C-style strings and opaque handles, but the consequence of this is that user data is managed by SOCI and not by user code. To avoid exceptions passing the module boundaries, all errors are reported as state variables of relevant objects.

- -

The above examples can be rewritten as (without error-handling):

- -
-#include <soci-simple.h>
-
-// ...
-session_handle sql = soci_create_session("postgresql://dbname=mydb");
-
-statement_handle st = soci_create_statement(sql);
-
-soci_use_int(st, "id");
-soci_set_use_int(st, "id", 123);
-
-int namePosition = soci_into_string(st);
-
-soci_prepare(st, "select name from persons where id = :id");
-
-soci_execute(st, true);
-
-char const * name = soci_get_into_string(st, namePosition);
-
-printf("name is %s\n", name);
-
-soci_destroy_statement(st);
-soci_destroy_session(sql);
-
- -

The simple interface supports single and bulk data exchange for static binding. Dynamic row description is not supported in this release.

-

See Simple client interface reference documentation for more details.

- -

Low-level backend interface

- -

The low-level backend interface allows to interact with backends directly and in principle allows to access the database without involving any other component. There is no particular reason to use this interface in the user code.

- - - - - - - - - - - diff --git a/doc/multithreading.html b/doc/multithreading.html deleted file mode 100644 index a22a742e..00000000 --- a/doc/multithreading.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - SOCI - multithreading - - - - - -

Multithreading

- -

The general rule for multithreading is that SOCI classes are not thread-safe, meaning that their instances should not be used concurrently by multiple threads.

- -

The simplest solution for multithreaded code is to set up a separate session object for each thread that needs to inteact with the database. Depending on the design of the client application this might be also the most straightforward approach.

- -

For some applications, however, it might be preferable to decouple the set of threads from the set of sessions, so that they can be optimized separately with different resources in mind. The connection_pool class is provided for this purpose:

- -
-// phase 1: preparation
-
-const size_t poolSize = 10;
-connection_pool pool(poolSize);
-
-for (size_t i = 0; i != poolSize; ++i)
-{
-    session & sql = pool.at(i);
-
-    sql.open("postgresql://dbname=mydb");
-}
-
-// phase 2: usage from working threads
-
-{
-    session sql(pool);
-
-    sql << "select something from somewhere...";
-
-} // session is returned to the pool automatically
-
- -

The connection_pool's constructor expects the size of the pool and internally creates an array of sessions in the disconnected state. Later, the at function provides non-synchronized access to each element of the array. Note that this function is not thread-safe and exists only to make it easier to set up the pool in the initialization phase.

- -

Note that it is not obligatory to use the same connection parameters for all sessions in the pool, although this will be most likely the usual case.

- -

The working threads that need to lease a single session from the pool use the dedicated constructor of the session class - this constructor blocks until some session object becomes available in the pool and attaches to it, so that all further uses will be forwarded to the session object managed by the pool. As long as the local session object exists, the associated session in the pool is locked and no other thread will gain access to it. When the local session variable goes out of scope, the related entry in the pool's internal array is released, so that it can be used by other threads. This way, the connection pool guarantees that its session objects are never used by more than one thread at a time.

- -

Note that the above scheme is the simplest way to use the connection pool, but it is also constraining in the fact that the session's constructor can block waiting for the availability of some entry in the pool. For more demanding users there are also low-level functions that allow to lease sessions from the pool with timeout on wait. Please consult the reference for details.

- - - - - - - - - - - diff --git a/doc/rationale.html b/doc/rationale.html deleted file mode 100644 index deb5faab..00000000 --- a/doc/rationale.html +++ /dev/null @@ -1,313 +0,0 @@ - - - - - - SOCI - rationale - - - - - -

Rationale FAQ

- -

This part of the documentation is supposed to gather in a single place -the usual questions (and answers) about SOCI with regard to the design -decisions that have shaped it.

- -

Q: Why "SOCI"?

- -

SOCI was initially developed in the environment where Oracle was the -main database technology in use. As a wrapper for the native OCI API -(Oracle Call Interface), the name "Simple Oracle Call Interface" was -quite obvious - until the 2.0 release, when the internal architecture -was largely redesigned to allow the use of backends that support other -database servers. We have kept the same name to indicate that Oracle is -the main supported technology in the sense -that the library includes only those features that were naturally -implemented in -Oracle. With the 2.1 release of the library, two new backends were -added (MySQL and SQLite3) and we decided to drop the original full name -so that new users looking for a library supporting any of these simpler -libraries are not discouraged by seeing "Oracle" somewhere in the name. -The other possible interpretation was "Syntax Oriented Call Interface", -which stresses the fact that SOCI was built to support the most natural -and easy interface for the user that is similar to the Embedded SQL -concept (see below). But on the other hand, SOCI also provides other -features (like object-relational mapping) and as a whole it is not just -"emulator" of the Embedded SQL. With all these considerations in mind, -SOCI is just "SOCI - The C++ Database Access Library".

- -

Still, Oracle is considered to be the main driving server technology in -terms of the set of features that are supported by the library. This -also means that backends for other servers might need to -work around some of the imposed idioms and protocols, but already -available and well-working PostgreSQL, MySQL and SQLite3 backends show -that it's actually not that -bad and the abstractions provided by the library are actually very -universal. Of -course, some of the features that were provided for Oracle might not be -supported for all other servers, but we think that it's better to have -one leading technology (where at least one group is fully happy) -instead of some "common denominator" for all databases (where nobody is happy).

- -

Q: Where the basic SOCI syntax comes from?

- -

The basic SOCI syntax was inspired by the Embedded SQL, which is part -of the SQL standard, supported by the major DB technologies and even -available as built-in part of the languages used in some DB-oriented -integrated -development environments. The term "Embedded SQL" is enough for Google -to spit millions of references - one of the typical examples is:

- -
-{
-    int a;
-    /* ... */
-    EXEC SQL SELECT salary INTO :a
-             FROM Employee
-             WHERE SSN=876543210;
-    /* ... */
-    printf("The salary is %d\n", a);
-    /* ... */
-}
-
- -

The above is not a regular C (nor C++) code, of course. It's the mix of -C and SQL and there is a separate, specialized preprocessor needed to -convert it to something that the actual C (or C++) compiler will be -able to understand. This means that the compilation of the program -using embedded SQL is two-phase: preprocess the embedded SQL part and -compile the result. This two-phase development is quite troublesome, -especially when it comes to debugging. Yet, the advantage of it is that -the code expresses the programmer's intents in a very straightforward -way: read something from the database and put it into the local -variable. Just like that.

- -

The SOCI library was born as an anwer to the following question: is it -possible to have the same expressive power without the disadvantages of -two-phase builds?

- -

The following was chosen to be the basic SOCI syntax that can mirror -the above Embedded SQL example:

- -
-int a;
-sql << "SELECT salary FROM Employee WHERE SSN=876543210", into(a);
-
- -

(as you see, SOCI changes the order of elements a little bit, so that -the SQL query is separate and not mixed with other elements)

- -

Apart from mimicking the Embedded SQL techniques in the regular, fully -standard C++ code, the above syntax has the following benefit: it is -minimal with respect to what has to -be said. Every single piece above is needed and expresses something -important, like:

-
    -
  • which session should be used (the client can be connected to many -databases at the same time) - here, the sql object -encapsulates the session,
  • -
  • what SQL query should be executed - here, it's the string -literal, but it could be also a std::string variable,
  • -
  • where to put the result - here, the local variable a -will receive the result.
  • -
- -

Everything else is just a couple of operators that allow to treat the -whole as a single expression. It's rather difficult to remove anything -from this example.

- -

The fact that the basic SOCI syntax is minimal (but without being -obscure at the same time, see below) means that the programmer does not -need to bother with unnecessary noise that some other database -libraries impose. We hope that after having written one line of code -like above by themselves, most programmers will react with something -like "how obvious!" instead of "how advanced!".

- -

Q: Why should I use SQL queries as strings in my program? I prefer the query to be generated or composed piece-by-piece by separate functions.

- -

First, you don't need to use SQL queries as string literals. In bigger -projects it is a common practice to store SQL queries externally (in a -file, or in a... database) and load them before use. This means that -they are not necessarily expected to appear in the program code, as -they do in our simple code examples and the advantage of separating -them from the source code of the main program is, among others, the -possibility to optimize and tune the SQL queries without recompilation -and relinking of the whole program.

- -

What is the most important, though, is that SOCI does not try to mess -with the -text of the query (apart from very few cases), which means that the -database server will get exactly the same text of the query as is used -in the program. The advantage of this is that there is no new SQL-like -(or even SQL-unlike) -syntax that you would need to learn, and also that it's much easier to -convince a typical -DBA to help with SQL tuning or other specialized activities, if he is -given the material in the form that is not polluted with any foreign -abstractions.

- -

Q: Why not some stream-like interface, which is well-known to all C++ programmers?

- -

An example of the stream-like interface might be something like this -(this is imaginary syntax, not supported by SOCI):

- -
-sql.exec("select a, b, c from some_table");
-
-while (!sql.eof())
-{
-    int a, b, c;
-    sql >> a >> b >> c;
-    // ...
-}
-
- -

We think that the data stored in the relational database should be -treated as a set of relations - which is exactly what it is. This means -that what is read from the database as a result of some SQL query is a -set of rows. This set might be -ordered, but it is still a set of rows, not a uniformly flat list of values. -This distinction might seem to be unnecessarily low-level and that the -uniform stream-like presentation of data is more preferable, but it's -actually the other way round - the set of rows is something more -structured - and that structure was designed -into the database - than the flat stream and -is therefore less prone to programming errors like miscounting the -number of values that is expected in each row.

- -

Consider the following programming error:

- -
-sql.exec("select a, b from some_table"); // only TWO columns
-
-while (!sql.eof())
-{
-    int a, b, c;
-    sql >> a >> b >> c; // this causes "row-tearing"
-    // ...
-}
-
- -

"How to detect the end of each line in a file" is a common beginner's question that -relates to the use of IOStreams - and this -common question clearly shows that for the record-oriented data the -stream is not an optimal abstraction. Of course, we don't claim that -IOStreams is bad - but we do insist that the record-oriented data is -better manipulated in a way that is also record-aware.

- -

Having said that, we have provided some form of the stream-like -interface, but with the important limitation that the stream is always bound to the -single row, so that the row-tearing effect is not possible. In other words, -data returned from the database is still structured into rows, but each row can be -separately traversed like a stream. We hope that it provides a good balance between -convenience and code safety.

- -

Q: Why use indicators instead of some special value to discover that something is null?

- -

Some programmers are used to indicating the null value by using some -special (which means: "unlikely" to be ever used) value - for example, -to use the smallest integer value to indicate null integer. Or to use -empty string to indicate null string. And so on.

- -

We think that it's completely wrong. Null (in the database sense) is an -information about the data. It describes the state of the data and if it's null, -then there's no data at all. -Nothing. Null. It does not make any sense to talk about some special -value if in fact there is no -value at all - especially if we take into account that, for example, the -smallest integer value (or whatever else you choose as the "special" -value) might not be that -special in the given application or domain.

- -

Thus, SOCI uses a separate indicators to describe the state of -exchanged data. It also has an additional benefit of allowing the -library to convey more than two states (null and not null). Indeed, the -SOCI library uses indicators also to report that the data was read, but -truncated (this applies to strings when reading to fixed-length -character arrays). Truncation is also an information about the data and -as such it's better to have it in addition to the data, not as part of -it.

- -

Having said that, it is important to point at the Integration with Boost -that allows to use boost::optional<T> to conveniently pack together -the data and the information about its state.

- -

Q: Overloaded comma operator is just obfuscation, I don't like it.

- -

Well, consider the following:

- -

"Send the query X to the server Y and put result into variable Z."

- -

Above, the "and" plays a role of the comma. Even if overloading the -comma operator is not a very popular practice in C++, some libraries do -this, achieving terse and easy to learn syntax. We are pretty sure that -in SOCI the comma operator was overloaded with a good effect.

- -

Q: The operator<< provides a bad abstraction for the "input" statements.

- -

Indeed, the operator<< in the basic SOCI syntax -shows that something (the query) is sent somewhere (to the server). -Some people don't like this, especially when the "select" statements -are involved. If the high-level idea is to read - data from somewhere, then operator<< -seems unintuitive to the die-hard IOStreams users. The fact is, -however, that the code containing SQL statement already indicates -that there is a client-server relationship with some other software -component (very likely remote). In such code it does not make any sense -to pretend that the communication is one-way only, because it's clear -that even the "select" statements need to be sent somewhere. This approach is -also more uniform and allows to cover other statements like "drop -table" or alike, where no data is expected to be exchanged at all (and -therefore the IOStreams analogies for data exchange have no sense at -all). No matter what is the kind of the SQL statement, it is sent - to the server and this -"sending" justifies the choice of operator<<.

- -

Using different operators (operator>> and operator<<) -as a way of distinguishing between different high-level ideas -(reading and writing from the data store, -respectively) does make sense on much higher level of abstraction, -where the SQL statement itself is already hidden - and we do encourage -programmers to use SOCI for implementing such high-level abstractions. -For this, the object-relational mapping facilities available in SOCI -might prove to be a valuable tool as well, as an effective bridge -between the low-level world of SQL statements and the high-level world -of user-defined abstract data types.

- -

Q: Why the Boost license?

- -

We decided to use the Boost license, because -it's well recognized in the C++ community, allows us to keep our -minimum copyrights, and at the same time allows SOCI to be safely used -in commercial projects, without imposing concerns (or just plain -uncertainty) typical to other open source licenses, like GPL. We also -hope that by choosing the Boost license we have made the life easier -for both us and our users. It saves us from answering law-related -questions that were already answered on the Boost license info -page and it should also give more confidence to our users - -especially to those of them, who already accepted the conditions of the -Boost license - the just have one license less to analyze.

- -

Still, if for any reason the conditions of this license are not -acceptable, we encourage the users to contact us directly (see links -on the relevant SOCI page) to discuss any remaining concerns.

- - - - - - - - - - - diff --git a/doc/reference.html b/doc/reference.html deleted file mode 100644 index bebe227c..00000000 --- a/doc/reference.html +++ /dev/null @@ -1,906 +0,0 @@ - - - - - - SOCI - reference - - - - - -

Client interface reference

- - - -

The core client interface is a set of classes and free functions declared in -the soci.h header file. All names are dbeclared in the soci -namespace.

- -

There are also additional names declared in the soci::details -namespace, but they are not supposed to be directly used by the users -of the library and are therefore not documented here. When such types -are used in the declarations that are part of the "public" interface, -they are replaced by "IT", which means "internal type". Types related -to the backend interface are named here, but documented on the next page.

- -

commonly used types

- -

The following types are commonly used in the rest of the interface:

- -
-// data types, as seen by the user
-enum data_type { dt_string, dt_date, dt_double, dt_integer,
-                 dt_unsigned_long, dt_long_long };
-
-// the enum type for indicator variables
-enum indicator { i_ok, i_null, i_truncated };
-
-// the type used for reporting exceptions
-class soci_error : public std::runtime_error { /* ... */ };
-
- -

The data_type type defines the basic SOCI data types. -User provided data types need to be associated with one of these basic -types.

- -

The indicator type defines the possible states of data.

- -

The soci_error type is used for error reporting.

- -

class session

- -

The session class encapsulates the connection to the -database.

- -
-class session
-{
-public:
-    session();
-    session(backend_factory const & factory, std::string const & connectString);
-    session(std::string const & backendName, std::string const & connectString);
-    explicit session(std::string const & connectString);
-    explicit session(connection_pool & pool);
-
-    ~session();
-
-    void open(backend_factory const & factory, std::string const & connectString);
-    void open(std::string const & backendName, std::string const & connectString);
-    void open(std::string const & connectString);
-    void close();
-    void reconnect();
-
-    void begin();
-    void commit();
-    void rollback();
-
-    IT once;
-    IT prepare;
-
-    template <typename T> IT operator<<(T const & t);
-
-    bool got_data() const;
-
-    std::ostringstream & get_query_stream();
-
-    void set_log_stream(std::ostream * s);
-    std::ostream * get_log_stream() const;
-
-    std::string get_last_query() const;
-
-    void uppercase_column_names(bool forceToUpper);
-
-    details::session_backend * get_backend();
-
-    std::string get_backend_name() const;
-};
-
- -

This class contains the following members:

-
    -
  • Various constructors. The default one creates the session in the disconnected state. - The others expect the backend factory object, or the backend name, or the URL-like - composed connection string. The last constructor creates a session proxy associated - with the session that is available in the given pool and releases it back to the pool - when its lifetime ends. Example: -
    -session sql(postgresql, "dbname=mydb");
    -session sql("postgresql", "dbname=mydb");
    -session sql("postgresql://dbname=mydb");
    -
    - The constructors that take backend name as string load the shared library (if not yet loaded) - with name computed as libsoci_ABC.so (or libsoci_ABC.dll on Windows) - where ABC is the given backend name. -
  • -
  • open, close and reconnect functions for - reusing the same session object many times; the reconnect function attempts - to establish the connection with the same parameters as most recently used with constructor - or open. The arguments for open are treated in the same way as - for constructors. -
  • -
  • begin, commit and rollback -functions for transaction control. -
  • -
  • once member, which is used for performing instant -queries that do not need to be separately prepared. Example: -
    -sql.once << "drop table persons";
    -
    -
  • -
  • prepare member, which is used for statement -preparation - the result of the statement preparation must be provided -to the constructor of the statement class. Example: -
    -int i;
    -statement st = (sql.prepare <<
    -                "insert into numbers(value) values(:val)", use(i));
    -
    -
  • -
  • operator<< that is a shortcut forwarder to the -equivalent operator of the once member. Example: -
    -sql << "drop table persons";
    -
    -
  • -
  • got_data returns true if the last executed query had non-empty result.
  • -
  • get_query_stream provides direct access to the stream object that is used - to accumulate the query text and exists in particular to allow the user to imbue specific locale - to this stream.
  • -
  • set_log_stream and get_log_stream functions for setting and getting - the current stream object used for basic query logging. By default, it is NULL, which means no logging. - The string value that is actually logged into the stream is one-line verbatim copy of the query string provided by the user, - without including any data from the use elements. The query is logged exactly once, before the preparation step.
  • -
  • get_last_query retrieves the text of the last used query.
  • -
  • uppercase_column_names allows to force all column names to uppercase in dynamic row description; - this function is particularly useful for portability, since various database servers - report column names differently (some preserve case, some change it).
  • -
  • get_backend returns the internal -pointer to the concrete backend implementation of the session. This is -provided for advanced users that need access to the functionality that -is not otherwise available.
  • -
  • get_backend_name is a convenience forwarder to the same function -of the backend object.
  • -
- -

See Connections and simple queries for more -examples.

- -

class connection_pool

- -

The connection_pool class encapsulates the thread-safe pool of connections -and ensures that only one thread at a time has access to any connection that it manages.

- -
-class connection_pool
-{
-public:
-    explicit connection_pool(std::size_t size);
-    ~connection_pool();
-
-    session & at(std::size_t pos);
-
-    std::size_t lease();
-    bool try_lease(std::size_t & pos, int timeout);
-    void give_back(std::size_t pos);
-};
-
- -

The operations of the pool are:

- -
    -
  • Constructor that takes the intended size of the pool. After construction, - the pool contains regular session objects in disconnected state.
  • -
  • at function that provides direct access to any given entry - in the pool. This function is non-synchronized.
  • -
  • lease function waits until some entry is available (which means - that it is not used) and returns the position of that entry in the pool, marking - it as locked.
  • -
  • try_lease acts like lease, but allows to set up a - time-out (relative, in milliseconds) on waiting. Negative time-out value means no time-out. - Returns true if the entry was obtained, in which case its position - is written to the pos parametr, and false if no entry - was available before the time-out.
  • -
  • give_back should be called when the entry on the given position - is no longer in use and can be passed to other requesting thread.
  • -
-

Note: calls to lease and give_back are automated by the -dedicated constructor of the session class, see above.

- -

class transaction

- -

The class transaction can be used for associating the transaction -with some code scope. It is a RAII wrapper for regular transaction operations that -automatically rolls back in its destructor if the transaction was not explicitly -committed before.

-
-class transaction
-{
-public:
-    explicit transaction(session & sql);
-
-    ~transaction();
-
-    void commit();
-    void rollback();
-
-private:
-    // ...
-};
-
- -

Note that objects of this class are not notified of other transaction related operations -that might be executed by user code explicitly or hidden inside SQL queries. -It is not recommended to mix different ways of managing transactions.

- -

function into

- -

The function into is used for binding local output data -(in other words, it defines where the results of the query are stored).

- -
-template <typename T>
-IT into(T & t);
-
-template <typename T, typename T1>
-IT into(T & t, T1 p1);
-
-template <typename T>
-IT into(T & t, indicator & ind);
-
-template <typename T, typename T1>
-IT into(T & t, indicator & ind, T1 p1);
-
-template <typename T>
-IT into(T & t, std::vector<indicator> & ind);
-
- -

Example:

- -
-int count;
-sql << "select count(*) from person", into(count);
-
- -

See Binding local data -for more examples.

- -

function use

- -

The function use is used for binding local input data (in -other words, it defines where the parameters of the query come from).

- -
-template <typename T>
-IT use(T & t);
-
-template <typename T, typename T1>
-IT use(T & t, T1 p1);
-
-template <typename T>
-IT use(T & t, indicator & ind);
-
-template <typename T, typename T1>
-IT use(T & t, indicator & ind, T1 p1);
-
-template <typename T>
-IT use(T & t, std::vector<indicator> const & ind);
-
-template <typename T, typename T1>
-IT use(T & t, std::vector<indicator> const & ind, T1 p1);
-
- -

Example:

- -
-int val = 7;
-sql << "insert into numbers(val) values(:val)", use(val);
-
- -

See Binding local data -for more examples.

- -

class statement

- -

The statement class encapsulates the prepared statement.

- -
-class statement
-{
-public:
-    statement(session & s);
-    statement(IT const & prep);
-    ~statement();
-
-    statement(statement const & other);
-    void operator=(statement const & other);
-
-    void alloc();
-    void bind(values & v);
-    void exchange(IT const & i);
-    void exchange(IT const & u);
-    void clean_up();
-
-    void prepare(std::string const & query);
-    void define_and_bind();
-
-    bool execute(bool withDataExchange = false);
-    bool fetch();
-
-    bool got_data() const;
-
-    void describe();
-    void set_row(row * r);
-    void exchange_for_rowset(IT const & i);
-
-    details::statement_backend * get_backend();
-};
-
- -

This class contains the following members:

-
    -
  • Constructor accepting the session object. This can -be used for later query preparation. Example: -
    -statement stmt(sql);
    -
    -
  • -
  • Constructor accepting the result of using prepare -on the session object, see example provided above for the - session class.
  • -
  • Copy operations.
  • -
  • alloc function, which allocates necessary internal resources.
  • -
  • bind function, which is used to bind the values -object - this is used in the object-relational mapping and normally -called automatically.
  • -
  • exchange functions for registering the binding of local data - -they expect the result of calling the into or use -functions and are normally invoked automatically.
  • -
  • clean_up function for cleaning up resources, normally -called automatically.
  • -
  • prepare function for preparing the statement for -repeated execution.
  • -
  • define_and_bind function for actually executing the -registered bindings, normally called automatically.
  • -
  • execute function for executing the statement. If its -parameter is false then there is no data exchange with -locally bound variables (this form should be used if later fetch -of multiple rows is foreseen). Returns true if there was at least -one row of data returned.
  • -
  • fetch function for retrieving the next portion of -the result. Returns true if there was new data.
  • -
  • got_data return true if the most recent -execution returned any rows.
  • -
  • describe function for extracting the type -information for the result (note: no data is exchanged). This is normally -called automatically and only when dynamic resultset binding is used.
  • -
  • set_row function for associating the statement -and row objects, normally called automatically.
  • -
  • exchange_for_rowset as a special case for binding rowset -objects.
  • -
  • get_backend function that returns the internal -pointer to -the concrete backend implementation of the statement object. This is -provided -for advanced users that need access to the functionality that is not -otherwise available.
  • -
- -

See Statement preparation and -repeated execution for example uses.

- -

Most of the functions from the statement class -interface are called automatically, but can be also used explicitly. -See Interfaces for the description of various way to use -this interface.

- -

class procedure

- -

The procedure class encapsulates the call to the stored -procedure and is aimed for higher portability of the client code.

- -
-class procedure
-{
-public:
-    procedure(IT const & prep);
-
-    bool execute(bool withDataExchange = false);
-    bool fetch();
-    bool got_data() const;
-};
-
- -

The constructor expects the result of using prepare -on the session object.

- -

See Stored procedures for -examples.

- -

class type_conversion

- -

The type_conversion class is a traits class that is -supposed to be provided (specialized) by the user for defining -conversions to and from one of the basic SOCI types.

- -
-template <typename T>
-struct type_conversion
-{
-    typedef T base_type;
-
-    static void from_base(base_type const & in, indicator ind, T & out);
-
-    static void to_base(T const & in, base_type & out, indicator & ind);
-};
-
- -

Users are supposed to properly implement the from_base and to_base -functions in their specializations of this template class.

- -

See Extending -SOCI to support custom (user-defined) C++ types.

- -

class row

- -

The row class encapsulates the data and type information -retrieved for the single row when the dynamic rowset binding is used.

- -
-class row
-{
-public:
-    row();
-    ~row();
-
-    void uppercase_column_names(bool forceToUpper);
-
-    std::size_t size() const;
-
-    indicator get_indicator(std::size_t pos) const;
-    indicator get_indicator(std::string const & name) const;
-
-    column_properties const & get_properties (std::size_t pos) const;
-    column_properties const & get_properties (std::string const & name) const;
-
-    template <typename T>
-    T get(std::size_t pos) const;
-
-    template <typename T>
-    T get(std::size_t pos, T const & nullValue) const;
-
-    template <typename T>
-    T get(std::string const & name) const;
-
-    template <typename T>
-    T get(std::string const & name, T const & nullValue) const;
-
-    template <typename T>
-    row const & operator>>(T & value) const;
-
-    void skip(std::size_t num = 1) const;
-
-    void reset_get_counter() const
-};
-
- -

This class contains the following members:

-
    -
  • Default constructor that allows to declare a row -variable.
  • -
  • uppercase_column_names - see the same function in the session class.
  • -
  • size function that returns the number of columns in -the row.
  • -
  • get_indicator function that returns the indicator value -for the given column (column is specified by position - starting from 0 -- or by name).
  • -
  • get_properties function that returns the properties -of the column given by position (starting from 0) or by name.
  • -
  • get functions that return the value of the column -given by position or name. If the column contains null, then these -functions either return the provided "default" nullValue -or throw an exception.
  • -
  • operator>> for convenience stream-like -extraction interface. Subsequent calls to this function are equivalent -to calling get with increasing position parameter, -starting from the beginning.
  • -
  • skip and reset_get_counter allow to change the -order of data extraction for the above operator.
  • -
- -

See Dynamic resultset binding for -examples.

- -

class column_properties

- -

The column_properties class provides the type and name -information about the particular column in a rowset.

- -
-class column_properties
-{
-public:
-    std::string get_name() const;
-    data_type get_data_type() const;
-};
-
- -

This class contains the following members:

-
    -
  • get_name function that returns the name of the column.
  • -
  • get_data_type that returns the type of the column.
  • -
- -

See Dynamic resultset binding for -examples.

- -

class values

- -

The values class encapsulates the data and type -information and is used for object-relational mapping.

- -
-class values
-{
-public:
-    values();
-
-    void uppercase_column_names(bool forceToUpper);
-
-    indicator get_indicator(std::size_t pos) const;
-    indicator get_indicator(std::string const & name) const;
-
-    template <typename T>
-    T get(std::size_t pos) const;
-
-    template <typename T>
-    T get(std::size_t pos, T const & nullValue) const;
-
-    template <typename T>
-    T get(std::string const & name) const;
-    
-    template <typename T>
-    T get(std::string const & name, T const & nullValue) const;
-
-    template <typename T>
-    values const & operator>>(T & value) const;
-
-    void skip(std::size_t num = 1) const;
-    void reset_get_counter() const;
-    
-    template <typename T>
-    void set(std::string const & name, T const & value, indicator indic = i_ok);
-
-    template <typename T>
-    void set(const T & value, indicator indic = i_ok);
-
-    template <typename T>
-    values & operator<<(T const & value);
-};
-
- -

This class contains the same members as the row class (with the same meaning) -plus:

-
    -
  • set function for storing values in named columns or in subsequent positions.
  • -
  • operator<< for convenience.
  • -
- -

See Object-relational mapping -for examples.

- -

class blob

- -

The blob class encapsulates the "large object" -functionality.

- -
-class blob
-{
-public:
-    explicit blob(session & s);
-    ~blob();
-
-    std::size_t getLen();
-    std::size_t read(std::size_t offset, char * buf, std::size_t toRead);
-    std::size_t write(std::size_t offset, char const * buf, std::size_t toWrite);
-    std::size_t append(char const * buf, std::size_t toWrite);
-    void trim(std::size_t newLen);
-
-    details::blob_backend * get_backend();
-};
-
- -

This class contains the following members:

-
    -
  • Constructor associating the blob object with the session object.
  • -
  • get_len function that returns the size of the BLOB -object.
  • -
  • read function that reads the BLOB data into provided -buffer.
  • -
  • write function that writes the BLOB data from -provided buffer.
  • -
  • append function that appends to the existing BLOB -data.
  • -
  • trim function that truncates the existing data to -the new length.
  • -
  • get_backend function that returns the internal -pointer to -the concrete backend implementation of the BLOB object. This is -provided -for advanced users that need access to the functionality that is not -otherwise available.
  • -
- -

See Large objects (BLOBs) for more -discussion.

- -

class rowid

- -

The rowid class encapsulates the "row identifier" object.

- -
-class rowid
-{
-public:
-    explicit rowid(Session & s);
-    ~rowid();
-
-    details::rowid_backend * get_backend();
-};
-
- -

This class contains the following members:

-
    -
  • Constructor associating the rowid object with the session -object.
  • -
  • get_backend function that returns the internal -pointer to -the concrete backend implementation of the rowid object.
  • -
- -

class backend_factory

- -

The backend_factory class provides the abstract interface -for concrete backend factories.

- -
-struct backend_factory
-{
-    virtual details::session_backend * make_session(
-        std::string const & connectString) const = 0;
-};
-
- -

The only member of this class is the make_session function -that is supposed to create concrete backend implementation of the -session object.

- -

Objects of this type are declared by each backend and should be -provided to the constructor of the session class. -In simple programs users do not need to use this class directly, but -the example use is:

- -
-backend_factory & factory = postgresql;
-std::string connectionParameters = "dbname=mydb";
-
-session sql(factory, parameters);
-
- -

Simple client interface

- -

The simple client interface is provided with other languages in mind, -to allow easy integration of the SOCI library with script interpreters and those -languages that have the ability to link directly with object files using -the "C" calling convention.

-

The functionality of this interface is limited and in particular the -dynamic rowset description and type conversions are not supported in this release. -On the other hand, the important feature of this interface is that it does not -require passing pointers to data managed by the user, because all data is handled -at the SOCI side. This should make it easier to integrate SOCI with languages that -have constrained ability to understand the C type system.

-

Users of this interface need to explicitly #include <soci-simple.h>.

- -
-typedef void * session_handle;
-session_handle soci_create_session(char const * connectionString);
-void soci_destroy_session(session_handle s);
-
-void soci_begin(session_handle s);
-void soci_commit(session_handle s);
-void soci_rollback(session_handle s);
-
-int soci_session_state(session_handle s);
-char const * soci_session_error_message(session_handle s);
-
- -

The functions above provide the session abstraction with the help of opaque handle. -The soci_session_state function returns 1 if there was no error -during the most recently executed function and 0 otherwise, in which -case the soci_session_error_message can be used to obtain a human-readable -error description.

-

Note that the only function that cannot report all errors this way is soci_create_session, -which returns NULL if it was not possible to create an internal object -representing the session. However, if the proxy object was created, but the connection -could not be established for whatever reason, the error message can be obtained in -the regular way.

- -
-typedef void * statement_handle;
-statement_handle soci_create_statement(session_handle s);
-void soci_destroy_statement(statement_handle st);
-
-int soci_statement_state(statement_handle s);
-char const * soci_statement_error_message(statement_handle s);
-
- -

The functions above create and destroy the statement object. If the statement cannot -be created by the soci_create_statement function, the error condition is set up in the related session object; -for all other functions the error condition is set in the statement object itself.

- -
-int soci_into_string   (statement_handle st);
-int soci_into_int      (statement_handle st);
-int soci_into_long_long(statement_handle st);
-int soci_into_double   (statement_handle st);
-int soci_into_date     (statement_handle st);
-
-int soci_into_string_v   (statement_handle st);
-int soci_into_int_v      (statement_handle st);
-int soci_into_long_long_v(statement_handle st);
-int soci_into_double_v   (statement_handle st);
-int soci_into_date_v     (statement_handle st);
-
- -

These functions create new data items for storing query results (into elements). -These elements can be later identified by their position, which is counted from 0. For convenience, -these function return the position of the currently added element. In case of error, --1 is returned and the error condition is set in the statement object.

-

The _v versions create a vector into elements, which can be used -to retrieve whole arrays of results.

- -
-int soci_get_into_state(statement_handle st, int position);
-int soci_get_into_state_v(statement_handle st, int position, int index);
-
- -

This function returns 1 if the into element at the given position has non-null value and 0 otherwise. -The _v version works with vector elements and expects an array index.

- -
-int  soci_into_get_size_v(statement_handle st);
-void soci_into_resize_v  (statement_handle st, int new_size);
-
- -

The functions above allow to get and set the size of vector into element.

- -

Note: the soci_into_resize_v always sets all into vectors in the given statement -to the same size, which guarantees that all vector into elements have equal size.

- -
-char const * soci_get_into_string   (statement_handle st, int position);
-int          soci_get_into_int      (statement_handle st, int position);
-long long    soci_get_into_long_long(statement_handle st, int position);
-double       soci_get_into_double   (statement_handle st, int position);
-char const * soci_get_into_date     (statement_handle st, int position);
-
-char const * soci_get_into_string_v   (statement_handle st, int position, int index);
-int          soci_get_into_int_v      (statement_handle st, int position, int index);
-long long    soci_get_into_long_long_v(statement_handle st, int position, int index);
-double       soci_get_into_double_v   (statement_handle st, int position, int index);
-char const * soci_get_into_date_v     (statement_handle st, int position, int index);
-
- -

The functions above allow to retrieve the current value of the given into element.

- -

Note: the date function returns the date value in the "YYYY MM DD HH mm ss" string format.

- -
-void soci_use_string   (statement_handle st, char const * name);
-void soci_use_int      (statement_handle st, char const * name);
-void soci_use_long_long(statement_handle st, char const * name);
-void soci_use_double   (statement_handle st, char const * name);
-void soci_use_date     (statement_handle st, char const * name);
-
-void soci_use_string_v   (statement_handle st, char const * name);
-void soci_use_int_v      (statement_handle st, char const * name);
-void soci_use_long_long_v(statement_handle st, char const * name);
-void soci_use_double_v   (statement_handle st, char const * name);
-void soci_use_date_v     (statement_handle st, char const * name);
-
- -

The functions above allow to create new data elements that will be used to provide -data to the query (use elements). The new elements can be later identified by given name, which -must be unique for the given statement.

- -
-void soci_set_use_state(statement_handle st, char const * name, int state);
-
- -

The soci_set_use_state function allows to set the state of the given use element. -If the state parameter is set to non-zero the use element is considered non-null -(which is also the default state after creating the use element).

- -
-int  soci_use_get_size_v(statement_handle st);
-void soci_use_resize_v  (statement_handle st, int new_size);
-
- -

These functions get and set the size of vector use elements (see comments for vector into elements above).

- -
-void soci_set_use_string   (statement_handle st, char const * name, char const * val);
-void soci_set_use_int      (statement_handle st, char const * name, int val);
-void soci_set_use_long_long(statement_handle st, char const * name, long long val);
-void soci_set_use_double   (statement_handle st, char const * name, double val);
-void soci_set_use_date     (statement_handle st, char const * name, char const * val);
-
-void soci_set_use_state_v    (statement_handle st, char const * name, int index, int state);
-void soci_set_use_string_v   (statement_handle st, char const * name, int index, char const * val);
-void soci_set_use_int_v      (statement_handle st, char const * name, int index, int val);
-void soci_set_use_long_long_v(statement_handle st, char const * name, int index, long long val);
-void soci_set_use_double_v   (statement_handle st, char const * name, int index, double val);
-void soci_set_use_date_v     (statement_handle st, char const * name, int index, char const * val);
-
- -

The functions above set the value of the given use element, for both single and vector elements.

- -

Note: the expected format for the data values is "YYYY MM DD HH mm ss".

- -
-int          soci_get_use_state    (statement_handle st, char const * name);
-char const * soci_get_use_string   (statement_handle st, char const * name);
-int          soci_get_use_int      (statement_handle st, char const * name);
-long long    soci_get_use_long_long(statement_handle st, char const * name);
-double       soci_get_use_double   (statement_handle st, char const * name);
-char const * soci_get_use_date     (statement_handle st, char const * name);
-
- -

These functions allow to inspect the state and value of named use elements.

-

Note: these functions are provide only for single use elements, not for vectors; -the rationale for this is that modifiable use elements are not supported for bulk operations.

- -
-void soci_prepare(statement_handle st, char const * query);
-int  soci_execute(statement_handle st, int withDataExchange);
-int  soci_fetch(statement_handle st);
-int  soci_got_data(statement_handle st);
-
- -

The functions above provide the core execution functionality for the statement object -and their meaning is equivalent to the respective functions in the core C++ interface -described above.

- - - - - - - - - - - diff --git a/doc/statements.html b/doc/statements.html deleted file mode 100644 index 79456b49..00000000 --- a/doc/statements.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - SOCI - statements, procedures and transactions - - - - - -

Statements, procedures and transactions

- - - -

Statement preparation and repeated execution

- -

Consider the following examples:

- -
-// Example 1.
-for (int i = 0; i != 100; ++i)
-{
-    sql << "insert into numbers(value) values(" << i << ")";
-}
-
-// Example 2.
-for (int i = 0; i != 100; ++i)
-{
-    sql << "insert into numbers(value) values(:val)", use(i);
-}
-
- -

Both examples will populate the table numbers with the -values from 0 to 99.

- -

The problem is that in both examples, not only the statement execution is -repeated 100 times, but also the statement parsing and preparation. -This means unnecessary overhead, even if some of the database servers -are likely to optimize the second case. In fact, more complicated queries are -likely to suffer in terms of lower performance, because finding the optimal -execution plan is quite expensive and here it would be needlessly repeated.

- -

The following example uses the class statement -explicitly, by preparing the statement only once and repeating its -execution with changing data (note the use of prepare -member of session class):

- - -
-int i;
-statement st = (sql.prepare <<
-                "insert into numbers(value) values(:val)",
-                use(i));
-for (i = 0; i != 100; ++i)
-{
-    st.execute(true);
-}
-
- -

The true parameter given to the execute -method indicates that the actual data exchange is wanted, so that the -meaning of the whole example is "prepare the statement and exchange the -data for each value of variable i".

- -
-

Portability note:

-

The above syntax is supported for all backends, even if some database server -does not actually provide this functionality - in which case the library will internally -execute the query in a single phase, without really separating -the statement preparation from execution.

-

For PostgreSQL servers older than 8.0 it is necessary to define the -SOCI_POSTGRESQL_NOPREPARE macro while compiling the library -to fall back to this one-phase behaviour. Simply, pass --DSOCI_POSTGRESQL_NOPREPARE=ON variable to CMake.

-
- -

Rowset and iterator-based access

- -

The rowset class provides an alternative means of executing queries and accessing results using STL-like iterator interface.

- -

The rowset_iterator type is compatible with requirements defined for input iterator category and is available via iterator and const_iterator definitions in the rowset class.

-

The rowset itself can be used only with select queries.

- -

The following example creates an instance of the rowset class and binds query results into elements of int type - in this query only one result column is expected. After executing the query the code iterates through the query result using rowset_iterator:

- -
-rowset<int> rs = (sql.prepare << "select values from numbers");
-
-for (rowset<int>::const_iterator it = rs.begin(); it != rs.end(); ++it)
-{
-     cout << *it << '\n';
-}
-
- -

Another example shows how to retrieve more complex results, where rowset elements are of type row and therefore use dynamic bindings:

- -
-// person table has 4 columns
-
-rowset<row> rs = (sql.prepare << "select id, firstname, lastname, gender from person");
-
-// iteration through the resultset:
-for (rowset<row>::const_iterator it = rs.begin(); it != rs.end(); ++it)
-{
-    row const& row = *it;
-
-    // dynamic data extraction from each row:
-    cout << "Id: " << row.get<int>(0) << '\n'
-         << "Name: " << row.get<string>(1) << " " << row.get<string>(2) << '\n'
-         << "Gender: " << row.get<string>(3) << endl;
-}
-
- -

rowset_iterator can be used with standard algorithms as well:

- -
-rowset<string> rs = (sql.prepare << "select firstname from person");
-
-std::copy(rs.begin(), rs.end(), std::ostream_iterator<std::string>(std::cout, "\n"));
-
- -

Above, the query result contains a single column which is bound to rowset element of type of std::string. All records are sent to standard output using the std::copy algorithm.

- -

Bulk operations

- -

When using some databases, further performance improvements may be possible by having the underlying database API group operations together to reduce network roundtrips. SOCI makes such bulk operations possible by supporting std::vector -based types:

- -
-// Example 3.
-const int BATCH_SIZE = 25;
-std::vector<int> valsIn;
-for (int i = 0; i != BATCH_SIZE; ++i)
-{
-    ids.push_back(i);
-}
-
-statement st = (sql.prepare <<
-                "insert into numbers(value) values(:val)",
-                use(valsIn));
-for (int i = 0; i != 4; ++i)
-{
-    st.execute(true);
-}
-
- -

(Of course, the size of the vector that will achieve optimum -performance will vary, depending on many environmental factors, such as -network speed.)

- -

It is also possible to read all the numbers written in the above -examples:

- -
-int i;
-statement st = (sql.prepare <<
-                "select value from numbers order by value",
-                into(i));
-st.execute();
-while (st.fetch())
-{
-    cout << i << '\n';
-}
-
- -

In the above example, the execute method is called -with the default parameter false. This means that the -statement should be executed, but the actual data exchange will be -performed later.

- -

Further fetch -calls perform the actual data retrieval and cursor traversal. The -end-of-cursor condition is indicated by the fetch -function returning false.

- -

The above code example should be treated as an idiomatic way -of reading many rows of data, one at a time.

- -

It is further possible to select records in batches into std::vector -based types, with the size of the vector specifying the number of -records to retrieve in each round trip:

- -
-std::vector<int> valsOut(100);
-sql << "select val from numbers", into(valsOut);
-
- -

Above, the value 100 indicates that no more values -should be retrieved, even if it would be otherwise possible. If there -are less rows than asked for, the vector will be appropriately -down-sized.

- -

The statement::execute() and statement::fetch() -functions can also be used to repeatedly select all rows returned by a -query into a vector based type:

- -
-const int BATCH_SIZE = 30;
-std::vector<int> valsOut(BATCH_SIZE);
-statement st = (sql.prepare <<
-                "select value from numbers",
-                into(valsOut));
-st.execute();
-while (st.fetch())
-{
-    std::vector<int>::iterator pos;
-    for(; pos != valsOut.end(); ++pos)
-    {
-        cout << *pos << '\n';
-    }
-
-    valsOut.resize(BATCH_SIZE);
-}
-
- -

Assuming there are 100 rows returned by the query, the above code -will retrieve and print all of them. Since the output vector was -created with size 30, it will take (at least) 4 calls to fetch() -to retrieve all 100 values. Each call to fetch() -can potentially resize the vector to a size less than its initial size -- how often this happens depends on the underlying database -implementation. -This explains why the resize(BATCH_SIZE) operation is -needed - it is there to ensure that each time the fetch() -is called, the vector is ready to accept the next bunch of values. -Without this operation, the vector might -be getting smaller with subsequent iterations of the loop, forcing more -iterations to be performed (because all -rows will be read anyway), than really needed.

- -

Note the following details about the above examples:

-
    -
  • After performing fetch(), the vector's size might -be less than requested, but fetch() -returning true means that there was at least one row retrieved.
  • -
  • It is forbidden to manually resize the vector to the size higher than it was initially (this -can cause the vector to reallocate its internal buffer and the library -can lose track of it).
  • -
- -

Taking these points under consideration, the above code example should -be treated as an idiomatic way of reading many rows by bunches of -requested size.

- -
-

Portability note:

-

Actually, all supported backends guarantee that the requested -number of rows will be read with each fetch and that the vector will -never be down-sized, unless for the last fetch, when the end of rowset condition is met. -This means that the manual vector -resizing is in practice not needed - the vector will keep its size until the end of -rowset. The above idiom, however, is provided with future backends in -mind, where the constant size of the vector might be too expensive to -guarantee and where allowing fetch to down-size the -vector even before reaching the end of rowset might buy some -performance gains.

-
- -

Stored procedures

- -

The procedure class provides a convenient mechanism for -calling stored procedures:

- -
-sql << "create or replace procedure echo(output out varchar2,"
-       "input in varchar2) as "
-       "begin output := input; end;";
-
-std::string in("my message");
-std::string out;
-procedure proc = (sql.prepare << "echo(:output, :input)",
-                                 use(out, "output"),
-                                 use(in, "input"));
-proc.execute(true);
-assert(out == "my message");
-
- -
-

Portability note:

-

The above way of calling stored procedures is provided for portability -of the code that might need it. It is of course still possible to call -procedures or functions using the syntax supported by the given -database server.

-
- -

Transactions

- -

The SOCI library provides the following members of the session -class for transaction management:

-
    -
  • void begin();
  • -
  • void commit();
  • -
  • void rollback();
  • -
- -

In addition to the above there is a RAII wrapper that allows to associate the transaction with the -given scope of code:

-
-class transaction
-{
-public:
-    explicit transaction(session & sql);
-
-    ~transaction();
-
-    void commit();
-    void rollback();
-
-private:
-    // ...
-};
-
- -

The object of class transaction will roll back automatically when the object is destroyed -(usually as a result of leaving the scope) and when the transaction was not explicitly committed before that.

-

A typical usage pattern for this class might be:

-
-{
-    transaction tr(sql);
-
-    sql << "insert into ...";
-    sql << "more sql queries ...";
-    // ...
-
-    tr.commit();
-}
-
-

With the above pattern the transaction is committed only when the code successfully -reaches the end of block. If some exception is thrown before that, the scope will be left -without reaching the final statement and the transaction object -will automatically roll back in its destructor.

- -
-

Portability note:

-

Different database servers have different policies with regard to the -implicit transaction management. Some of them start the implicit -transaction with the first DML statement and keep it open until -explicitly commited or rolled back (or closing the whole session). -Others will treat each statement as if it was a separate, auto-commited -transaction. For better compatibility, it is recommended to use the -above functions for explicit transaction management.

-
- -

Basic logging support

- -

The following members of the session class support the basic logging functionality:

-
    -
  • void set_log_stream(std::ostream * s);
  • -
  • std::ostream * get_log_stream() const;
  • -
  • std::string get_last_query() const;
  • -
- -

The first two functions allow to set the user-provided output stream object for logging. The NULL value, which is the default, means that there is no logging. An example use might be:

- -
-session sql(oracle, "...");
-
-ofstream file("my_log.txt");
-sql.set_log_stream(&file);
-
-// ...
-
- -

Each statement logs its query string before the preparation step (whether explicit or implicit) and therefore logging is effective whether the query succeeds or not. Note that each prepared query is logged only once, independent on how many times it is executed.

-

The get_last_query function allows to retrieve the last used query.

- - - - - - - - - - - diff --git a/doc/structure.html b/doc/structure.html deleted file mode 100644 index 7ad68915..00000000 --- a/doc/structure.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - SOCI - structure - - - - - -

Structure

- -
-Library structure diagram -
- -

The picture above presents the structure of the library, together with its -clients and servers. The boxes filled with cyan represent components that -are part of the library distribution.

- -

The SOCI library is extensible in the following ways:

-
    -
  • More backends can be added to target various database servers.
  • -
  • More interfaces can be defined on top of common backend interface.
  • -
  • Other languages can use the simple interface, which was designed specifically - for the "C" calling convention to ensure easy binding.
  • -
- -

The core part of the library and the backend interface definition are -placed in the core directory of the library distribution. -The soci-backend.h file is an internal abstract -interface to the actual backends, which are needed to perform -operations on the given database server. Normally, the C++ client -program needs to interface with the soci.h header and the -header(s) relevant to the given backend(s) (for example, soci-oracle.h), -although with dynamic backend loading this can be avoided. -It is possible for the same program to use many backends at the same -time.

- -

Everything in SOCI is -declared in the namespace soci. -All code examples presented in this documentation assume that your code -begins with something -like:

-
-#include "soci.h"
-// other includes if necessary
-
-using namespace soci;
-
-// ...
-
- -
-

Note: -In simple programs, #include for the relevant -backend is needed only in the file where the session -object is created with explicit name of the backend factory. -The example program on the previous -page shows the appropriate #include directive for the -Oracle backend. It is also possible to name backends at run-time -as part of the connection string, in which case no backend-specific -#include directive is necessary.

-
- - - - - - - - - - - diff --git a/doc/structure.odg b/doc/structure.odg deleted file mode 100644 index 64aa0761c5b71a18ad12e8164348c80433522078..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29603 zcmbrl1C%Av^CnofZQHhO+g6utcU5)SMi;u+WxJ}&wr$(q*FFE4ot^WWIeT_*oXotD z_eR7QU*yY^H{W|ovY=pSK!4kk^Eg)?C__Ijp#OJ+0&I5HcIK{Lj^@UWj<(jO#;(>5 z_KfcKW(*F-F4is#4vyybW)7xqcINi343^Huj#k#DE=vCohX5b{qu~I0q7L>J)|PJ0 z|6IASFuJ%JySllU7&|lmH#;am*uOyjhY_Gd`5)|zO-;>h%>iy4oEc5soSpw7@U*i9 z1yYiQ{0kfi`EzMmRMXX)zj2&J6 zmlUT81Fv*Jfq?#Q^Z;WeYg1P@Ku(OzO#gFZ`7h<~k(G&Cf?1To(cbchl7b{W3=Ryy z4qjSHOa*Wx`ny2^oB@dyMGgW10SYRoCJs=6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27kKS(2^O}-Q51m z(r)A|Tnb->BzJB*;C{ya54vlJYs003{&VwF*?enZ8NXk#5($Yp`!`=Qicm1E3;z`) zEFd&E^&QarvDm@pPGL?b95}Wszq~PRZ)u596SF|vX;gU8(lT~Zea&A&dVaKLr>yOe zC8{Dz5(WWpsP(Ws^#8aBn-0A`r}hnAgrNrSA7+T)NrC?ll}!2w2ZD_b+i|AOy zzty9uf}zpI9Y^lWORdB)_5n3>ZLmFC5+6Fm=X!)GqrA*xEC&4>59jjX{jbCF?g zyMc_qQ6MOp&cP<^CkM@;*_7l!a}mDQIBm_u&~{#j_IZT{VPVeV_i!!ZAsC%NH|pTKCzu z{NVjHR8>-vWRq*@!e{oo`gC^5f;HpQ+GF%)udsWEMwHbkN6GPq;ynJM_2F;S6vZ6% zF8*GZXEq3wx?ClGCw7cQJl(|t j0$Cn=(dH|@Qm|-- - - - - - SOCI - articles - - - - - - - - - - - - - - -
-

The following articles were published about SOCI:

- -
- - diff --git a/www/doc.html b/www/doc.html deleted file mode 100644 index 9b42ebc8..00000000 --- a/www/doc.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SOCI - - -SOCI
-The C++ Database Access Library -
-
-Documentation and tutorial
-

-The documentation was moved to http://soci.sourceforge.net/doc/index.html
-Please update your links.
-
- - diff --git a/www/events.html b/www/events.html deleted file mode 100644 index 61cc75db..00000000 --- a/www/events.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - SOCI - events - - - - - - - - - - - - - - -
-

Events:

- -2008-07-10: -
3.0.0 version is released. -
-
-2006-12-04: -
2.2.0 version is released. -
-
-2006-05-15: -
2.1.0 version is released. -
-
-2006-01-16: -
2.0.0 version is released. -
-
-2005-10-14: -
1.2.1 version is released. -
-
-2005-10-02: -
1.2.0 version is released. -
-
-2005-03-06: -
1.1.0 version is released. -
-
-2004-10-16: -
1.0.1 version is released. -
-
-2004-10-12: -
SOCI project is registered at SourceForge. -
-
-2004-09-29: -
First version of SOCI is announced on comp.lang.c++.moderated. -
-
- - diff --git a/www/index.html b/www/index.html deleted file mode 100644 index 04eb990e..00000000 --- a/www/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - SOCI - - - - - - - - - - - - - - -
-

SOCI is a database access library -for C++ that makes the illusion of embedding -SQL queries in the regular -C++ code, staying entirely within the Standard C++.

- -

The idea is to provide C++ programmers a way to access SQL -databases in the most natural and intuitive way. If you find existing -libraries too difficult for your needs or just distracting, SOCI can be -a good alternative.

- -

The simplest motivating code example for the SQL query that is supposed -to retrieve a single row is:

-
-int id = ...;
-string name;
-int salary;
-
-sql << "select name, salary from persons where id = " << id,
-       into(name), into(salary);
-
- -

and the following benefits from extensive support for object-relational -mapping:

-
-int id = ...;
-Person p;
-
-sql << "select first_name, last_name, date_of_birth "
-       "from persons where id = " << id,
-       into(p);
-
- -

Integration with STL is also supported:

- -
-Rowset<string> rs = (sql.prepare << "select name from persons");
-copy(rs.begin(), rs.end(), ostream_iterator<string>(cout, "\n"));
-
- -

SOCI offers also extensive integration with Boost datatypes (optional, tuple and fusion) and flexible support -for user-defined datatypes.

- -

Starting from its 2.0.0 release, SOCI uses the plug-in architecture for -backends - this allows to target various database servers. Currently (3.0.0), -the following database servers are supported:

-
    -
  • Oracle
  • -
  • PostgreSQL
  • -
  • MySQL
  • -
- -

Other (unsupported) backends exist in the CVS repository: ODBC, SQLite and Firebird.

- -

The intent of the library is to cover as many database technologies as -possible. For this, the project has to rely on volunteer contributions -from other programmers, who have expertise with the existing database -interfaces and would like to help writing dedicated backends.
-If you are interested in participating, please contact the project admin.

- -

The SOCI library is distributed under the terms of the Boost -Software License.

- -

The latest and experimental version of the code is always available from -the Git repository.

-

Anonymous clone of this repository can be obtained with:

-
-$ git clone git://soci.git.sourceforge.net/gitroot/soci/soci
-
- -

To meet other users, please consider subscribing to the SOCI -mailing list.

-
- - diff --git a/www/links.html b/www/links.html deleted file mode 100644 index c3dd10ea..00000000 --- a/www/links.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - SOCI - links - - - - - - - - - - - - - - -
-

Some links you may find useful:

- -ORAPP - Oracle OCI C++ Interface Library - -
- -OCI C++ Library - -
- -Oracle, ODBC and DB2-CLI Template Library - -
- -Oracle C++ Call Interface - -
- -Oracle Open Source Projects - -
- -Database Template Library - -
- -MyMySQL - A lightweight C++ wrapper around MySQL client API - -
- - diff --git a/www/people.html b/www/people.html deleted file mode 100644 index 5bf5700c..00000000 --- a/www/people.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - SOCI - people - - - - - - - - - - - - - - -
-

SOCI People:

- -Maciej Sobczak (see homepage) -
Project admin
-Core development
-Initial Oracle Call Interface support
-Plug-in backend architecture
-PostgreSQL backend
-Documentation -
-
-Steve Hutton (see homepage) -
Core development
-Bulk (vector) operations
-Dynamic result binding
-Object-Relational mapping facilities
-Common tests framework
-Documentation -
-
-David Courtney (see homepage) -
SQLite backend
-MS SQL Server (via ODBC) backend -
-
-Pawe³ Aleksander Fedoryñski (see homepage) -
MySQL backend -
-
-Rafa³ Bobrowski -
Firebird backend -
-
-Mateusz £oskot (see homepage) -
Package and build manager
-Iterator support -
-
- - diff --git a/www/style.css b/www/style.css deleted file mode 100644 index 4d203551..00000000 --- a/www/style.css +++ /dev/null @@ -1,73 +0,0 @@ -body -{ - background-color: white; - color: black; - margin-left: 100px; - margin-right: 100px; -/* font-family: arial, sans-serif; */ -} - -table.banner -{ - width: 100%; - border-bottom-color: black; - border-bottom-style: solid; - border-bottom-width: 1px; - padding-top: 16px; - padding-bottom: 5px; -} - -td.banner_left -{ - font-size: x-large; - font-weight: bold; - font-stretch: expanded; -} - -td.banner_right -{ - text-align: right; -} - -table.footer -{ - width: 100%; - border-top-color: black; - border-top-style: solid; - border-top-width: 1px; - padding-bottom: 16px; - padding-top: 5px; -} - -table.main -{ - padding-top: 25px; -} - -td.main_navigator -{ - vertical-align: top; -} - -td.main_text -{ - vertical-align: top; - padding-left: 20px; -} - -span.bold -{ - font-weight: bold; -} - -span.literal -{ - font-weight: bold; - background-color: white; - color: #8B0000; -} - -div.indent -{ - margin-left: 40px; -} From 20dd44de6dcb7559e25adab15468243aaae7b22e Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 26 Dec 2010 15:10:59 +0100 Subject: [PATCH 06/19] [Branch src] Creation of the 'src' branch, from the master repository. --- cmake/CMakeLists.txt | 15 - cmake/SociBackend.cmake | 327 -------------- cmake/SociConfig.cmake | 49 --- cmake/SociDependencies.cmake | 81 ---- cmake/SociSystemInfo.cmake | 77 ---- cmake/SociUtilities.cmake | 416 ------------------ cmake/SociVersion.cmake | 59 --- cmake/dependencies/Boost.cmake | 14 - cmake/dependencies/MySQL.cmake | 10 - cmake/dependencies/ODBC.cmake | 10 - cmake/dependencies/Oracle.cmake | 5 - cmake/dependencies/PostgreSQL.cmake | 5 - cmake/dependencies/SQLite3.cmake | 5 - cmake/dependencies/Threads.cmake | 5 - cmake/modules/FindDL.cmake | 21 - cmake/modules/FindMySQL.cmake | 103 ----- cmake/modules/FindODBC.cmake | 55 --- cmake/modules/FindOracle.cmake | 76 ---- cmake/modules/FindPostgreSQL.cmake | 77 ---- cmake/modules/FindSQLite3.cmake | 70 --- .../vs2010-test-cmd-args.vcxproj.user.in | 7 - 21 files changed, 1487 deletions(-) delete mode 100644 cmake/CMakeLists.txt delete mode 100644 cmake/SociBackend.cmake delete mode 100644 cmake/SociConfig.cmake delete mode 100644 cmake/SociDependencies.cmake delete mode 100644 cmake/SociSystemInfo.cmake delete mode 100644 cmake/SociUtilities.cmake delete mode 100644 cmake/SociVersion.cmake delete mode 100644 cmake/dependencies/Boost.cmake delete mode 100644 cmake/dependencies/MySQL.cmake delete mode 100644 cmake/dependencies/ODBC.cmake delete mode 100644 cmake/dependencies/Oracle.cmake delete mode 100644 cmake/dependencies/PostgreSQL.cmake delete mode 100644 cmake/dependencies/SQLite3.cmake delete mode 100644 cmake/dependencies/Threads.cmake delete mode 100644 cmake/modules/FindDL.cmake delete mode 100644 cmake/modules/FindMySQL.cmake delete mode 100644 cmake/modules/FindODBC.cmake delete mode 100644 cmake/modules/FindOracle.cmake delete mode 100644 cmake/modules/FindPostgreSQL.cmake delete mode 100644 cmake/modules/FindSQLite3.cmake delete mode 100644 cmake/resources/vs2010-test-cmd-args.vcxproj.user.in diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt deleted file mode 100644 index 3c4a3b83..00000000 --- a/cmake/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ - -################################################################################# -# -# This file is part of CMake configuration for SOCI library -# -# Copyright (C) 2009 Mateusz Loskot -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -# -################################################################################# - -# install the cmake modules - -file(GLOB SOCI_CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.cmake") diff --git a/cmake/SociBackend.cmake b/cmake/SociBackend.cmake deleted file mode 100644 index d34d152d..00000000 --- a/cmake/SociBackend.cmake +++ /dev/null @@ -1,327 +0,0 @@ -################################################################################ -# SociBackend.cmake - part of CMake configuration of SOCI library -################################################################################ -# Copyright (C) 2010 Mateusz Loskot -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -################################################################################ -# Macros in this module: -# -# soci_backend -# - defines project of a database backend for SOCI library -# -# soci_backend_test -# - defines test project of a database backend for SOCI library -################################################################################ - -# Defines project of a database backend for SOCI library -# -# soci_backend(backendname -# HEADERS header1 header2 -# DEPENDS dependency1 dependency2 -# DESCRIPTION description -# AUTHORS author1 author2 -# MAINTAINERS maintainer1 maintainer2) -# -macro(soci_backend NAME) - parse_arguments(THIS_BACKEND - "HEADERS;DEPENDS;DESCRIPTION;AUTHORS;MAINTAINERS;" - "" - ${ARGN}) - - message(STATUS "") - colormsg(HIGREEN "${NAME} - ${THIS_BACKEND_DESCRIPTION}") - - # Backend name variants utils - string(TOLOWER "${PROJECT_NAME}" PROJECTNAMEL) - string(TOLOWER "${NAME}" NAMEL) - string(TOUPPER "${NAME}" NAMEU) - - # Backend option available to user - set(THIS_BACKEND_OPTION SOCI_${NAMEU}) - option(${THIS_BACKEND_OPTION} - "Attempt to build ${PROJECT_NAME} backend for ${NAME}" ON) - - # Determine required dependencies - set(THIS_BACKEND_DEPENDS_INCLUDE_DIRS) - set(THIS_BACKEND_DEPENDS_LIBRARIES) - set(THIS_BACKEND_DEPENDS_DEFS) - set(DEPENDS_NOT_FOUND) - - # CMake 2.8+ syntax only: - #foreach(dep IN LISTS THIS_BACKEND_DEPENDS) - foreach(dep ${THIS_BACKEND_DEPENDS}) - - soci_check_package_found(${dep} DEPEND_FOUND) - if(NOT DEPEND_FOUND) - list(APPEND DEPENDS_NOT_FOUND ${dep}) - else() - string(TOUPPER "${dep}" DEPU) - list(APPEND THIS_BACKEND_DEPENDS_INCLUDE_DIRS ${${DEPU}_INCLUDE_DIR}) - list(APPEND THIS_BACKEND_DEPENDS_INCLUDE_DIRS ${${DEPU}_INCLUDE_DIRS}) - list(APPEND THIS_BACKEND_DEPENDS_LIBRARIES ${${DEPU}_LIBRARIES}) - list(APPEND THIS_BACKEND_DEPENDS_DEFS -DHAVE_${DEPU}=1) - endif() - endforeach() - - list(LENGTH DEPENDS_NOT_FOUND NOT_FOUND_COUNT) - - if (NOT_FOUND_COUNT GREATER 0) - - colormsg(_RED_ "WARNING:") - colormsg(RED "Some required dependencies of ${NAME} backend not found:") - - if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8) - foreach(dep ${DEPENDS_NOT_FOUND}) - colormsg(RED " ${dep}") - endforeach() - else() - foreach(dep IN LISTS DEPENDS_NOT_FOUND) - colormsg(RED " ${dep}") - endforeach() - endif() - - # TODO: Abort or warn compilation may fail? --mloskot - colormsg(RED "Skipping") - - set(${THIS_BACKEND_OPTION} OFF) - - else(NOT_FOUND_COUNT GREATER 0) - - if(${THIS_BACKEND_OPTION}) - - # Backend-specific include directories - list(APPEND THIS_BACKEND_DEPENDS_INCLUDE_DIRS ${SOCI_SOURCE_DIR}/core) - set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES - "${THIS_BACKEND_DEPENDS_INCLUDE_DIRS}") - - # Backend-specific preprocessor definitions - add_definitions(${THIS_BACKEND_DEPENDS_DEFS}) - - # Backend installable headers and sources - if (NOT THIS_BACKEND_HEADERS) - file(GLOB THIS_BACKEND_HEADERS *.h) - endif() - file(GLOB THIS_BACKEND_SOURCES *.cpp) - set(THIS_BACKEND_HEADERS_VAR SOCI_${NAMEU}_HEADERS) - set(${THIS_BACKEND_HEADERS_VAR} ${THIS_BACKEND_HEADERS}) - - # Group source files for IDE source explorers (e.g. Visual Studio) - source_group("Header Files" FILES ${THIS_BACKEND_HEADERS}) - source_group("Source Files" FILES ${THIS_BACKEND_SOURCES}) - source_group("CMake Files" FILES CMakeLists.txt) - - # Backend target - set(THIS_BACKEND_TARGET ${PROJECTNAMEL}_${NAMEL}) - set(THIS_BACKEND_TARGET_VAR SOCI_${NAMEU}_TARGET) - set(${THIS_BACKEND_TARGET_VAR} ${THIS_BACKEND_TARGET}) - - soci_target_output_name(${THIS_BACKEND_TARGET} ${THIS_BACKEND_TARGET_VAR}_OUTPUT_NAME) - - set(THIS_BACKEND_TARGET_OUTPUT_NAME ${${THIS_BACKEND_TARGET_VAR}_OUTPUT_NAME}) - set(THIS_BACKEND_TARGET_OUTPUT_NAME_VAR ${THIS_BACKEND_TARGET_VAR}_OUTPUT_NAME) - - # TODO: Extract as macros: soci_shared_lib_target and soci_static_lib_target --mloskot - - # Shared library target - add_library(${THIS_BACKEND_TARGET} - SHARED - ${THIS_BACKEND_SOURCES} - ${THIS_BACKEND_HEADERS}) - - target_link_libraries(${THIS_BACKEND_TARGET} - ${SOCI_CORE_TARGET} - ${THIS_BACKEND_DEPENDS_LIBRARIES}) - - if(WIN32) - set_target_properties(${THIS_BACKEND_TARGET} - PROPERTIES - OUTPUT_NAME ${THIS_BACKEND_TARGET_OUTPUT_NAME} - DEFINE_SYMBOL SOCI_DLL) - else() - set_target_properties(${THIS_BACKEND_TARGET} - PROPERTIES - SOVERSION ${${PROJECT_NAME}_SOVERSION}) - endif() - - set_target_properties(${THIS_BACKEND_TARGET} - PROPERTIES - VERSION ${${PROJECT_NAME}_VERSION} - CLEAN_DIRECT_OUTPUT 1) - - # Static library target - add_library(${THIS_BACKEND_TARGET}-static - STATIC - ${THIS_BACKEND_SOURCES} - ${THIS_BACKEND_HEADERS}) - - set_target_properties(${THIS_BACKEND_TARGET}-static - PROPERTIES - OUTPUT_NAME ${THIS_BACKEND_TARGET_OUTPUT_NAME} - PREFIX "lib" - CLEAN_DIRECT_OUTPUT 1) - - # Backend installation - install(FILES ${THIS_BACKEND_HEADERS} - DESTINATION - ${INCLUDEDIR}/${PROJECTNAMEL}/${NAMEL}) - - install(TARGETS ${THIS_BACKEND_TARGET} ${THIS_BACKEND_TARGET}-static - RUNTIME DESTINATION ${BINDIR} - LIBRARY DESTINATION ${LIBDIR} - ARCHIVE DESTINATION ${LIBDIR}) - - else() - colormsg(HIRED "${NAME}" RED "backend disabled, since") - endif() - - endif(NOT_FOUND_COUNT GREATER 0) - - boost_report_value(${THIS_BACKEND_OPTION}) - - if(${THIS_BACKEND_OPTION}) - boost_report_value(${THIS_BACKEND_TARGET_VAR}) - boost_report_value(${THIS_BACKEND_TARGET_OUTPUT_NAME_VAR}) - boost_report_value(${THIS_BACKEND_HEADERS_VAR}) - - soci_report_directory_property(COMPILE_DEFINITIONS) - endif() - - # LOG - #message("soci_backend:") - #message("NAME: ${NAME}") - #message("${THIS_BACKEND_OPTION} = ${SOCI_BACKEND_SQLITE3}") - #message("DEPENDS: ${THIS_BACKEND_DEPENDS}") - #message("DESCRIPTION: ${THIS_BACKEND_DESCRIPTION}") - #message("AUTHORS: ${THIS_BACKEND_AUTHORS}") - #message("MAINTAINERS: ${THIS_BACKEND_MAINTAINERS}") - #message("HEADERS: ${THIS_BACKEND_HEADERS}") - #message("SOURCES: ${THIS_BACKEND_SOURCES}") - #message("DEPENDS_LIBRARIES: ${THIS_BACKEND_DEPENDS_LIBRARIES}") - #message("DEPENDS_INCLUDE_DIRS: ${THIS_BACKEND_DEPENDS_INCLUDE_DIRS}") -endmacro() - -# Generates .vcxproj.user for target of each test. -# -# soci_backend_test_create_vcxproj_user( -# PostgreSQLTest -# "host=localhost dbname=soci_test user=mloskot") -# -function(soci_backend_test_create_vcxproj_user TARGET_NAME TEST_CMD_ARGS) - if(MSVC) - set(SYSTEM_NAME $ENV{USERDOMAIN}) - set(USER_NAME $ENV{USERNAME}) - set(SOCI_TEST_CMD_ARGS ${TEST_CMD_ARGS}) - - if(MSVC_VERSION EQUAL 1600) - configure_file( - ${SOCI_SOURCE_DIR}/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in - ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.vcxproj.user - @ONLY) - endif() - endif() -endfunction(soci_backend_test_create_vcxproj_user) - -# Defines test project of a database backend for SOCI library -# -# soci_backend_test(BACKEND mybackend SOURCE mytest1.cpp -# NAME mytest1 -# CONNSTR "my test connection" -# DEPENDS library1 library2) -# -macro(soci_backend_test) - parse_arguments(THIS_TEST - "BACKEND;SOURCE;CONNSTR;NAME;DEPENDS;" - "" - ${ARGN}) - - # Test backend name - string(TOUPPER "${THIS_TEST_BACKEND}" BACKENDU) - string(TOLOWER "${THIS_TEST_BACKEND}" BACKENDL) - - if(SOCI_TESTS AND SOCI_${BACKENDU}) - - # Test name - if(THIS_TEST_NAME) - string(TOUPPER "${THIS_TEST_NAME}" NAMEU) - set(TEST_FULL_NAME SOCI_${BACKENDU}_TEST_${NAMEU}) - else() - set(TEST_FULL_NAME SOCI_${BACKENDU}_TEST) - endif() - - set(TEST_CONNSTR_VAR ${TEST_FULL_NAME}_CONNSTR) - set(${TEST_CONNSTR_VAR} "" - CACHE STRING "Connection string for ${BACKENDU} test") - - if(NOT ${TEST_CONNSTR_VAR} AND THIS_TEST_CONNSTR) - set(${TEST_CONNSTR_VAR} ${THIS_TEST_CONNSTR}) - endif() - boost_report_value(${TEST_CONNSTR_VAR}) - - include_directories(${SOCI_SOURCE_DIR}/core/test) - include_directories(${SOCI_SOURCE_DIR}/backends/${BACKENDL}) - - # TODO: Find more generic way of adding Boost to core and backend tests only. - # Ideally, from within Boost.cmake. - set(SOCI_TEST_DEPENDENCIES) - if(Boost_FOUND) - include_directories(${Boost_INCLUDE_DIRS}) - if(Boost_DATE_TIME_FOUND) - set(SOCI_TEST_DEPENDENCIES ${Boost_DATE_TIME_LIBRARY}) - add_definitions(-DHAVE_BOOST_DATE_TIME=1) - endif() - endif() - - string(TOLOWER "${TEST_FULL_NAME}" TEST_TARGET) - - set(TEST_HEADERS ${PROJECT_SOURCE_DIR}/core/test/common-tests.h) - - add_executable(${TEST_TARGET} ${TEST_HEADERS} ${THIS_TEST_SOURCE}) - add_executable(${TEST_TARGET}_static ${TEST_HEADERS} ${THIS_TEST_SOURCE}) - - target_link_libraries(${TEST_TARGET} - ${SOCI_CORE_TARGET} - ${SOCI_${BACKENDU}_TARGET} - ${${BACKENDU}_LIBRARIES} - ${SOCI_TEST_DEPENDENCIES}) - - target_link_libraries(${TEST_TARGET}_static - ${SOCI_CORE_TARGET}-static - ${SOCI_${BACKENDU}_TARGET}-static - ${${BACKENDU}_LIBRARIES} - ${SOCI_CORE_STATIC_DEPENDENCIES} - ${SOCI_TEST_DEPENDENCIES}) - - add_test(${TEST_TARGET} - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_TARGET} - ${${TEST_CONNSTR_VAR}}) - - add_test(${TEST_TARGET}_static - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_TARGET}_static - ${${TEST_CONNSTR_VAR}}) - - # Convenient .vcxproj.user making tests ready to run and debug from within IDE - soci_backend_test_create_vcxproj_user(${TEST_TARGET} "\"${${TEST_CONNSTR_VAR}}\"") - soci_backend_test_create_vcxproj_user(${TEST_TARGET}_static "\"${${TEST_CONNSTR_VAR}}\"") - - # Ask make check to try to build tests first before executing them - add_dependencies(check ${TEST_TARGET} ${TEST_TARGET}_static) - - # Group source files for IDE source explorers (e.g. Visual Studio) - source_group("Header Files" FILES ${TEST_HEADERS}) - source_group("Source Files" FILES ${THIS_TEST_SOURCE}) - source_group("CMake Files" FILES CMakeLists.txt) - - endif() - - # LOG - #message("NAME=${NAME}") - #message("THIS_TEST_NAME=${THIS_TEST_NAME}") - #message("THIS_TEST_BACKEND=${THIS_TEST_BACKEND}") - #message("THIS_TEST_CONNSTR=${THIS_TEST_CONNSTR}") - #message("THIS_TEST_SOURCE=${THIS_TEST_SOURCE}") - #message("THIS_TEST_OPTION=${THIS_TEST_OPTION}") - -endmacro() diff --git a/cmake/SociConfig.cmake b/cmake/SociConfig.cmake deleted file mode 100644 index 7e14171e..00000000 --- a/cmake/SociConfig.cmake +++ /dev/null @@ -1,49 +0,0 @@ -################################################################################ -# SociConfig.cmake - CMake build configuration of SOCI library -################################################################################ -# Copyright (C) 2010 Mateusz Loskot -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -################################################################################ - -# -# Force compilation flags and set desired warnings level -# - -if (MSVC) - if (MSVC80 OR MSVC90 OR MSVC10) - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) - add_definitions(-D_CRT_NONSTDC_NO_WARNING) - add_definitions(-D_SCL_SECURE_NO_WARNINGS) - endif() - - if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") - string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - endif() - -else() - - set(SOCI_GCC_CLANG_COMMON_FLAGS - "-pedantic -ansi -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long") - - if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${SOCI_GCC_CLANG_COMMON_FLAGS}") - if (CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") - endif() - - elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER}" MATCHES "clang") - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SOCI_GCC_CLANG_COMMON_FLAGS}") - - else() - message(FATAL_ERROR "CMake is unable to recognize compilation toolset to build SOCI for you!") - endif() - -endif() diff --git a/cmake/SociDependencies.cmake b/cmake/SociDependencies.cmake deleted file mode 100644 index a2a25937..00000000 --- a/cmake/SociDependencies.cmake +++ /dev/null @@ -1,81 +0,0 @@ -################################################################################ -# SociDependencies.cmake - part of CMake configuration of SOCI library -# -# Based on BoostExternals.cmake from CMake configuration for Boost -################################################################################ -# Copyright (C) 2010 Mateusz Loskot -# Copyright (C) 2009 Troy Straszheim -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -################################################################################ -# Macros in this module: -# -# soci_backend - defines a database backend for SOCI library -# -################################################################################ - -# -# List of SOCI dependncies -# -set(SOCI_BACKENDS_ALL_DEPENDENCIES - Boost - MySQL - ODBC - Oracle - PostgreSQL - SQLite3) - -# -# Perform checks -# -message(STATUS "") -colormsg(_HIBLUE_ "Looking for SOCI dependencies:") - -macro(boost_external_report NAME) - - set(VARNAME ${NAME}) - set(SUCCESS ${${VARNAME}_FOUND}) - - set(VARNAMES ${ARGV}) - list(REMOVE_AT VARNAMES 0) - - # Test both, given original name and uppercase version too - if(NOT SUCCESS) - string(TOUPPER ${NAME} VARNAME) - set(SUCCESS ${${VARNAME}_FOUND}) - if(NOT SUCCESS) - colormsg(_RED_ "WARNING:") - colormsg(RED "${NAME} not found, some libraries or features will be disabled.") - colormsg(RED "See the documentation for ${NAME} or manually set these variables:") - endif() - endif() - - foreach(variable ${VARNAMES}) - boost_report_value(${VARNAME}_${variable}) - endforeach() -endmacro() - -# -# Some externals default to OFF -# -option(WITH_VALGRIND "Run tests under valgrind" OFF) - -# -# Detect available dependencies -# -foreach(external ${SOCI_BACKENDS_ALL_DEPENDENCIES}) - - message(STATUS "") - string(TOUPPER "${external}" EXTERNAL) - option(WITH_${EXTERNAL} "Attempt to find and configure ${external}" ON) - if(WITH_${EXTERNAL}) - colormsg(HICYAN "${external}:") - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies/${external}.cmake) - else() - set(${EXTERNAL}_FOUND FALSE CACHE BOOL "${external} found" FORCE) - colormsg(HIRED "${external}:" RED "disabled, since WITH_${EXTERNAL}=OFF") - endif() -endforeach() -message(STATUS "") diff --git a/cmake/SociSystemInfo.cmake b/cmake/SociSystemInfo.cmake deleted file mode 100644 index c6690b2a..00000000 --- a/cmake/SociSystemInfo.cmake +++ /dev/null @@ -1,77 +0,0 @@ -################################################################################ -# SociSystemInfo.cmake - part of CMake configuration of SOCI library -# -# Based on idea taken from http://code.google.com/p/softart/ project -################################################################################ -# Copyright (C) 2010 Mateusz Loskot -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -################################################################################ -# The following variables are defined: -# SOCI_COMPILER_NAME - name of compiler toolset, follows Boost toolset naming. -# SOCI_PLATFORM_NAME - target platform name: x64, x86 or win32 -################################################################################ - -set(SOCI_COMPILER_NAME) -set(SOCI_PLATFORM_NAME) - -if(MINGW OR UNIX) - exec_program(gcc ARGS -dumpversion OUTPUT_VARIABLE GCC_VERSION) - string(REPLACE "." "" GCC_VERSION_STR_FULL ${GCC_VERSION}) - string(REGEX MATCH "[0-9]+\\.[0-9]+" GCC_VERSION_MAJOR_MINOR ${GCC_VERSION}) -endif() - -if(WIN32) - # Compilers, taken from http://predef.sourceforge.net/precomp.html#sec34 - if(MSVC) - if(MSVC_VERSION EQUAL 1200) - set(SOCI_COMPILER_NAME "msvc-6.0") - endif() - if(MSVC_VERSION EQUAL 1300) - set(SOCI_COMPILER_NAME "msvc-7.0") - endif() - if(MSVC_VERSION EQUAL 1310) - set(SOCI_COMPILER_NAME "msvc-7.1") #Visual Studio 2003 - endif() - if(MSVC_VERSION EQUAL 1400) - set(SOCI_COMPILER_NAME "msvc-8.0") #Visual Studio 2005 - endif() - if(MSVC_VERSION EQUAL 1500) - set(SOCI_COMPILER_NAME "msvc-9.0") #Visual Studio 2008 - endif() - if(MSVC_VERSION EQUAL 1600) - set(SOCI_COMPILER_NAME "msvc-10.0") #Visual Studio 2010 - endif() - endif(MSVC) - - if(MINGW) - set(SOCI_COMPILER_NAME "mingw-${GCC_VERSION}") - endif( MINGW ) - - if(CMAKE_GENERATOR MATCHES "Win64") - set(SOCI_PLATFORM_NAME "x64") - else() - set(SOCI_PLATFORM_NAME "win32") - endif() -endif(WIN32) - -if(UNIX) - set(SOCI_COMPILER_NAME "gcc-${GCC_VERSION}") - if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - set(SOCI_PLATFORM_NAME "x64") - else() - set(SOCI_PLATFORM_NAME "x86") - endif() -endif(UNIX) - -if(NOT SOCI_COMPILER_NAME) - colormsg(_RED_ "WARNING:") - colormsg(RED "Could not determine compiler toolset name to set SOCI_COMPILER_NAME variable.") -endif() - -if(NOT SOCI_PLATFORM_NAME) - colormsg(_RED_ "WARNING:") - colormsg(RED "Could not determine platform name to set SOCI_PLATFORM_NAME variable.") -endif() diff --git a/cmake/SociUtilities.cmake b/cmake/SociUtilities.cmake deleted file mode 100644 index 05e91532..00000000 --- a/cmake/SociUtilities.cmake +++ /dev/null @@ -1,416 +0,0 @@ -################################################################################ -# SociUtilities.cmake - part of CMake configuration of SOCI library -# -# Based on BoostUtilities.cmake from CMake configuration for Boost -################################################################################ -# Copyright (C) 2007 Douglas Gregor -# Copyright (C) 2007 Troy Straszheim -# Copyright (C) 2010 Mateusz Loskot -# -# Distributed under the Boost Software License, Version 1.0. -# See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt -################################################################################ -# Macros in this module: -# -# list_contains: Determine whether a string value is in a list. -# -# car: Return the first element in a list -# -# cdr: Return all but the first element in a list -# -# parse_arguments: Parse keyword arguments for use in other macros. -# -# soci_check_package_found: Test varname-FOUND for case-insensitive varname -# -################################################################################ - -# This utility macro determines whether a particular string value -# occurs within a list of strings: -# -# list_contains(result string_to_find arg1 arg2 arg3 ... argn) -# -# This macro sets the variable named by result equal to TRUE if -# string_to_find is found anywhere in the following arguments. -macro(list_contains var value) - set(${var}) - foreach (value2 ${ARGN}) - if (${value} STREQUAL ${value2}) - set(${var} TRUE) - endif (${value} STREQUAL ${value2}) - endforeach (value2) -endmacro(list_contains) - -# This utility macro extracts the first argument from the list of -# arguments given, and places it into the variable named var. -# -# car(var arg1 arg2 ...) -macro(car var) - set(${var} ${ARGV1}) -endmacro(car) - -# This utility macro extracts all of the arguments given except the -# first, and places them into the variable named var. -# -# car(var arg1 arg2 ...) -macro(cdr var junk) - set(${var} ${ARGN}) -endmacro(cdr) - -# The parse_arguments macro will take the arguments of another macro and -# define several variables. The first argument to parse_arguments is a -# prefix to put on all variables it creates. The second argument is a -# list of names, and the third argument is a list of options. Both of -# these lists should be quoted. The rest of parse_arguments are -# arguments from another macro to be parsed. -# -# parse_arguments(prefix arg_names options arg1 arg2...) -# -# For each item in options, parse_arguments will create a variable with -# that name, prefixed with prefix_. So, for example, if prefix is -# MY_MACRO and options is OPTION1;OPTION2, then parse_arguments will -# create the variables MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These -# variables will be set to true if the option exists in the command line -# or false otherwise. -# -# For each item in arg_names, parse_arguments will create a variable -# with that name, prefixed with prefix_. Each variable will be filled -# with the arguments that occur after the given arg_name is encountered -# up to the next arg_name or the end of the arguments. All options are -# removed from these lists. parse_arguments also creates a -# prefix_DEFAULT_ARGS variable containing the list of all arguments up -# to the first arg_name encountered. -macro(parse_arguments prefix arg_names option_names) - set(DEFAULT_ARGS) - foreach(arg_name ${arg_names}) - set(${prefix}_${arg_name}) - endforeach(arg_name) - foreach(option ${option_names}) - set(${prefix}_${option} FALSE) - endforeach(option) - - set(current_arg_name DEFAULT_ARGS) - set(current_arg_list) - foreach(arg ${ARGN}) - list_contains(is_arg_name ${arg} ${arg_names}) - if (is_arg_name) - set(${prefix}_${current_arg_name} ${current_arg_list}) - set(current_arg_name ${arg}) - set(current_arg_list) - else (is_arg_name) - list_contains(is_option ${arg} ${option_names}) - if (is_option) - set(${prefix}_${arg} TRUE) - else (is_option) - set(current_arg_list ${current_arg_list} ${arg}) - endif (is_option) - endif (is_arg_name) - endforeach(arg) - set(${prefix}_${current_arg_name} ${current_arg_list}) -endmacro(parse_arguments) - -# Perform a reverse topological sort on the given LIST. -# -# topological_sort(my_list "MY_" "_EDGES") -# -# LIST is the name of a variable containing a list of elements to be -# sorted in reverse topological order. Each element in the list has a -# set of outgoing edges (for example, those other list elements that -# it depends on). In the resulting reverse topological ordering -# (written back into the variable named LIST), an element will come -# later in the list than any of the elements that can be reached by -# following its outgoing edges and the outgoing edges of any vertices -# they target, recursively. Thus, if the edges represent dependencies -# on build targets, for example, the reverse topological ordering is -# the order in which one would build those targets. -# -# For each element E in this list, the edges for E are contained in -# the variable named ${PREFIX}${E}${SUFFIX}, where E is the -# upper-cased version of the element in the list. If no such variable -# exists, then it is assumed that there are no edges. For example, if -# my_list contains a, b, and c, one could provide a dependency graph -# using the following variables: -# -# MY_A_EDGES b -# MY_B_EDGES -# MY_C_EDGES a b -# -# With the involcation of topological_sort shown above and these -# variables, the resulting reverse topological ordering will be b, a, -# c. -function(topological_sort LIST PREFIX SUFFIX) - # Clear the stack and output variable - set(VERTICES "${${LIST}}") - set(STACK) - set(${LIST}) - - # Loop over all of the vertices, starting the topological sort from - # each one. - foreach(VERTEX ${VERTICES}) - string(TOUPPER ${VERTEX} UPPER_VERTEX) - - # If we haven't already processed this vertex, start a depth-first - # search from where. - if (NOT FOUND_${UPPER_VERTEX}) - # Push this vertex onto the stack with all of its outgoing edges - string(REPLACE ";" " " NEW_ELEMENT - "${VERTEX};${${PREFIX}${UPPER_VERTEX}${SUFFIX}}") - list(APPEND STACK ${NEW_ELEMENT}) - - # We've now seen this vertex - set(FOUND_${UPPER_VERTEX} TRUE) - - # While the depth-first search stack is not empty - list(LENGTH STACK STACK_LENGTH) - while(STACK_LENGTH GREATER 0) - # Remove the vertex and its remaining out-edges from the top - # of the stack - list(GET STACK -1 OUT_EDGES) - list(REMOVE_AT STACK -1) - - # Get the source vertex and the list of out-edges - separate_arguments(OUT_EDGES) - list(GET OUT_EDGES 0 SOURCE) - list(REMOVE_AT OUT_EDGES 0) - - # While there are still out-edges remaining - list(LENGTH OUT_EDGES OUT_DEGREE) - while (OUT_DEGREE GREATER 0) - # Pull off the first outgoing edge - list(GET OUT_EDGES 0 TARGET) - list(REMOVE_AT OUT_EDGES 0) - - string(TOUPPER ${TARGET} UPPER_TARGET) - if (NOT FOUND_${UPPER_TARGET}) - # We have not seen the target before, so we will traverse - # its outgoing edges before coming back to our - # source. This is the key to the depth-first traversal. - - # We've now seen this vertex - set(FOUND_${UPPER_TARGET} TRUE) - - # Push the remaining edges for the current vertex onto the - # stack - string(REPLACE ";" " " NEW_ELEMENT - "${SOURCE};${OUT_EDGES}") - list(APPEND STACK ${NEW_ELEMENT}) - - # Setup the new source and outgoing edges - set(SOURCE ${TARGET}) - string(TOUPPER ${SOURCE} UPPER_SOURCE) - set(OUT_EDGES - ${${PREFIX}${UPPER_SOURCE}${SUFFIX}}) - endif(NOT FOUND_${UPPER_TARGET}) - - list(LENGTH OUT_EDGES OUT_DEGREE) - endwhile (OUT_DEGREE GREATER 0) - - # We have finished all of the outgoing edges for - # SOURCE; add it to the resulting list. - list(APPEND ${LIST} ${SOURCE}) - - # Check the length of the stack - list(LENGTH STACK STACK_LENGTH) - endwhile(STACK_LENGTH GREATER 0) - endif (NOT FOUND_${UPPER_VERTEX}) - endforeach(VERTEX) - - set(${LIST} ${${LIST}} PARENT_SCOPE) -endfunction(topological_sort) - -# Small little hack that tweaks a component name (as used for CPack) -# to make sure to avoid certain names that cause problems. Sets the -# variable named varname to the "sanitized" name. -# -# FIXME: This is a complete hack. We probably need to fix the CPack -# generators (NSIS in particular) to get rid of the need for this. -macro(fix_cpack_component_name varname name) - if (${name} STREQUAL "foreach") - set(${varname} "boost_foreach") - else() - set(${varname} ${name}) - endif() -endmacro() - - -# -# A big shout out to the cmake gurus @ compiz -# -function (colormsg) - string (ASCII 27 _escape) - set(WHITE "29") - set(GRAY "30") - set(RED "31") - set(GREEN "32") - set(YELLOW "33") - set(BLUE "34") - set(MAG "35") - set(CYAN "36") - - foreach (color WHITE GRAY RED GREEN YELLOW BLUE MAG CYAN) - set(HI${color} "1\;${${color}}") - set(LO${color} "2\;${${color}}") - set(_${color}_ "4\;${${color}}") - set(_HI${color}_ "1\;4\;${${color}}") - set(_LO${color}_ "2\;4\;${${color}}") - endforeach() - - set(str "") - set(coloron FALSE) - foreach(arg ${ARGV}) - if (NOT ${${arg}} STREQUAL "") - if (CMAKE_COLOR_MAKEFILE) - set(str "${str}${_escape}[${${arg}}m") - set(coloron TRUE) - endif() - else() - set(str "${str}${arg}") - if (coloron) - set(str "${str}${_escape}[0m") - set(coloron FALSE) - endif() - set(str "${str} ") - endif() - endforeach() - message(STATUS ${str}) -endfunction() - -# colormsg("Colors:" -# WHITE "white" GRAY "gray" GREEN "green" -# RED "red" YELLOW "yellow" BLUE "blue" MAG "mag" CYAN "cyan" -# _WHITE_ "white" _GRAY_ "gray" _GREEN_ "green" -# _RED_ "red" _YELLOW_ "yellow" _BLUE_ "blue" _MAG_ "mag" _CYAN_ "cyan" -# _HIWHITE_ "white" _HIGRAY_ "gray" _HIGREEN_ "green" -# _HIRED_ "red" _HIYELLOW_ "yellow" _HIBLUE_ "blue" _HIMAG_ "mag" _HICYAN_ "cyan" -# HIWHITE "white" HIGRAY "gray" HIGREEN "green" -# HIRED "red" HIYELLOW "yellow" HIBLUE "blue" HIMAG "mag" HICYAN "cyan" -# "right?") - -# -# pretty-prints the value of a variable so that the -# equals signs align -# -function(boost_report_value NAME) - string(LENGTH "${NAME}" varlen) - # LOG - #message(STATUS "boost_report_value: NAME=${NAME} (${varlen})") - #message(STATUS "boost_report_value: \${NAME}=${${NAME}}") - math(EXPR padding_len 40-${varlen}) - string(SUBSTRING " " - 0 ${padding_len} varpadding) - colormsg("${NAME}${varpadding} = ${${NAME}}") -endfunction() - -function(trace NAME) - if(BOOST_CMAKE_TRACE) - string(LENGTH "${NAME}" varlen) - math(EXPR padding_len 40-${varlen}) - string(SUBSTRING "........................................" - 0 ${padding_len} varpadding) - message("${NAME} ${varpadding} ${${NAME}}") - endif() -endfunction() - -# -# pretty-prints the value of a variable so that the -# equals signs align -# -function(boost_report_pretty PRETTYNAME VARNAME) - string(LENGTH "${PRETTYNAME}" varlen) - math(EXPR padding_len 30-${varlen}) - string(SUBSTRING " " - 0 ${padding_len} varpadding) - message(STATUS "${PRETTYNAME}${varpadding} = ${${VARNAME}}") -endfunction() - -# -# assert that ARG is actually a library target -# -macro(dependency_check ARG) - trace(ARG) - if (NOT "${ARG}" STREQUAL "") - get_target_property(deptype ${ARG} TYPE) - if(NOT deptype MATCHES ".*_LIBRARY$") - set(DEPENDENCY_OKAY FALSE) - list(APPEND DEPENDENCY_FAILURES ${ARG}) - endif() - endif() -endmacro() - -# -# Tests package-FOUND for varname in three cases as given, lowercase and -# uppercase. -# -macro(soci_check_package_found NAME SUCCESS) - - set(${SUCCESS} FALSE) - set(VARNAME ${NAME}) - set(VARNAME_SUCCESS ${${VARNAME}_FOUND}) - - # Test both, given original name and uppercase version too - if(VARNAME_SUCCESS) - set(${SUCCESS} TRUE) - else() - string(TOUPPER ${NAME} VARNAME) - set(VARNAME_SUCCESS ${${VARNAME}_FOUND}) - if(VARNAME_SUCCESS) - set(${SUCCESS} TRUE) - endif() - endif() -endmacro() - -# -# Pretty-print of given property of current directory. -# -macro(soci_report_directory_property PROPNAME) - get_directory_property(${PROPNAME} ${PROPNAME}) - boost_report_value(${PROPNAME}) -endmacro() - -# -# Scans the current directory and returns a list of subdirectories. -# Author: Robert Fleming -# Source: http://www.cmake.org/pipermail/cmake/2008-February/020114.html -# -# Third parameter is 1 if you want relative paths returned. -# Usage: list_subdirectories(the_list_is_returned_here /path/to/project TRUE) -# -macro(list_subdirectories retval curdir return_relative) - file(GLOB sub-dir RELATIVE ${curdir} *) - set(list_of_dirs "") - foreach(dir ${sub-dir}) - if(IS_DIRECTORY ${curdir}/${dir}) - if (${return_relative}) - set(list_of_dirs ${list_of_dirs} ${dir}) - else() - set(list_of_dirs ${list_of_dirs} ${curdir}/${dir}) - endif() - endif() - endforeach() - set(${retval} ${list_of_dirs}) -endmacro() - -# -# Generates output name for given target depending on platform and version. -# For instance, on Windows, libraries get ABI version suffix soci_coreXY.{dll|lib}. -# -function(soci_target_output_name TARGET_NAME OUTPUT_NAME) - if(NOT DEFINED TARGET_NAME) - message(SEND_ERROR "Error, the variable TARGET_NAME is not defined!") - endif() - - if(NOT DEFINED ${PROJECT_NAME}_VERSION) - message(SEND_ERROR "Error, the variable ${${PROJECT_NAME}_VERSION} is not defined!") - endif() - - # On Windows, ABI version is specified using binary file name suffix. - # On Unix, suffix is empty and SOVERSION is used instead. - if (WIN32) - string(LENGTH "${${PROJECT_NAME}_ABI_VERSION}" abilen) - if(abilen GREATER 0) - set(SUFFIX "_${${PROJECT_NAME}_ABI_VERSION}") - endif() - endif() - - set(${OUTPUT_NAME} ${TARGET_NAME}${SUFFIX} PARENT_SCOPE) -endfunction() diff --git a/cmake/SociVersion.cmake b/cmake/SociVersion.cmake deleted file mode 100644 index d4923caa..00000000 --- a/cmake/SociVersion.cmake +++ /dev/null @@ -1,59 +0,0 @@ -################################################################################ -# SociVersion.cmake - part of CMake configuration of SOCI library -################################################################################ -# Copyright (C) 2010 Mateusz Loskot -# -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -################################################################################ -# Macros in this module: -# -# soci_version - defines version information for SOCI library -# -################################################################################ - -# Defines version information for SOCI library -# -# soci_version(MAJOR major_version MINOR minor_version PATCH patch_level) -# -# MAJOR.MINOR version is used to set SOVERSION -# -macro(soci_version) - parse_arguments(THIS_VERSION "MAJOR;MINOR;PATCH;" - "" - ${ARGN}) - - # Set version components - set(${PROJECT_NAME}_VERSION_MAJOR ${THIS_VERSION_MAJOR}) - set(${PROJECT_NAME}_VERSION_MINOR ${THIS_VERSION_MINOR}) - set(${PROJECT_NAME}_VERSION_PATCH ${THIS_VERSION_PATCH}) - - # Set VERSION string - set(${PROJECT_NAME}_VERSION - "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}") - - # Set SOVERSION based on major and minor - set(${PROJECT_NAME}_SOVERSION - "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}") - - # Set ABI version string used to name binary output and, by SOCI loader, to find binaries. - # On Windows, ABI version is specified using binary file name suffix. - # On Unix, suffix ix empty and SOVERSION is used instead. - if (UNIX) - set(${PROJECT_NAME}_ABI_VERSION ${${PROJECT_NAME}_SOVERSION}) - elseif(WIN32) - set(${PROJECT_NAME}_ABI_VERSION - "${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}") - else() - message(FATAL_ERROR "Ambiguous target platform with unknown ABI version scheme. Giving up.") - endif() - - message(STATUS "") - - boost_report_value(${PROJECT_NAME}_VERSION) - boost_report_value(${PROJECT_NAME}_ABI_VERSION) - - add_definitions(-DSOCI_ABI_VERSION=${${PROJECT_NAME}_ABI_VERSION}) - -endmacro() diff --git a/cmake/dependencies/Boost.cmake b/cmake/dependencies/Boost.cmake deleted file mode 100644 index c64af9ee..00000000 --- a/cmake/dependencies/Boost.cmake +++ /dev/null @@ -1,14 +0,0 @@ -set(Boost_FIND_QUIETLY TRUE) - -set(Boost_USE_STATIC_LIBS ON) -set(Boost_USE_MULTITHREADED ON) -find_package(Boost 1.33.1 COMPONENTS date_time) - -if (NOT Boost_date_time_FOUND) - find_package(Boost 1.33.1) -endif() - -set(Boost_RELEASE_VERSION - "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") - -boost_external_report(Boost RELEASE_VERSION INCLUDE_DIR LIBRARIES) diff --git a/cmake/dependencies/MySQL.cmake b/cmake/dependencies/MySQL.cmake deleted file mode 100644 index 9cac7a22..00000000 --- a/cmake/dependencies/MySQL.cmake +++ /dev/null @@ -1,10 +0,0 @@ -set(MySQL_FIND_QUIETLY TRUE) - -find_package(MySQL) - -boost_external_report(MySQL INCLUDE_DIR LIBRARIES) - -#if(MYSQL_FOUND) -# include_directories(${MYSQL_INCLUDE_DIR}) -# add_definitions(-DHAVE_MYSQL) -#endif() \ No newline at end of file diff --git a/cmake/dependencies/ODBC.cmake b/cmake/dependencies/ODBC.cmake deleted file mode 100644 index 93aa9410..00000000 --- a/cmake/dependencies/ODBC.cmake +++ /dev/null @@ -1,10 +0,0 @@ -set(ODBC_FIND_QUIETLY TRUE) - -find_package(ODBC) - -boost_external_report(ODBC INCLUDE_DIRECTORIES LIBRARIES) - -#if(MYSQL_FOUND) -# include_directories(${MYSQL_INCLUDE_DIR}) -# add_definitions(-DHAVE_MYSQL) -#endif() \ No newline at end of file diff --git a/cmake/dependencies/Oracle.cmake b/cmake/dependencies/Oracle.cmake deleted file mode 100644 index c6645204..00000000 --- a/cmake/dependencies/Oracle.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(ORACLE_FIND_QUIETLY TRUE) - -find_package(Oracle) - -boost_external_report(Oracle INCLUDE_DIR LIBRARIES) diff --git a/cmake/dependencies/PostgreSQL.cmake b/cmake/dependencies/PostgreSQL.cmake deleted file mode 100644 index 4a4feeec..00000000 --- a/cmake/dependencies/PostgreSQL.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(PostgreSQL_FIND_QUIETLY TRUE) - -find_package(PostgreSQL) - -boost_external_report(PostgreSQL INCLUDE_DIR LIBRARIES VERSION) \ No newline at end of file diff --git a/cmake/dependencies/SQLite3.cmake b/cmake/dependencies/SQLite3.cmake deleted file mode 100644 index 0daa9a59..00000000 --- a/cmake/dependencies/SQLite3.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(SQLITE3_FIND_QUIETLY TRUE) - -find_package(SQLite3) - -boost_external_report(SQLite3 INCLUDE_DIR LIBRARIES) diff --git a/cmake/dependencies/Threads.cmake b/cmake/dependencies/Threads.cmake deleted file mode 100644 index 953bb975..00000000 --- a/cmake/dependencies/Threads.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(Threads_FIND_QUIETLY TRUE) - -find_package(Threads) -message(STATUS "X: ${Threads_FOUND}") -boost_external_report(Threads LIBRARIES) diff --git a/cmake/modules/FindDL.cmake b/cmake/modules/FindDL.cmake deleted file mode 100644 index 3f7f889f..00000000 --- a/cmake/modules/FindDL.cmake +++ /dev/null @@ -1,21 +0,0 @@ -if(DL_INCLUDE_DIR) - set(DL_FIND_QUIETLY TRUE) -endif() - -find_path(DL_INCLUDE_DIR dlfcn.h) -find_library(DL_LIBRARY NAMES dl) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(DL DEFAULT_MSG DL_LIBRARY DL_INCLUDE_DIR) - -if(NOT DL_FOUND) - # if dlopen can be found without linking in dl then, - # dlopen is part of libc, so don't need to link extra libs. - include(CheckFunctionExists) - check_function_exists(dlopen DL_FOUND) - set(DL_LIBRARY "") -endif() - -set(DL_LIBRARIES ${DL_LIBRARY}) - -mark_as_advanced(DL_LIBRARY DL_INCLUDE_DIR) diff --git a/cmake/modules/FindMySQL.cmake b/cmake/modules/FindMySQL.cmake deleted file mode 100644 index 375fe1c1..00000000 --- a/cmake/modules/FindMySQL.cmake +++ /dev/null @@ -1,103 +0,0 @@ -# TODO: Change to use mysqlconfig -# TODO: Check library version - -find_path(MYSQL_INCLUDE_DIR mysql.h - $ENV{MYSQL_INCLUDE_DIR} - $ENV{MYSQL_DIR}/include - /usr/include/mysql - /usr/local/include/mysql - /opt/mysql/mysql/include - /opt/mysql/mysql/include/mysql - /usr/local/mysql/include - /usr/local/mysql/include/mysql - $ENV{ProgramFiles}/MySQL/*/include - $ENV{SystemDrive}/MySQL/*/include) - -if(WIN32) - # Set lib path suffixes - # dist = for mysql binary distributions - # build = for custom built tree - if(CMAKE_BUILD_TYPE STREQUAL Debug) - set(libsuffixDist debug) - set(libsuffixBuild Debug) - else() - set(libsuffixDist opt) - set(libsuffixBuild Release) - add_definitions(-DDBUG_OFF) - endif() - - # On Windows, link against dynamic library libmysql, not static mysqlclient - find_library(MYSQL_LIBRARY NAMES libmysql - PATHS - $ENV{MYSQL_DIR}/lib/${libsuffixDist} - $ENV{MYSQL_DIR}/libmysql - $ENV{MYSQL_DIR}/libmysql/${libsuffixBuild} - $ENV{MYSQL_DIR}/client/${libsuffixBuild} - $ENV{MYSQL_DIR}/libmysql/${libsuffixBuild} - $ENV{ProgramFiles}/MySQL/*/lib/${libsuffixDist} - $ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist}) - -else() - - find_library(MYSQL_LIBRARY NAMES mysqlclient_r - PATHS - $ENV{MYSQL_DIR}/libmysql_r/.libs - $ENV{MYSQL_DIR}/lib - $ENV{MYSQL_DIR}/lib/mysql - /usr/lib/mysql - /usr/local/lib/mysql - /usr/local/mysql/lib - /usr/local/mysql/lib/mysql - /opt/mysql/mysql/lib - /opt/mysql/mysql/lib/mysql) -endif() - -if(MYSQL_LIBRARY) - get_filename_component(MYSQL_LIBRARY_DIR ${MYSQL_LIBRARY} PATH) -endif() - -if(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARY_DIR) - set(MYSQL_FOUND TRUE) - - include_directories(${MYSQL_INCLUDE_DIR}) - link_directories(${MYSQL_LIBRARY_DIR}) - - find_library(MYSQL_ZLIB zlib PATHS ${MYSQL_LIBRARY_DIR}) - find_library(MYSQL_YASSL yassl PATHS ${MYSQL_LIBRARY_DIR}) - find_library(MYSQL_TAOCRYPT taocrypt PATHS ${MYSQL_LIBRARY_DIR}) - - if(WIN32) - set(MYSQL_CLIENT_LIBS mysqlclient) - else() - set(MYSQL_CLIENT_LIBS libmysql) - endif() - - if(MYSQL_ZLIB) - set(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} zlib) - endif() - - if(MYSQL_YASSL) - set(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} yassl) - endif() - - if(MYSQL_TAOCRYPT) - set(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} taocrypt) - endif() - - # Added needed mysqlclient dependencies on Windows - if(WIN32) - set(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} ws2_32) - endif() -endif() - -set(MYSQL_LIBRARIES ${MYSQL_LIBRARY}) - -# Handle the QUIETLY and REQUIRED arguments and set SQLITE3_FOUND to TRUE -# if all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(MySQL - DEFAULT_MSG - MYSQL_INCLUDE_DIR - MYSQL_LIBRARIES) - -mark_as_advanced(MYSQL_INCLUDE_DIR MYSQL_LIBRARIES) diff --git a/cmake/modules/FindODBC.cmake b/cmake/modules/FindODBC.cmake deleted file mode 100644 index 4adae146..00000000 --- a/cmake/modules/FindODBC.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# -# Find the ODBC driver manager includes and library. -# -# ODBC is an open standard for connecting to different databases in a -# semi-vendor-independent fashion. First you install the ODBC driver -# manager. Then you need a driver for each separate database you want -# to connect to (unless a generic one works). VTK includes neither -# the driver manager nor the vendor-specific drivers: you have to find -# those yourself. -# -# This module defines -# ODBC_INCLUDE_DIRECTORIES, where to find sql.h -# ODBC_LIBRARIES, the libraries to link against to use ODBC -# ODBC_FOUND. If false, you cannot build anything that requires MySQL. - -# also defined, but not for general use is -# ODBC_LIBRARY, where to find the ODBC driver manager library. - -set(ODBC_FOUND FALSE) - -find_path(ODBC_INCLUDE_DIRECTORIES sql.h - /usr/include - /usr/include/odbc - /usr/local/include - /usr/local/include/odbc - /usr/local/odbc/include - "C:/Program Files/ODBC/include" - "C:/ODBC/include" - DOC "Specify the directory containing sql.h." -) - -find_library(ODBC_LIBRARY - NAMES iodbc odbc odbcinst odbc32 - PATHS - /usr/lib - /usr/lib/odbc - /usr/local/lib - /usr/local/lib/odbc - /usr/local/odbc/lib - "C:/Program Files/ODBC/lib" - "C:/ODBC/lib/debug" - "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" - DOC "Specify the ODBC driver manager library here." -) - -if(ODBC_LIBRARY) - if(ODBC_INCLUDE_DIRECTORIES) - set( ODBC_FOUND 1 ) - endif() -endif() - -set(ODBC_LIBRARIES ${ODBC_LIBRARY}) - -mark_as_advanced(ODBC_FOUND ODBC_LIBRARY ODBC_EXTRA_LIBRARIES ODBC_INCLUDE_DIRECTORIES) - diff --git a/cmake/modules/FindOracle.cmake b/cmake/modules/FindOracle.cmake deleted file mode 100644 index db39dc5e..00000000 --- a/cmake/modules/FindOracle.cmake +++ /dev/null @@ -1,76 +0,0 @@ -############################################################################### -# -# CMake module to search for Oracle client library (OCI) -# -# On success, the macro sets the following variables: -# ORACLE_FOUND = if the library found -# ORACLE_LIBRARY = full path to the library -# ORACLE_LIBRARIES = full path to the library -# ORACLE_INCLUDE_DIR = where to find the library headers also defined, -# but not for general use are -# ORACLE_VERSION = version of library which was found, e.g. "1.2.5" -# -# Copyright (c) 2009 Mateusz Loskot -# -# Developed with inspiration from Petr Vanek -# who wrote similar macro for TOra - http://torasql.com/ -# -# Module source: http://github.com/mloskot/workshop/tree/master/cmake/ -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# -############################################################################### - -# If ORACLE_HOME not defined, assume Oracle libraries not available -if(DEFINED ENV{ORACLE_HOME}) - - set(ORACLE_HOME $ENV{ORACLE_HOME}) - - find_path(ORACLE_INCLUDE_DIR - oci.h - PATHS - ${ORACLE_HOME}/rdbms/public - ${ORACLE_HOME}/include - ${ORACLE_HOME}/sdk/include # Oracle SDK - ${ORACLE_HOME}/OCI/include) # Oracle XE on Windows - - set(ORACLE_OCI_NAMES clntsh libclntsh oci) - set(ORACLE_NNZ_NAMES nnz10 libnnz10 nnz11 libnnz11 ociw32) - set(ORACLE_OCCI_NAMES libocci occi oraocci10 oraocci11) - - set(ORACLE_LIB_DIR - ${ORACLE_HOME}/lib - ${ORACLE_HOME}/OCI/lib/MSVC) # Oracle XE on Windows - - find_library(ORACLE_OCI_LIBRARY NAMES ${ORACLE_OCI_NAMES} PATHS ${ORACLE_LIB_DIR}) - find_library(ORACLE_OCCI_LIBRARY NAMES ${ORACLE_OCCI_NAMES} PATHS ${ORACLE_LIB_DIR}) - find_library(ORACLE_NNZ_LIBRARY NAMES ${ORACLE_NNZ_NAMES} PATHS ${ORACLE_LIB_DIR}) - - set(ORACLE_LIBRARY ${ORACLE_OCI_LIBRARY} ${ORACLE_OCCI_LIBRARY} ${ORACLE_NNZ_LIBRARY}) - - if(APPLE) - set(ORACLE_OCIEI_NAMES libociei ociei) - - find_library(ORACLE_OCIEI_LIBRARY - NAMES libociei ociei - PATHS ${ORACLE_LIB_DIR}) - - if(ORACLE_OCIEI_LIBRARY) - set(ORACLE_LIBRARY ${ORACLE_LIBRARY} ${ORACLE_OCIEI_LIBRARY}) - else(ORACLE_OCIEI_LIBRARY) - message(STATUS - "libociei.dylib is not found. It may cause crash if you are building BUNDLE") - endif() - endif() - - set(ORACLE_LIBRARIES ${ORACLE_LIBRARY}) - -endif(DEFINED ENV{ORACLE_HOME}) - -# Handle the QUIETLY and REQUIRED arguments and set ORACLE_FOUND to TRUE -# if all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(ORACLE DEFAULT_MSG ORACLE_LIBRARY ORACLE_INCLUDE_DIR) - -mark_as_advanced(ORACLE_INCLUDE_DIR ORACLE_LIBRARY) diff --git a/cmake/modules/FindPostgreSQL.cmake b/cmake/modules/FindPostgreSQL.cmake deleted file mode 100644 index 407b2de3..00000000 --- a/cmake/modules/FindPostgreSQL.cmake +++ /dev/null @@ -1,77 +0,0 @@ -# - Find PostgreSQL -# Find the PostgreSQL includes and client library -# This module defines -# POSTGRESQL_INCLUDE_DIR, where to find libpq-fe.h -# POSTGRESQL_LIBRARIES, libraries needed to use PostgreSQL -# POSTGRESQL_VERSION, if found, version of PostgreSQL -# POSTGRESQL_FOUND, if false, do not try to use PostgreSQL -# -# Copyright (c) 2010, Mateusz Loskot, -# Copyright (c) 2006, Jaroslaw Staniek, -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -find_program(PG_CONFIG NAMES pg_config DOC "Path to pg_config utility") - -if(PG_CONFIG) - exec_program(${PG_CONFIG} - ARGS "--version" - OUTPUT_VARIABLE PG_CONFIG_VERSION) - - if(${PG_CONFIG_VERSION} MATCHES "^[A-Za-z]+[ ](.*)$") - string(REGEX REPLACE "^[A-Za-z]+[ ](.*)$" "\\1" POSTGRESQL_VERSION "${PG_CONFIG_VERSION}") - endif() - - exec_program(${PG_CONFIG} - ARGS "--includedir" - OUTPUT_VARIABLE PG_CONFIG_INCLUDEDIR) - - exec_program(${PG_CONFIG} - ARGS "--libdir" - OUTPUT_VARIABLE PG_CONFIG_LIBDIR) -else() - set(POSTGRESQL_VERSION "unknown") -endif() - -find_path(POSTGRESQL_INCLUDE_DIR libpq-fe.h - ${PG_CONFIG_INCLUDEDIR} - /usr/include/server - /usr/include/pgsql/server - /usr/local/include/pgsql/server - /usr/include/postgresql - /usr/include/postgresql/server - /usr/include/postgresql/*/server - $ENV{ProgramFiles}/PostgreSQL/*/include - $ENV{SystemDrive}/PostgreSQL/*/include) - -find_library(POSTGRESQL_LIBRARIES NAMES pq libpq - PATHS - ${PG_CONFIG_LIBDIR} - /usr/lib - /usr/local/lib - /usr/lib/postgresql - /usr/lib64 - /usr/local/lib64 - /usr/lib64/postgresql - $ENV{ProgramFiles}/PostgreSQL/*/lib - $ENV{SystemDrive}/PostgreSQL/*/lib - $ENV{ProgramFiles}/PostgreSQL/*/lib/ms - $ENV{SystemDrive}/PostgreSQL/*/lib/ms) - -if(POSTGRESQL_INCLUDE_DIR AND POSTGRESQL_LIBRARIES) - set(POSTGRESQL_FOUND TRUE) -else() - set(POSTGRESQL_FOUND FALSE) -endif() - -# Handle the QUIETLY and REQUIRED arguments and set POSTGRESQL_FOUND to TRUE -# if all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(PostgreSQL - DEFAULT_MSG - POSTGRESQL_INCLUDE_DIR - POSTGRESQL_LIBRARIES - POSTGRESQL_VERSION) - -mark_as_advanced(POSTGRESQL_INCLUDE_DIR POSTGRESQL_LIBRARIES) diff --git a/cmake/modules/FindSQLite3.cmake b/cmake/modules/FindSQLite3.cmake deleted file mode 100644 index 6da796a9..00000000 --- a/cmake/modules/FindSQLite3.cmake +++ /dev/null @@ -1,70 +0,0 @@ -############################################################################### -# CMake module to search for SQLite 3 library -# -# On success, the macro sets the following variables: -# SQLITE3_FOUND = if the library found -# SQLITE3_LIBRARY = full path to the library -# SQLITE3_LIBRARIES = full path to the library -# SSQLITE3_INCLUDE_DIR = where to find the library headers -# -# Copyright (c) 2009 Mateusz Loskot -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# -############################################################################### - -if(WIN32) - # TODO: Make use of OSGeo4W provider optional and available on explicit request - set(OSGEO4W_IMPORT_LIBRARY sqlite3_i) - if(DEFINED ENV{OSGEO4W_ROOT}) - set(OSGEO4W_ROOT_DIR $ENV{OSGEO4W_ROOT}) - message(STATUS - "Trying OSGeo4W using environment variable OSGEO4W_ROOT=$ENV{OSGEO4W_ROOT}") - else() - set(OSGEO4W_ROOT_DIR c:/OSGeo4W) - message(STATUS - "Trying OSGeo4W using default location OSGEO4W_ROOT=${OSGEO4W_ROOT_DIR}") - endif() -endif() - -find_path(SQLITE3_INCLUDE_DIR - NAMES sqlite3.h - PATH_PREFIXES sqlite sqlite3 - PATHS - /usr/include - /usr/local/include - $ENV{LIB_DIR}/include - $ENV{LIB_DIR}/include/sqlite - $ENV{LIB_DIR}/include/sqlite3 - $ENV{ProgramFiles}/SQLite/*/include - $ENV{ProgramFiles}/SQLite3/*/include - $ENV{SystemDrive}/SQLite/*/include - $ENV{SystemDrive}/SQLite3/*/include - ${OSGEO4W_ROOT_DIR}/include) - -set(SQLITE3_NAMES ${OSGEO4W_IMPORT_LIBRARY} sqlite3) -find_library(SQLITE3_LIBRARY - NAMES ${SQLITE3_NAMES} - PATHS - /usr/lib - /usr/local/lib - $ENV{LIB_DIR}/lib - $ENV{ProgramFiles}/SQLite/*/lib - $ENV{ProgramFiles}/SQLite3/*/lib - $ENV{SystemDrive}/SQLite/*/lib - $ENV{SystemDrive}/SQLite3/*/lib - ${OSGEO4W_ROOT_DIR}/lib) - -set(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY}) - -#message(STATUS ${SQLITE3_LIBRARY}) -# Handle the QUIETLY and REQUIRED arguments and set SQLITE3_FOUND to TRUE -# if all listed variables are TRUE -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SQLITE3 - DEFAULT_MSG - SQLITE3_LIBRARY - SQLITE3_INCLUDE_DIR) - -mark_as_advanced(SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR SQLITE3_LIBRARY) diff --git a/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in b/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in deleted file mode 100644 index f41ec9b2..00000000 --- a/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in +++ /dev/null @@ -1,7 +0,0 @@ - - - - @SOCI_TEST_CMD_ARGS@ - WindowsLocalDebugger - - From 359711adc51d6940db8bae7c892e320055f29098 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 26 Dec 2010 15:28:15 +0100 Subject: [PATCH 07/19] [Branch src_buried_headers] Simplified the handling of error.h header inclusion for Oracle back-end. --- backends/oracle/standard-into-type.cpp | 3 +-- backends/oracle/standard-use-type.cpp | 3 +-- backends/oracle/statement.cpp | 5 ++--- backends/oracle/vector-into-type.cpp | 5 ++--- backends/oracle/vector-use-type.cpp | 5 ++--- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/backends/oracle/standard-into-type.cpp b/backends/oracle/standard-into-type.cpp index 67d1ec23..f2bbdcdb 100644 --- a/backends/oracle/standard-into-type.cpp +++ b/backends/oracle/standard-into-type.cpp @@ -6,20 +6,19 @@ // #define SOCI_ORACLE_SOURCE +#include "error.h" // #if defined(SOCI_HEADERS_BURIED) # include # include # include # include -# include # include #else # include # include # include # include -# include "error.h" # include #endif // diff --git a/backends/oracle/standard-use-type.cpp b/backends/oracle/standard-use-type.cpp index bc05963f..d490def6 100644 --- a/backends/oracle/standard-use-type.cpp +++ b/backends/oracle/standard-use-type.cpp @@ -6,20 +6,19 @@ // #define SOCI_ORACLE_SOURCE +#include "error.h" // #if defined(SOCI_HEADERS_BURIED) # include # include # include # include -# include # include #else # include # include # include # include -# include "error.h" # include #endif // diff --git a/backends/oracle/statement.cpp b/backends/oracle/statement.cpp index 9c377c4b..570f3fa0 100644 --- a/backends/oracle/statement.cpp +++ b/backends/oracle/statement.cpp @@ -5,15 +5,14 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#define soci_ORACLE_SOURCE +#define SOCI_ORACLE_SOURCE +#include "error.h" // #if defined(SOCI_HEADERS_BURIED) # include -# include # include #else # include -# include # include #endif // diff --git a/backends/oracle/vector-into-type.cpp b/backends/oracle/vector-into-type.cpp index 8ac34a6d..194ac764 100644 --- a/backends/oracle/vector-into-type.cpp +++ b/backends/oracle/vector-into-type.cpp @@ -5,17 +5,16 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#define soci_ORACLE_SOURCE +#define SOCI_ORACLE_SOURCE +#include "error.h" // #if defined(SOCI_HEADERS_BURIED) # include # include -# include # include #else # include # include -# include "error.h" # include #endif // diff --git a/backends/oracle/vector-use-type.cpp b/backends/oracle/vector-use-type.cpp index d46f8435..80c226eb 100644 --- a/backends/oracle/vector-use-type.cpp +++ b/backends/oracle/vector-use-type.cpp @@ -5,15 +5,14 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#define soci_ORACLE_SOURCE +#define SOCI_ORACLE_SOURCE +#include "error.h" // #if defined(SOCI_HEADERS_BURIED) # include -# include # include #else # include -# include # include #endif // From a57686c2d192f8cee51ee91aa953cbfcc934f1fb Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 26 Dec 2010 16:19:55 +0100 Subject: [PATCH 08/19] [Git] Added a .gitignore file for the src sub-directory. --- cmake/.gitignore | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 cmake/.gitignore diff --git a/cmake/.gitignore b/cmake/.gitignore new file mode 100644 index 00000000..61caff87 --- /dev/null +++ b/cmake/.gitignore @@ -0,0 +1,21 @@ +*~ +*.kdev[0-9] +*.swp +aclocal.m4 +autom4te.cache +confdefs.h +config.guess +config.log +config.status +config.sub +configure +depcomp +install-sh +libtool +ltmain.sh +m4 +missing +Makefile +Makefile.in +tmp + From 28b45cce067bda992ca78dd411e3385d7cdf27ca Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 26 Dec 2010 16:20:57 +0100 Subject: [PATCH 09/19] [Branch src] Back to the master version of the src/README file. --- README | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/README b/README index bba174f2..3666448e 100644 --- a/README +++ b/README @@ -1,18 +1,35 @@ -SOCI - The C++ Database Access Library --------------------------------------- +SOCI - The C++ Database Access Library. -Project website: +Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton, + David Courtney, Pawel Aleksander Fedorynski, + Rafal Bobrowski, Mateusz Loskot -http://soci.sourceforge.net +The homepage of the SOCI library is: +http://soci.sourceforge.net/ +--- -Development, Download, Bug Tracking, Mailing Lists: +You should see the following files and directories here: -http://sourceforge.net/projects/soci/ +- README - This file. +- LICENSE_1_0.txt - Full text of the Boost license. +- CHANGES - The description of changes. -Git repository of SOCI project ------------------------------- -/src - project source code tree -/doc - project documentation -/www - project website -/build - legacy build configurations (to be removed) +- contrib - Acknowledgements for contributions. + +- doc/ - Documentation. + +- build/ - Additional build scripts and configuration files + for various compilation systems. + +- src/ - The source code of the library. + +- src/core/ - The main part of the SOCI library. + +- src/backends/ - Directory containing implementations and tests for + all available backends. + + +Please see the doc/structure.html file for compilation instructions. + +--- From 79a6f6da9f67ec97833d06677e1d92dbcd78bd97 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 26 Dec 2010 22:13:43 +0100 Subject: [PATCH 10/19] [Branch buried_headers] Added some missing include directives in the CMake-related files. --- core/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 7c58ee8d..1d52bc7c 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -85,6 +85,9 @@ else() CLEAN_DIRECT_OUTPUT 1) endif() +# TODO: find a better way to add that include directory +include_directories(${SOCI_SOURCE_DIR}) + # # Core static library # From d38b5cc80a77fabfe92f677d01469ae92af1bda1 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Fri, 14 Jan 2011 23:11:10 +0100 Subject: [PATCH 11/19] [Branch src] Integrated latest changes from master (e.g., addition of test8 in test-mysql.cpp). --- backends/mysql/test/test-mysql.cpp | 43 +++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/backends/mysql/test/test-mysql.cpp b/backends/mysql/test/test-mysql.cpp index abccd012..bb05cf0c 100644 --- a/backends/mysql/test/test-mysql.cpp +++ b/backends/mysql/test/test-mysql.cpp @@ -419,9 +419,9 @@ void test6() // test for number of affected rows -struct table_creator_for_test7 : table_creator_base +struct integer_value_table_creator : table_creator_base { - table_creator_for_test7(session & sql) + integer_value_table_creator(session & sql) : table_creator_base(sql) { sql << "create table soci_test(val integer)"; @@ -433,7 +433,7 @@ void test7() { session sql(backEnd, connectString); - table_creator_for_test7 tableCreator(sql); + integer_value_table_creator tableCreator(sql); for (int i = 0; i != 10; i++) { @@ -457,6 +457,42 @@ void test7() } +// The prepared statements should survive session::reconnect(). +void test8() +{ + { + session sql(backEnd, connectString); + + integer_value_table_creator tableCreator(sql); + + int i; + statement st = (sql.prepare + << "insert into soci_test(val) values(:val)", use(i)); + i = 5; + st.execute(true); + + sql.reconnect(); + + i = 6; + st.execute(true); + + sql.close(); + sql.reconnect(); + + i = 7; + st.execute(true); + + std::vector v(5); + sql << "select val from soci_test order by val", into(v); + assert(v.size() == 3); + assert(v[0] == 5); + assert(v[1] == 6); + assert(v[2] == 7); + } + + std::cout << "test 8 passed" << std::endl; +} + // DDL Creation objects for common tests struct table_creator_one : public table_creator_base { @@ -566,6 +602,7 @@ int main(int argc, char** argv) test5(); test6(); test7(); + test8(); std::cout << "\nOK, all tests passed.\n\n"; return EXIT_SUCCESS; From 2b4beaa0d4220a7add5ca0bb11d70952baf7e255 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Fri, 14 Jan 2011 23:12:11 +0100 Subject: [PATCH 12/19] [Branch src_buried_headers] Integrated latest changes from master (e.g., addition of test8 in test-mysql.cpp). --- backends/mysql/test/test-mysql.cpp | 43 +++++++++++++++++++++++++++--- cmake/.gitignore | 21 +++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 cmake/.gitignore diff --git a/backends/mysql/test/test-mysql.cpp b/backends/mysql/test/test-mysql.cpp index 3374569f..8cd4ae04 100644 --- a/backends/mysql/test/test-mysql.cpp +++ b/backends/mysql/test/test-mysql.cpp @@ -434,9 +434,9 @@ void test6() // test for number of affected rows -struct table_creator_for_test7 : table_creator_base +struct integer_value_table_creator : table_creator_base { - table_creator_for_test7(session & sql) + integer_value_table_creator(session & sql) : table_creator_base(sql) { sql << "create table soci_test(val integer)"; @@ -448,7 +448,7 @@ void test7() { session sql(backEnd, connectString); - table_creator_for_test7 tableCreator(sql); + integer_value_table_creator tableCreator(sql); for (int i = 0; i != 10; i++) { @@ -472,6 +472,42 @@ void test7() } +// The prepared statements should survive session::reconnect(). +void test8() +{ + { + session sql(backEnd, connectString); + + integer_value_table_creator tableCreator(sql); + + int i; + statement st = (sql.prepare + << "insert into soci_test(val) values(:val)", use(i)); + i = 5; + st.execute(true); + + sql.reconnect(); + + i = 6; + st.execute(true); + + sql.close(); + sql.reconnect(); + + i = 7; + st.execute(true); + + std::vector v(5); + sql << "select val from soci_test order by val", into(v); + assert(v.size() == 3); + assert(v[0] == 5); + assert(v[1] == 6); + assert(v[2] == 7); + } + + std::cout << "test 8 passed" << std::endl; +} + // DDL Creation objects for common tests struct table_creator_one : public table_creator_base { @@ -581,6 +617,7 @@ int main(int argc, char** argv) test5(); test6(); test7(); + test8(); std::cout << "\nOK, all tests passed.\n\n"; return EXIT_SUCCESS; diff --git a/cmake/.gitignore b/cmake/.gitignore new file mode 100644 index 00000000..61caff87 --- /dev/null +++ b/cmake/.gitignore @@ -0,0 +1,21 @@ +*~ +*.kdev[0-9] +*.swp +aclocal.m4 +autom4te.cache +confdefs.h +config.guess +config.log +config.status +config.sub +configure +depcomp +install-sh +libtool +ltmain.sh +m4 +missing +Makefile +Makefile.in +tmp + From 62f8824409fa36d15cc8b4479bb4c4777b7cf8a9 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Fri, 14 Jan 2011 23:22:23 +0100 Subject: [PATCH 13/19] [Branch src_buried_headers] Just added an end-of-line at the end of test-mysql.cpp. --- backends/mysql/test/test-mysql.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/backends/mysql/test/test-mysql.cpp b/backends/mysql/test/test-mysql.cpp index 8cd4ae04..1fa76460 100644 --- a/backends/mysql/test/test-mysql.cpp +++ b/backends/mysql/test/test-mysql.cpp @@ -629,3 +629,4 @@ int main(int argc, char** argv) return EXIT_FAILURE; } + From 6bbdc28d4e7d9f49d0b4d05bb9c00d5d803da9fd Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Tue, 8 Feb 2011 18:22:07 +0100 Subject: [PATCH 14/19] [Branch src][Build] Integrated latest work on CMakeLists.txt from the trunk/master. --- CMakeLists.txt | 2 +- core/CMakeLists.txt | 10 ++++++++++ core/backend-loader.cpp | 11 ++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02076206..7598a21a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ include(SociDependencies) # Installation ################################################################################# -if(UNIX AND CMAKE_SIZEOF_VOID_P EQUAL 4) +if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4) set(SOCI_LIBDIR "lib") else() set(SOCI_LIBDIR "lib64") diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 7c58ee8d..f268ec17 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -15,6 +15,14 @@ message(STATUS "") # Core dependencies set(SOCI_CORE_DEPENDENCIES) +include(FindThreads) + +if(Threads_FOUND OR CMAKE_USE_WIN32_THREADS_INIT OR CMAKE_THREAD_LIBS_INIT) + list(APPEND SOCI_CORE_DEPENDENCIES ${CMAKE_THREAD_LIBS_INIT}) +else() + message(FATAL_ERROR "No thread library found") +endif() + if(NOT MSVC) set(DL_FIND_QUIETLY TRUE) find_package(DL) @@ -84,6 +92,8 @@ else() SOVERSION ${SOCI_SOVERSION} CLEAN_DIRECT_OUTPUT 1) endif() +add_definitions(-DSOCI_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}soci_" + -DSOCI_LIB_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}") # # Core static library diff --git a/core/backend-loader.cpp b/core/backend-loader.cpp index 362b57a9..286bf8ce 100644 --- a/core/backend-loader.cpp +++ b/core/backend-loader.cpp @@ -23,9 +23,6 @@ using namespace soci; using namespace soci::dynamic_backends; -#define _STRINGIFY(s) #s -#define STRINGIFY(s) _STRINGIFY(s) - #ifdef _WIN32 #include @@ -44,7 +41,7 @@ typedef HMODULE soci_handler_t; #endif #define DLCLOSE(x) FreeLibrary(x) #define DLSYM(x, y) GetProcAddress(x, y) -#define LIBNAME(x) ("libsoci_" + x + "_" STRINGIFY(SOCI_ABI_VERSION) ".dll") +#define LIBNAME(x) (SOCI_LIB_PREFIX + x + "_" SOCI_ABI_VERSION SOCI_LIB_SUFFIX) #else @@ -61,7 +58,11 @@ typedef void * soci_handler_t; #define DLOPEN(x) dlopen(x, RTLD_LAZY) #define DLCLOSE(x) dlclose(x) #define DLSYM(x, y) dlsym(x, y) -#define LIBNAME(x) ("libsoci_" + x + ".so." STRINGIFY(SOCI_ABI_VERSION)) +#ifdef __APPLE__ +#define LIBNAME(x) (SOCI_LIB_PREFIX + x + "." SOCI_ABI_VERSION SOCI_LIB_SUFFIX) +#else +#define LIBNAME(x) (SOCI_LIB_PREFIX + x + SOCI_LIB_SUFFIX "." SOCI_ABI_VERSION) +#endif #endif // _WIN32 From 8803969cfd9a2d389c65c736c3de4b8fa01d373f Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 3 Jul 2011 17:30:05 +0200 Subject: [PATCH 15/19] [Build] Integrated latest changes (=> ~3.1.0 version). --- CHANGES | 65 + CMakeLists.txt | 2 +- TODO | 2 - autogen.sh | 69 - backends/mysql/common.cpp | 8 +- backends/mysql/common.h | 10 +- backends/mysql/soci-mysql.h | 17 +- backends/mysql/standard-into-type.cpp | 13 +- backends/mysql/standard-use-type.cpp | 11 +- backends/mysql/test/test-mysql.cpp | 25 +- backends/mysql/vector-into-type.cpp | 11 +- backends/mysql/vector-use-type.cpp | 10 +- backends/odbc/standard-use-type.cpp | 4 +- backends/odbc/vector-into-type.cpp | 6 + backends/odbc/vector-use-type.cpp | 4 + backends/oracle/blob.cpp | 11 +- backends/oracle/soci-oracle.h | 8 +- backends/oracle/standard-into-type.cpp | 32 +- backends/oracle/standard-use-type.cpp | 42 +- backends/oracle/statement.cpp | 15 +- backends/oracle/test/test-oracle.cpp | 16 +- backends/oracle/vector-into-type.cpp | 64 +- backends/oracle/vector-use-type.cpp | 54 +- backends/postgresql/Makefile.basic | 49 +- backends/postgresql/common.cpp | 8 +- backends/postgresql/error.cpp | 48 + backends/postgresql/error.h | 32 + backends/postgresql/session.cpp | 4 +- backends/postgresql/soci-postgresql.h | 20 +- backends/postgresql/standard-into-type.cpp | 14 +- backends/postgresql/standard-use-type.cpp | 17 +- backends/postgresql/statement.cpp | 21 +- backends/postgresql/test/test-postgresql.cpp | 14 +- cmake/SociVersion.cmake | 59 + cmake/modules/FindODBC.cmake | 57 + cmake/modules/FindSoci.cmake | 100 ++ core/Makefile.basic | 7 +- core/backend-loader.cpp | 15 +- core/test/common-tests.h | 34 +- core/version.h | 32 + languages/ada/postgresql_client.gpr | 8 + languages/ada/soci-mysql.ads | 16 + languages/ada/soci-oracle.ads | 16 + languages/ada/soci-postgresql.ads | 16 + languages/ada/soci.adb | 1465 ++++++++++++++++++ languages/ada/soci.ads | 486 ++++++ languages/ada/soci_ada.gpr | 14 + languages/ada/soci_core.gpr | 7 + languages/ada/soci_postgresql.gpr | 8 + languages/ada/std_cpp.gpr | 7 + languages/ada/test/postgresql_test.adb | 609 ++++++++ languages/ada/test/postgresql_test.gpr | 12 + 52 files changed, 3522 insertions(+), 172 deletions(-) delete mode 100755 autogen.sh create mode 100644 backends/postgresql/error.cpp create mode 100644 backends/postgresql/error.h create mode 100644 cmake/SociVersion.cmake create mode 100644 cmake/modules/FindODBC.cmake create mode 100644 cmake/modules/FindSoci.cmake create mode 100644 core/version.h create mode 100644 languages/ada/postgresql_client.gpr create mode 100644 languages/ada/soci-mysql.ads create mode 100644 languages/ada/soci-oracle.ads create mode 100644 languages/ada/soci-postgresql.ads create mode 100644 languages/ada/soci.adb create mode 100644 languages/ada/soci.ads create mode 100644 languages/ada/soci_ada.gpr create mode 100644 languages/ada/soci_core.gpr create mode 100644 languages/ada/soci_postgresql.gpr create mode 100644 languages/ada/std_cpp.gpr create mode 100644 languages/ada/test/postgresql_test.adb create mode 100644 languages/ada/test/postgresql_test.gpr diff --git a/CHANGES b/CHANGES index a4bb1d84..901fc822 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,70 @@ This file contains the history of changes in the SOCI library. +--- +Version 3.1.0 differs from 3.0.0 in the following ways: + + TODO - to be reviewed + +- Added Ada language binding + +- Migraded build system from GNU Autotools and Visual Studio projects to CMake + +- CMake build tested with Visual Studio, GCC and clang + +- Incorporated a compromise for naming versioned shared libraries + +- Enhanced and improved integration with Boost libraries: +-- Boost.DateTime +-- Boost.Fusion +-- Boost.Optional +-- Boost.Tuple + +- Bug fixes and improvements in core and backends: +-- Added soci::values::get_properties accessor useful for composing soci::type_conversion +-- Export advanced API of backend loader from DLL. +-- Added static factory registration functions for backends +-- Added get_affected_rows operation +-- Fixed thread-safety of connection pool under Windows +-- Fixed bug with droping const qualifiers when binding to std::vector +-- Fixed bug in default initialization of an object of const backend_factory wihch requires user-provided default constructor (see C++03/C++0x) +-- Fixes for 64-bit builds +-- Removed redundant exchange_traits breaking ODR on LP64 +-- Better ODBC support +-- Type conversion support for unsigned integer types +-- Bug ID:1971436 - incorrect rowset copy operations +-- Bug ID:2010367 - memory leak (ODBC) +-- Bug ID:2010409 - invalid memory allocaton in define by position (ODBC) +-- Bug ID:2021243 - long long type support in Visual C++ +-- Patch ID:2483066 - 64bit Linux and 64bit integer submitted +-- Patch ID:2809809 - Fix build with GCC 4.4 +-- Patch ID:2809810 - Fix SQLite3 build with GCC 4.3 +-- Patch ID:2581206 - Windows unicode application +-- Patch ID:3058275 - install target for cmake build submitted +-- Patch ID:3069375 - use $(prefix)/lib64 on AMD64 platforms. +-- Improved performance while accessing query results (MySQL) +-- Bug fixes for PROCEDURE support (MySQL) +-- Removed throw statements from mysql_rowid_backend and mysql_blob_backend destructors (MySQL) +-- Verify that prepared statements survive session::reconnect() operatoin (MySQL) +-- Improved support for time and date (MySQL, PostgreSQL) +-- Fixed bug with strings of length exceeding 255 characters (ODBC) +-- Improved interpretation of the connect string (Oracle) +-- Added handling of unsigned long long (Oracle, SQLite3, PostgreSQL) +-- Fixes in integral types support (PostgreSQL) +-- Support for colon-casts (PostgreSQL) +-- Added possibility for use BLOB (PostgreSQL) +-- Added support for connection property "synchronous=on|off" (SQLite3) +-- Improved BLOB data handling (SQLite3) +-- Improved boolean type suppport (SQLite3) +-- Session timeout support (SQLite3) +-- Improved tests clean-up (SQLite3) +-- Added missing typedef of sqlite3_destructor_type which has been defined in sqlite3.h but since 3.3.10 (see comment for reference to SQLite ticket) + +- Updated tests for various backends and SQL data types + +- Migrated from CVS to Git repository + +- Changed naming convensions and style across all the source code + --- Version 3.0.0 differs from 2.2.0 in the following ways: diff --git a/CMakeLists.txt b/CMakeLists.txt index 7598a21a..0473ee58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ project(SOCI) ################################################################################# # Path to additional CMake modules -set(CMAKE_MODULE_PATH ${SOCI_SOURCE_DIR}/cmake${CMAKE_MODULE_PATH}) +set(CMAKE_MODULE_PATH ${SOCI_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) set(CMAKE_MODULE_PATH ${SOCI_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) include(SociUtilities) diff --git a/TODO b/TODO index 31cf44b6..e69de29b 100644 --- a/TODO +++ b/TODO @@ -1,2 +0,0 @@ -1. [PostgreSQL] statement.cpp:197, re-declare vector of input parameters should -with const char* elements instead of non-const. diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index db532084..00000000 --- a/autogen.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: autogen.sh,v 1.3 2008/05/28 20:05:17 mloskot Exp $ -# -# Run this to generate all the initial makefiles, etc. -# This was lifted from the Gimp, and adapted slightly -# by Raph Levien -# -# Customized for C++/Tk by Mateusz Loskot -# -DIE=0 - -PROJECT="SOCI" - -for libtoolize in glibtoolize libtoolize; do - LIBTOOLIZE=`which $libtoolize 2>/dev/null` - if test -x "$LIBTOOLIZE"; then - break; - fi -done - -if test -d "autom4te.cache"; then - rm -rf autom4te.cache -fi - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have autoconf installed to compile $PROJECT." - echo "Get latest version from ftp://ftp.gnu.org/pub/gnu/autoconf/" - DIE=1 -} - -($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have libtool installed to compile $PROJECT." - echo "Get latest version from ftp://ftp.gnu.org/pub/gnu/libtool/" - DIE=1 -} - -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have automake installed to compile $PROJECT." - echo "Get latest version from ftp://ftp.gnu.org/pub/gnu/automake/" - DIE=1 -} - -(aclocal --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have aclocal installed to compile $PROJECT." - echo "aclocal is installed together with automake, so" - echo "get latest version from ftp://ftp.gnu.org/pub/gnu/automake/" - DIE=1 -} -if test "$DIE" -eq 1; then - exit 1 -fi - -echo "Running aclocal..." -aclocal -I ../build/m4 -echo "Running libtoolize..." -$LIBTOOLIZE --force --copy -echo "Running automake..." -automake --add-missing --copy -echo "Running autoconf..." -autoconf - -echo -echo "Now type './configure' to generate Makefile files for $PROJECT." -echo "Run './configure --help' to get list of possible options." - diff --git a/backends/mysql/common.cpp b/backends/mysql/common.cpp index 8721f31f..796ac1c2 100644 --- a/backends/mysql/common.cpp +++ b/backends/mysql/common.cpp @@ -6,7 +6,13 @@ // #include "common.h" -#include "soci-backend.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// #include #include #include diff --git a/backends/mysql/common.h b/backends/mysql/common.h index 8f149793..7584261e 100644 --- a/backends/mysql/common.h +++ b/backends/mysql/common.h @@ -8,7 +8,15 @@ #ifndef SOCI_MYSQL_COMMON_H_INCLUDED #define SOCI_MYSQL_COMMON_H_INCLUDED -#include "soci-mysql.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// // std #include #include diff --git a/backends/mysql/soci-mysql.h b/backends/mysql/soci-mysql.h index aa79896a..f41b98c5 100644 --- a/backends/mysql/soci-mysql.h +++ b/backends/mysql/soci-mysql.h @@ -23,12 +23,23 @@ #ifndef SOCI_MYSQL_DECL # define SOCI_MYSQL_DECL #endif - -#include "soci-backend.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// #ifdef _WIN32 #include // SOCKET #endif // _WIN32 -#include // MySQL Client +// +// MySQL Client +#if defined(SOCI_MYSQL_HEADERS_BURIED) +# include +#else +# include +#endif #include diff --git a/backends/mysql/standard-into-type.cpp b/backends/mysql/standard-into-type.cpp index c74b16f9..cad4aa51 100644 --- a/backends/mysql/standard-into-type.cpp +++ b/backends/mysql/standard-into-type.cpp @@ -7,12 +7,19 @@ // #define SOCI_MYSQL_SOURCE -#include "soci-mysql.h" -#include #include "common.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// // std -#include #include +#include #include #include #include diff --git a/backends/mysql/standard-use-type.cpp b/backends/mysql/standard-use-type.cpp index 550ae61b..75cfced7 100644 --- a/backends/mysql/standard-use-type.cpp +++ b/backends/mysql/standard-use-type.cpp @@ -7,9 +7,16 @@ // #define SOCI_MYSQL_SOURCE -#include "soci-mysql.h" #include "common.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// // std #include #include diff --git a/backends/mysql/test/test-mysql.cpp b/backends/mysql/test/test-mysql.cpp index bb05cf0c..8cd4ae04 100644 --- a/backends/mysql/test/test-mysql.cpp +++ b/backends/mysql/test/test-mysql.cpp @@ -6,9 +6,17 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include "soci.h" -#include "soci-mysql.h" -#include "test/common-tests.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include #include #include @@ -18,8 +26,15 @@ #include #include #include -#include -#include +// +// MySQL Client +#if defined(SOCI_MYSQL_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif using namespace soci; using namespace soci::tests; diff --git a/backends/mysql/vector-into-type.cpp b/backends/mysql/vector-into-type.cpp index 12487ceb..597900ea 100644 --- a/backends/mysql/vector-into-type.cpp +++ b/backends/mysql/vector-into-type.cpp @@ -7,9 +7,16 @@ // #define SOCI_MYSQL_SOURCE -#include "soci-mysql.h" #include "common.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// #include #include diff --git a/backends/mysql/vector-use-type.cpp b/backends/mysql/vector-use-type.cpp index 6a217651..506aae22 100644 --- a/backends/mysql/vector-use-type.cpp +++ b/backends/mysql/vector-use-type.cpp @@ -7,9 +7,15 @@ // #define SOCI_MYSQL_SOURCE -#include "soci-mysql.h" #include "common.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif // std #include #include diff --git a/backends/odbc/standard-use-type.cpp b/backends/odbc/standard-use-type.cpp index 1edc025f..8c572ce1 100644 --- a/backends/odbc/standard-use-type.cpp +++ b/backends/odbc/standard-use-type.cpp @@ -97,7 +97,9 @@ void odbc_standard_use_type_backend::prepare_for_bind( case x_statement: case x_rowid: break; - } + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported + } } void odbc_standard_use_type_backend::bind_helper(int &position, void *data, exchange_type type) diff --git a/backends/odbc/vector-into-type.cpp b/backends/odbc/vector-into-type.cpp index cd49591e..c43dbc5c 100644 --- a/backends/odbc/vector-into-type.cpp +++ b/backends/odbc/vector-into-type.cpp @@ -136,6 +136,8 @@ void odbc_vector_into_type_backend::define_by_pos( case x_statement: break; // not supported case x_rowid: break; // not supported case x_blob: break; // not supported + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported } SQLRETURN rc = SQLBindCol(statement_.hstmt_, static_cast(position++), @@ -312,6 +314,8 @@ void odbc_vector_into_type_backend::resize(std::size_t sz) case x_statement: break; // not supported case x_rowid: break; // not supported case x_blob: break; // not supported + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported } } @@ -371,6 +375,8 @@ std::size_t odbc_vector_into_type_backend::size() case x_statement: break; // not supported case x_rowid: break; // not supported case x_blob: break; // not supported + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported } return sz; diff --git a/backends/odbc/vector-use-type.cpp b/backends/odbc/vector-use-type.cpp index 32e142e1..ebefd1c4 100644 --- a/backends/odbc/vector-use-type.cpp +++ b/backends/odbc/vector-use-type.cpp @@ -165,6 +165,8 @@ void odbc_vector_use_type_backend::prepare_for_bind(void *&data, SQLUINTEGER &si case x_statement: break; // not supported case x_rowid: break; // not supported case x_blob: break; // not supported + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported } colSize_ = size; @@ -365,6 +367,8 @@ std::size_t odbc_vector_use_type_backend::size() case x_statement: break; // not supported case x_rowid: break; // not supported case x_blob: break; // not supported + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported } return sz; diff --git a/backends/oracle/blob.cpp b/backends/oracle/blob.cpp index 2636e665..87362b00 100644 --- a/backends/oracle/blob.cpp +++ b/backends/oracle/blob.cpp @@ -5,9 +5,16 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include "soci-oracle.h" #include "error.h" -#include "statement.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// #include #include #include diff --git a/backends/oracle/soci-oracle.h b/backends/oracle/soci-oracle.h index 32d448a9..b44b71ac 100644 --- a/backends/oracle/soci-oracle.h +++ b/backends/oracle/soci-oracle.h @@ -23,7 +23,13 @@ # define SOCI_ORACLE_DECL #endif -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// #include // OCI #include diff --git a/backends/oracle/standard-into-type.cpp b/backends/oracle/standard-into-type.cpp index 1c09b156..6c0bd1a7 100644 --- a/backends/oracle/standard-into-type.cpp +++ b/backends/oracle/standard-into-type.cpp @@ -6,12 +6,23 @@ // #define SOCI_ORACLE_SOURCE -#include "soci-oracle.h" -#include "blob.h" -#include "error.h" -#include "rowid.h" -#include "statement.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +# include +# include +# include +#else +# include +# include +# include +# include +# include +# include +#endif +// #include #include #include @@ -86,6 +97,7 @@ void oracle_standard_into_type_backend::define_by_pos( // cases that require adjustments and buffer management case x_long_long: + case x_unsigned_long_long: oracleType = SQLT_STR; size = 100; // arbitrary buffer length buf_ = new char[size]; @@ -191,6 +203,14 @@ void oracle_standard_into_type_backend::post_fetch( *v = strtoll(buf_, NULL, 10); } } + else if (type_ == x_unsigned_long_long) + { + if (indOCIHolder_ != -1) + { + unsigned long long *v = static_cast(data_); + *v = strtoull(buf_, NULL, 10); + } + } else if (type_ == x_stdtm) { if (indOCIHolder_ != -1) diff --git a/backends/oracle/standard-use-type.cpp b/backends/oracle/standard-use-type.cpp index 711d93c6..07ad61fe 100644 --- a/backends/oracle/standard-use-type.cpp +++ b/backends/oracle/standard-use-type.cpp @@ -6,12 +6,23 @@ // #define soci_ORACLE_SOURCE -#include "soci-oracle.h" -#include "blob.h" -#include "error.h" -#include "rowid.h" -#include "statement.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +# include +# include +# include +#else +# include +# include +# include +# include +# include +# include +#endif +// #include #include #include @@ -84,6 +95,7 @@ void oracle_standard_use_type_backend::prepare_for_bind( // cases that require adjustments and buffer management case x_long_long: + case x_unsigned_long_long: oracleType = SQLT_STR; size = 100; // arbitrary buffer length buf_ = new char[size]; @@ -242,6 +254,12 @@ void oracle_standard_use_type_backend::pre_use(indicator const *ind) snprintf(buf_, size, "%lld", *static_cast(data_)); } break; + case x_unsigned_long_long: + { + size_t const size = 100; // arbitrary, but consistent with prepare_for_bind + snprintf(buf_, size, "%llu", *static_cast(data_)); + } + break; case x_double: if (readOnly_) { @@ -373,6 +391,18 @@ void oracle_standard_use_type_backend::post_use(bool gotData, indicator *ind) } } break; + case x_unsigned_long_long: + if (readOnly_) + { + unsigned long long const original = *static_cast(data_); + unsigned long long const bound = strtoull(buf_, NULL, 10); + + if (original != bound) + { + throw soci_error("Attempted modification of const use element"); + } + } + break; case x_double: if (readOnly_) { diff --git a/backends/oracle/statement.cpp b/backends/oracle/statement.cpp index 5ea75f1e..5f451b9a 100644 --- a/backends/oracle/statement.cpp +++ b/backends/oracle/statement.cpp @@ -6,10 +6,17 @@ // #define soci_ORACLE_SOURCE - -#include "soci-oracle.h" -#include "error.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include #include #include diff --git a/backends/oracle/test/test-oracle.cpp b/backends/oracle/test/test-oracle.cpp index 89ffe11c..e580f519 100644 --- a/backends/oracle/test/test-oracle.cpp +++ b/backends/oracle/test/test-oracle.cpp @@ -5,9 +5,17 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include "soci.h" -#include "soci-oracle.h" -#include "common-tests.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include #include #include @@ -1170,7 +1178,7 @@ int main(int argc, char** argv) std::cout << "\nOK, all tests passed.\n\n"; - return EXIT_SUCCESS + return EXIT_SUCCESS; } catch (std::exception const & e) { diff --git a/backends/oracle/vector-into-type.cpp b/backends/oracle/vector-into-type.cpp index 1b2d491b..d52ccd2d 100644 --- a/backends/oracle/vector-into-type.cpp +++ b/backends/oracle/vector-into-type.cpp @@ -6,10 +6,19 @@ // #define soci_ORACLE_SOURCE -#include "soci-oracle.h" -#include "statement.h" -#include "error.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +# include +#else +# include +# include +# include +# include +#endif +// #include #include #include @@ -120,6 +129,21 @@ void oracle_vector_into_type_backend::define_by_pos( data = buf_; } break; + case x_unsigned_long_long: + { + oracleType = SQLT_STR; + std::vector *v + = static_cast *>(data); + colSize_ = 100; // arbitrary buffer size for each entry + std::size_t const bufSize = colSize_ * v->size(); + buf_ = new char[bufSize]; + + prepare_indicators(v->size()); + + size = static_cast(colSize_); + data = buf_; + } + break; case x_stdstring: { oracleType = SQLT_CHR; @@ -214,6 +238,24 @@ void oracle_vector_into_type_backend::post_fetch(bool gotData, indicator *ind) pos += colSize_; } } + else if (type_ == x_unsigned_long_long) + { + std::vector *vp + = static_cast *>(data_); + + std::vector &v(*vp); + + char *pos = buf_; + std::size_t const vsize = v.size(); + for (std::size_t i = 0; i != vsize; ++i) + { + if (indOCIHolderVec_[i] != -1) + { + v[i] = strtoull(pos, NULL, 10); + } + pos += colSize_; + } + } else if (type_ == x_stdtm) { std::vector *vp @@ -331,6 +373,13 @@ void oracle_vector_into_type_backend::resize(std::size_t sz) v->resize(sz); } break; + case x_unsigned_long_long: + { + std::vector *v + = static_cast *>(data_); + v->resize(sz); + } + break; case x_double: { std::vector *v @@ -397,6 +446,13 @@ std::size_t oracle_vector_into_type_backend::size() sz = v->size(); } break; + case x_unsigned_long_long: + { + std::vector *v + = static_cast *>(data_); + sz = v->size(); + } + break; case x_double: { std::vector *v diff --git a/backends/oracle/vector-use-type.cpp b/backends/oracle/vector-use-type.cpp index 1dd446e2..5c23e4e2 100644 --- a/backends/oracle/vector-use-type.cpp +++ b/backends/oracle/vector-use-type.cpp @@ -6,9 +6,17 @@ // #define soci_ORACLE_SOURCE -#include "soci-oracle.h" -#include "error.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include #include #include @@ -113,6 +121,24 @@ void oracle_vector_use_type_backend::prepare_for_bind( prepare_indicators(vecSize); } break; + case x_unsigned_long_long: + { + std::vector *vp + = static_cast *>(data); + std::vector &v(*vp); + + std::size_t const vecSize = v.size(); + std::size_t const entrySize = 100; // arbitrary + std::size_t const bufSize = entrySize * vecSize; + buf_ = new char[bufSize]; + + oracleType = SQLT_STR; + data = buf_; + size = entrySize; + + prepare_indicators(vecSize); + } + break; case x_stdstring: { std::vector *vp @@ -244,6 +270,21 @@ void oracle_vector_use_type_backend::pre_use(indicator const *ind) pos += entrySize; } } + else if (type_ == x_unsigned_long_long) + { + std::vector *vp + = static_cast *>(data_); + std::vector &v(*vp); + + char *pos = buf_; + std::size_t const entrySize = 100; // arbitrary, but consistent + std::size_t const vecSize = v.size(); + for (std::size_t i = 0; i != vecSize; ++i) + { + snprintf(pos, entrySize, "%llu", v[i]); + pos += entrySize; + } + } else if (type_ == x_stdtm) { std::vector *vp @@ -329,6 +370,13 @@ std::size_t oracle_vector_use_type_backend::size() sz = vp->size(); } break; + case x_unsigned_long_long: + { + std::vector *vp + = static_cast *>(data_); + sz = vp->size(); + } + break; case x_double: { std::vector *vp diff --git a/backends/postgresql/Makefile.basic b/backends/postgresql/Makefile.basic index 429d4399..01a70fca 100644 --- a/backends/postgresql/Makefile.basic +++ b/backends/postgresql/Makefile.basic @@ -2,20 +2,32 @@ # values might depend on your environment - feel free to set it accordingly. PGSQLINCLUDEDIR = -I/usr/include +PGSQLLIBDIR = -L/usr/lib +PGSQLLIBS = -lpq # The rest of the Makefile is indepentent of the target environment. COMPILER = g++ CXXFLAGS = -Wall -pedantic -Wno-long-long -CXXFLAGSSO = ${CXXFLAGS} -fPIC +SHARED_CXXFLAGS = ${CXXFLAGS} -fPIC INCLUDEDIRS = -I../../core ${PGSQLINCLUDEDIR} +SHARED_LIBDIRS = ${PGSQLLIBDIR} +SHARED_LIBS = ${PGSQLLIBS} ../../core/libsoci_core.a -OBJECTS = blob.o factory.o row-id.o session.o standard-into-type.o \ +UNAME = $(shell uname) +ifeq ($(UNAME),Darwin) + SHARED_LINK_FLAGS = -dynamiclib -flat_namespace -undefined suppress +else + SHARED_LINK_FLAGS = -shared +endif + + +OBJECTS = blob.o error.o factory.o row-id.o session.o standard-into-type.o \ standard-use-type.o statement.o vector-into-type.o vector-use-type.o \ common.o -OBJECTSSO = blob-s.o factory-s.o row-id-s.o session-s.o \ +SHARED_OBJECTS = blob-s.o error-s.o factory-s.o row-id-s.o session-s.o \ standard-into-type-s.o standard-use-type-s.o statement-s.o \ vector-into-type-s.o vector-use-type-s.o common-s.o @@ -28,6 +40,9 @@ libsoci_postgresql.a : ${OBJECTS} blob.o : blob.cpp ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} +error.o : error.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + common.o : common.cpp ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} @@ -56,39 +71,43 @@ vector-use-type.o : vector-use-type.cpp ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} -shared : ${OBJECTSSO} - ${COMPILER} -shared -o libsoci_postgresql.so ${OBJECTSSO} +shared : ${SHARED_OBJECTS} + ${COMPILER} ${SHARED_LINK_FLAGS} -o libsoci_postgresql.so \ + ${SHARED_OBJECTS} ${SHARED_LIBDIRS} ${SHARED_LIBS} rm *.o blob-s.o : blob.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} + +error-s.o : error.cpp + ${COMPILER} -c -o $@ $? ${CXXFLAGS} ${INCLUDEDIRS} common-s.o : common.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} factory-s.o : factory.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} row-id-s.o : row-id.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} session-s.o : session.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} standard-into-type-s.o : standard-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} standard-use-type-s.o : standard-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} statement-s.o : statement.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} vector-into-type-s.o : vector-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} vector-use-type-s.o : vector-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} clean : diff --git a/backends/postgresql/common.cpp b/backends/postgresql/common.cpp index d099c2df..6799d222 100644 --- a/backends/postgresql/common.cpp +++ b/backends/postgresql/common.cpp @@ -6,7 +6,13 @@ // #include "common.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// #include #include diff --git a/backends/postgresql/error.cpp b/backends/postgresql/error.cpp new file mode 100644 index 00000000..5f29c601 --- /dev/null +++ b/backends/postgresql/error.cpp @@ -0,0 +1,48 @@ +// +// Copyright (C) 2011 Gevorg Voskanyan +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_POSTGRESQL_SOURCE +#include "soci-postgresql.h" +#include "error.h" +#include +#include + +using namespace soci; +using namespace soci::details; +using namespace soci::details::postgresql; + +postgresql_soci_error::postgresql_soci_error( + std::string const & msg, char const *sqlst) + : soci_error(msg) +{ + assert(std::strlen(sqlst) == 5); + std::memcpy(sqlstate_, sqlst, 5); +} + +std::string postgresql_soci_error::sqlstate() const +{ + return std::string(sqlstate_, 5); +} + +void soci::details::postgresql::get_error_details(PGresult *res, + std::string &msg, std::string &sqlstate) +{ + msg = PQresultErrorMessage(res); + const char *sqlst = PQresultErrorField(res, PG_DIAG_SQLSTATE); + assert(sqlst); + assert(std::strlen(sqlst) == 5); + sqlstate.assign(sqlst, 5); +} + +void soci::details::postgresql::throw_postgresql_soci_error(PGresult *res) +{ + std::string msg; + std::string sqlstate; + + get_error_details(res, msg, sqlstate); + throw postgresql_soci_error(msg, sqlstate.c_str()); +} diff --git a/backends/postgresql/error.h b/backends/postgresql/error.h new file mode 100644 index 00000000..22e8394d --- /dev/null +++ b/backends/postgresql/error.h @@ -0,0 +1,32 @@ +// +// Copyright (C) 2011 Gevorg Voskanyan +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_POSTGRESQL_ERROR_H_INCLUDED +#define SOCI_POSTGRESQL_ERROR_H_INCLUDED + +#include "soci-postgresql.h" + +namespace soci +{ + +namespace details +{ + +namespace postgresql +{ + +void throw_postgresql_soci_error(PGresult *res); + +void get_error_details(PGresult *res, std::string &msg, std::string &sqlstate); + +} // namespace postgresql + +} // namespace details + +} // namespace soci + +#endif diff --git a/backends/postgresql/session.cpp b/backends/postgresql/session.cpp index 5c703565..5de875d7 100644 --- a/backends/postgresql/session.cpp +++ b/backends/postgresql/session.cpp @@ -7,6 +7,7 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" +#include "error.h" #include // libpq #include #include @@ -24,6 +25,7 @@ using namespace soci; using namespace soci::details; +using namespace soci::details::postgresql; postgresql_session_backend::postgresql_session_backend(std::string const& connectString) : statementCount_(0) @@ -66,7 +68,7 @@ void hard_exec(PGconn * conn, char const * query, char const * errMsg) ExecStatusType const status = PQresultStatus(result); if (PGRES_COMMAND_OK != status) { - throw soci_error(PQresultErrorMessage(result)); + throw_postgresql_soci_error(result); } PQclear(result); diff --git a/backends/postgresql/soci-postgresql.h b/backends/postgresql/soci-postgresql.h index fcdae75d..e31f0557 100644 --- a/backends/postgresql/soci-postgresql.h +++ b/backends/postgresql/soci-postgresql.h @@ -1,5 +1,6 @@ // // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2011 Gevorg Voskanyan // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -23,7 +24,13 @@ # define SOCI_POSTGRESQL_DECL #endif -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif +// #include #include @@ -34,6 +41,17 @@ namespace soci { +class postgresql_soci_error : public soci_error +{ +public: + postgresql_soci_error(std::string const & msg, char const * sqlst); + + std::string sqlstate() const; + +private: + char sqlstate_[ 5 ]; // not std::string to keep copy-constructor no-throw +}; + struct postgresql_statement_backend; struct postgresql_standard_into_type_backend : details::standard_into_type_backend { diff --git a/backends/postgresql/standard-into-type.cpp b/backends/postgresql/standard-into-type.cpp index 6c37ade2..c429683b 100644 --- a/backends/postgresql/standard-into-type.cpp +++ b/backends/postgresql/standard-into-type.cpp @@ -6,10 +6,18 @@ // #define SOCI_POSTGRESQL_SOURCE -#include "soci-postgresql.h" #include "common.h" -#include "rowid.h" -#include "blob.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include // libpq #include #include diff --git a/backends/postgresql/standard-use-type.cpp b/backends/postgresql/standard-use-type.cpp index 05c2b942..baccb9d1 100644 --- a/backends/postgresql/standard-use-type.cpp +++ b/backends/postgresql/standard-use-type.cpp @@ -6,10 +6,19 @@ // #define SOCI_POSTGRESQL_SOURCE -#include "soci-postgresql.h" -#include "blob.h" -#include "rowid.h" -#include +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +# include +#else +# include +# include +# include +# include +#endif +// #include // libpq #include #include diff --git a/backends/postgresql/statement.cpp b/backends/postgresql/statement.cpp index 4e9b4570..67d58370 100644 --- a/backends/postgresql/statement.cpp +++ b/backends/postgresql/statement.cpp @@ -7,6 +7,7 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" +#include "error.h" #include #include // libpq #include @@ -26,7 +27,7 @@ using namespace soci; using namespace soci::details; - +using namespace soci::details::postgresql; postgresql_statement_backend::postgresql_statement_backend( postgresql_session_backend &session) @@ -164,7 +165,7 @@ void postgresql_statement_backend::prepare(std::string const & query, ExecStatusType status = PQresultStatus(res); if (status != PGRES_COMMAND_OK) { - throw soci_error(PQresultErrorMessage(res)); + throw_postgresql_soci_error(res); } PQclear(res); } @@ -299,18 +300,19 @@ postgresql_statement_backend::execute(int number) #endif // SOCI_POSTGRESQL_NOPARAMS + if (result_ == NULL) + { + throw soci_error("Cannot execute query."); + } + if (numberOfExecutions > 1) { // there are only bulk use elements (no intos) - if (result_ == NULL) - { - throw soci_error("Cannot execute query."); - } ExecStatusType status = PQresultStatus(result_); if (status != PGRES_COMMAND_OK) { - throw soci_error(PQresultErrorMessage(result_)); + throw_postgresql_soci_error(result_); } PQclear(result_); } @@ -396,7 +398,10 @@ postgresql_statement_backend::execute(int number) } else { - throw soci_error(PQresultErrorMessage(result_)); + throw_postgresql_soci_error(result_); + + // dummy, never reach + return ef_no_data; } } diff --git a/backends/postgresql/test/test-postgresql.cpp b/backends/postgresql/test/test-postgresql.cpp index 57379d9f..b219da9e 100644 --- a/backends/postgresql/test/test-postgresql.cpp +++ b/backends/postgresql/test/test-postgresql.cpp @@ -5,9 +5,17 @@ // http://www.boost.org/LICENSE_1_0.txt) // -#include "soci.h" -#include "soci-postgresql.h" -#include "common-tests.h" +// +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else +# include +# include +# include +#endif +// #include #include #include diff --git a/cmake/SociVersion.cmake b/cmake/SociVersion.cmake new file mode 100644 index 00000000..72ff138c --- /dev/null +++ b/cmake/SociVersion.cmake @@ -0,0 +1,59 @@ +################################################################################ +# SociVersion.cmake - part of CMake configuration of SOCI library +################################################################################ +# Copyright (C) 2010 Mateusz Loskot +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +################################################################################ +# Macros in this module: +# +# soci_version - defines version information for SOCI library +# +################################################################################ + +# Defines version information for SOCI library +# +# soci_version(MAJOR major_version MINOR minor_version PATCH patch_level) +# +# MAJOR.MINOR version is used to set SOVERSION +# +macro(soci_version) + parse_arguments(THIS_VERSION "MAJOR;MINOR;PATCH;" + "" + ${ARGN}) + + # Set version components + set(${PROJECT_NAME}_VERSION_MAJOR ${THIS_VERSION_MAJOR}) + set(${PROJECT_NAME}_VERSION_MINOR ${THIS_VERSION_MINOR}) + set(${PROJECT_NAME}_VERSION_PATCH ${THIS_VERSION_PATCH}) + + # Set VERSION string + set(${PROJECT_NAME}_VERSION + "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}") + + # Set SOVERSION based on major and minor + set(${PROJECT_NAME}_SOVERSION + "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}") + + # Set ABI version string used to name binary output and, by SOCI loader, to find binaries. + # On Windows, ABI version is specified using binary file name suffix. + # On Unix, suffix ix empty and SOVERSION is used instead. + if (UNIX) + set(${PROJECT_NAME}_ABI_VERSION ${${PROJECT_NAME}_SOVERSION}) + elseif(WIN32) + set(${PROJECT_NAME}_ABI_VERSION + "${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}") + else() + message(FATAL_ERROR "Ambiguous target platform with unknown ABI version scheme. Giving up.") + endif() + + message(STATUS "") + + boost_report_value(${PROJECT_NAME}_VERSION) + boost_report_value(${PROJECT_NAME}_ABI_VERSION) + + add_definitions(-DSOCI_ABI_VERSION="${${PROJECT_NAME}_ABI_VERSION}") + +endmacro() diff --git a/cmake/modules/FindODBC.cmake b/cmake/modules/FindODBC.cmake new file mode 100644 index 00000000..9348a716 --- /dev/null +++ b/cmake/modules/FindODBC.cmake @@ -0,0 +1,57 @@ +# +# Find the ODBC driver manager includes and library. +# +# ODBC is an open standard for connecting to different databases in a +# semi-vendor-independent fashion. First you install the ODBC driver +# manager. Then you need a driver for each separate database you want +# to connect to (unless a generic one works). VTK includes neither +# the driver manager nor the vendor-specific drivers: you have to find +# those yourself. +# +# This module defines +# ODBC_INCLUDE_DIRECTORIES, where to find sql.h +# ODBC_LIBRARIES, the libraries to link against to use ODBC +# ODBC_FOUND. If false, you cannot build anything that requires MySQL. + +# also defined, but not for general use is +# ODBC_LIBRARY, where to find the ODBC driver manager library. + +set(ODBC_FOUND FALSE) + +find_path(ODBC_INCLUDE_DIRECTORIES sql.h + /usr/include + /usr/include/odbc + /usr/local/include + /usr/local/include/odbc + /usr/local/odbc/include + "C:/Program Files/ODBC/include" + "C:/Program Files/Microsoft SDKs/Windows/v7.0/include" + "C:/Program Files/Microsoft SDKs/Windows/v6.0a/include" + "C:/ODBC/include" + DOC "Specify the directory containing sql.h." +) + +find_library(ODBC_LIBRARY + NAMES iodbc odbc odbcinst odbc32 + PATHS + /usr/lib + /usr/lib/odbc + /usr/local/lib + /usr/local/lib/odbc + /usr/local/odbc/lib + "C:/Program Files/ODBC/lib" + "C:/ODBC/lib/debug" + "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" + DOC "Specify the ODBC driver manager library here." +) + +if(ODBC_LIBRARY) + if(ODBC_INCLUDE_DIRECTORIES) + set( ODBC_FOUND 1 ) + endif() +endif() + +set(ODBC_LIBRARIES ${ODBC_LIBRARY}) + +mark_as_advanced(ODBC_FOUND ODBC_LIBRARY ODBC_EXTRA_LIBRARIES ODBC_INCLUDE_DIRECTORIES) + diff --git a/cmake/modules/FindSoci.cmake b/cmake/modules/FindSoci.cmake new file mode 100644 index 00000000..fc0d0850 --- /dev/null +++ b/cmake/modules/FindSoci.cmake @@ -0,0 +1,100 @@ +############################################################################### +# CMake module to search for SOCI library +# +# WARNING: This module is experimental work in progress. +# +# This module defines: +# SOCI_INCLUDE_DIRS = include dirs to be used when using the soci library +# SOCI_LIBRARY = full path to the soci library +# SOCI_VERSION = the soci version found (not yet. soci does not provide that info.) +# SOCI_FOUND = true if soci was found +# +# This module respects: +# LIB_SUFFIX = (64|32|"") Specifies the suffix for the lib directory +# +# For each component you specify in find_package(), the following variables are set. +# +# SOCI_${COMPONENT}_PLUGIN = full path to the soci plugin +# SOCI_${COMPONENT}_FOUND +# +# Copyright (c) 2011 Michael Jansen +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# +############################################################################### +# +### Global Configuration Section +# +SET(_SOCI_ALL_PLUGINS mysql odbc postgresql sqlite3) +SET(_SOCI_REQUIRED_VARS SOCI_INCLUDE_DIR SOCI_LIBRARY) + +# +### FIRST STEP: Find the soci headers. +# +FIND_PATH( + SOCI_INCLUDE_DIR soci.h + PATH "/usr/local" + PATH_SUFFIXES "" "soci" + DOC "Soci (http://soci.sourceforge.net) include directory") +MARK_AS_ADVANCED(SOCI_INCLUDE_DIR) + +SET(SOCI_INCLUDE_DIRS ${SOCI_INCLUDE_DIR}) + +# +### SECOND STEP: Find the soci core library. Respect LIB_SUFFIX +# +FIND_LIBRARY( + SOCI_LIBRARY + NAMES soci_core + HINTS ${SOCI_INCLUDE_DIR}/.. + PATH_SUFFIXES lib${LIB_SUFFIX}) +MARK_AS_ADVANCED(SOCI_LIBRARY) + +GET_FILENAME_COMPONENT(SOCI_LIBRARY_DIR ${SOCI_LIBRARY} PATH) +MARK_AS_ADVANCED(SOCI_LIBRARY_DIR) + +# +### THIRD STEP: Find all installed plugins if the library was found +# +IF(SOCI_INCLUDE_DIR AND SOCI_LIBRARY) + + MESSAGE(STATUS "Soci found: Looking for plugins") + FOREACH(plugin IN LISTS _SOCI_ALL_PLUGINS) + + FIND_LIBRARY( + SOCI_${plugin}_PLUGIN + NAMES soci_${plugin} + HINTS ${SOCI_INCLUDE_DIR}/.. + PATH_SUFFIXES lib${LIB_SUFFIX}) + MARK_AS_ADVANCED(SOCI_${plugin}_PLUGIN) + + IF(SOCI_${plugin}_PLUGIN) + MESSAGE(STATUS " * Plugin ${plugin} found ${SOCI_${plugin}_LIBRARY}.") + SET(SOCI_${plugin}_FOUND True) + ELSE() + MESSAGE(STATUS " * Plugin ${plugin} not found.") + SET(SOCI_${plugin}_FOUND False) + ENDIF() + + ENDFOREACH() + + # + ### FOURTH CHECK: Check if the required components were all found + # + FOREACH(component ${Soci_FIND_COMPONENTS}) + IF(${SOCI_${component}_FOUND}) + # Does not work with NOT ... . No idea why. + ELSE() + MESSAGE(SEND_ERROR "Required component ${component} not found.") + ENDIF() + ENDFOREACH() + +ENDIF() + +# +### ADHERE TO STANDARDS +# +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Soci DEFAULT_MSG ${_SOCI_REQUIRED_VARS}) + diff --git a/core/Makefile.basic b/core/Makefile.basic index 05512fb0..f24fa2f1 100644 --- a/core/Makefile.basic +++ b/core/Makefile.basic @@ -1,6 +1,9 @@ COMPILER = g++ -CXXFLAGS = -Wall -pedantic -Wno-long-long -DSOCI_ABI_VERSION=3.1.0 +CXXFLAGS = -Wall -pedantic -Wno-long-long INCLUDEDIRS = + +BACKENDLOADERDEFS = -DSOCI_LIB_PREFIX=\"libsoci_\" -DSOCI_LIB_SUFFIX=\".so\" + OBJS = session.o statement.o row.o values.o \ into-type.o use-type.o \ blob.o rowid.o procedure.o ref-counted-prepare-info.o ref-counted-statement.o \ @@ -63,7 +66,7 @@ transaction.o : transaction.cpp ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} backend-loader.o : backend-loader.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + ${COMPILER} -c $? ${CXXFLAGS} ${BACKENDLOADERDEFS} ${INCLUDEDIRS} connection-pool.o : connection-pool.cpp ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} diff --git a/core/backend-loader.cpp b/core/backend-loader.cpp index 286bf8ce..10bef3da 100644 --- a/core/backend-loader.cpp +++ b/core/backend-loader.cpp @@ -4,9 +4,6 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#ifndef SOCI_ABI_VERSION -#error "SOCI_ABI_VERSION define is required to configure backend loader" -#endif #define SOCI_SOURCE #include "backend-loader.h" @@ -41,7 +38,12 @@ typedef HMODULE soci_handler_t; #endif #define DLCLOSE(x) FreeLibrary(x) #define DLSYM(x, y) GetProcAddress(x, y) + +#ifdef SOCI_ABI_VERSION #define LIBNAME(x) (SOCI_LIB_PREFIX + x + "_" SOCI_ABI_VERSION SOCI_LIB_SUFFIX) +#else +#define LIBNAME(x) (SOCI_LIB_PREFIX + x + SOCI_LIB_SUFFIX) +#endif // SOCI_ABI_VERSION #else @@ -58,12 +60,19 @@ typedef void * soci_handler_t; #define DLOPEN(x) dlopen(x, RTLD_LAZY) #define DLCLOSE(x) dlclose(x) #define DLSYM(x, y) dlsym(x, y) + +#ifdef SOCI_ABI_VERSION + #ifdef __APPLE__ #define LIBNAME(x) (SOCI_LIB_PREFIX + x + "." SOCI_ABI_VERSION SOCI_LIB_SUFFIX) #else #define LIBNAME(x) (SOCI_LIB_PREFIX + x + SOCI_LIB_SUFFIX "." SOCI_ABI_VERSION) #endif +#else +#define LIBNAME(x) (SOCI_LIB_PREFIX + x + SOCI_LIB_SUFFIX) +#endif // SOCI_ABI_VERSION + #endif // _WIN32 diff --git a/core/test/common-tests.h b/core/test/common-tests.h index 594e13ed..899c05b2 100644 --- a/core/test/common-tests.h +++ b/core/test/common-tests.h @@ -8,20 +8,36 @@ #ifndef SOCI_COMMON_TESTS_H_INCLUDED #define SOCI_COMMON_TESTS_H_INCLUDED -#include "soci.h" -#include "soci-config.h" - +#if defined(SOCI_HEADERS_BURIED) +# include +# include +#else +# include +# include +#endif +// #ifdef HAVE_BOOST // explicitly pull conversions for Boost's optional, tuple and fusion: +#if defined(SOCI_HEADERS_BURIED) +# include +# include +# include +#else // SOCI_HEADERS_BURIED +# include +# include +# include +#endif // SOCI_HEADERS_BURIED +// #include -#include -#include -#include #if defined(BOOST_VERSION) && BOOST_VERSION >= 103500 -#include +#if defined(SOCI_HEADERS_BURIED) +# include +#else +# include +#endif // SOCI_HEADERS_BURIED #endif // BOOST_VERSION #endif // HAVE_BOOST - +// #include #include #include @@ -1351,7 +1367,7 @@ void test7() #else // Older PostgreSQL does not support use elements. - sql << "insert into test7(i1, i2, i3) values(5, 6, 7)"; + sql << "insert into soci_test(i1, i2, i3) values(5, 6, 7)"; #endif // SOCI_PGSQL_NOPARAMS diff --git a/core/version.h b/core/version.h new file mode 100644 index 00000000..40be09fd --- /dev/null +++ b/core/version.h @@ -0,0 +1,32 @@ +// SOCI version.hpp configuration header file + +// +// Copyright (C) 2011 Mateusz Loskot +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_VERSION_HPP +#define SOCI_VERSION_HPP + +// +// Caution, this is the only SOCI header that is guarenteed +// to change with every SOCI release, including this header +// will cause a recompile every time a new SOCI version is +// released. +// +// SOCI_VERSION % 100 is the patch level +// SOCI_VERSION / 100 % 1000 is the minor version +// SOCI_VERSION / 100000 is the major version + +#define SOCI_VERSION 300100 + +// +// SOCI_LIB_VERSION must be defined to be the same as SOCI_VERSION +// but as a *string* in the form "x_y[_z]" where x is the major version +// number, y is the minor version number, and z is the patch level if not 0. + +#define SOCI_LIB_VERSION "3_1_0" + +#endif // SOCI_VERSION_HPP diff --git a/languages/ada/postgresql_client.gpr b/languages/ada/postgresql_client.gpr new file mode 100644 index 00000000..f29b3498 --- /dev/null +++ b/languages/ada/postgresql_client.gpr @@ -0,0 +1,8 @@ +project PostgreSQL_Client is + for Externally_Built use "true"; + for Source_Dirs use (); + for Library_Dir use "/usr/local/lib"; + for Library_Name use "pq"; + for Library_Kind use "static"; +end PostgreSQL_Client; + diff --git a/languages/ada/soci-mysql.ads b/languages/ada/soci-mysql.ads new file mode 100644 index 00000000..10156fbc --- /dev/null +++ b/languages/ada/soci-mysql.ads @@ -0,0 +1,16 @@ +-- Copyright (C) 2008-2011 Maciej Sobczak +-- Distributed under the Boost Software License, Version 1.0. +-- (See accompanying file LICENSE_1_0.txt or copy at +-- http://www.boost.org/LICENSE_1_0.txt) + +package SOCI.MySQL is + + -- + -- Registers the MySQL backend so that it is ready for use + -- by the dynamic backend loader. + -- + procedure Register_Factory_MySQL; + pragma Import (C, Register_Factory_MySQL, + "register_factory_mysql"); + +end SOCI.MySQL; diff --git a/languages/ada/soci-oracle.ads b/languages/ada/soci-oracle.ads new file mode 100644 index 00000000..ed8bc667 --- /dev/null +++ b/languages/ada/soci-oracle.ads @@ -0,0 +1,16 @@ +-- Copyright (C) 2008-2011 Maciej Sobczak +-- Distributed under the Boost Software License, Version 1.0. +-- (See accompanying file LICENSE_1_0.txt or copy at +-- http://www.boost.org/LICENSE_1_0.txt) + +package SOCI.Oracle is + + -- + -- Registers the Oracle backend so that it is ready for use + -- by the dynamic backend loader. + -- + procedure Register_Factory_Oracle; + pragma Import (C, Register_Factory_Oracle, + "register_factory_oracle"); + +end SOCI.Oracle; diff --git a/languages/ada/soci-postgresql.ads b/languages/ada/soci-postgresql.ads new file mode 100644 index 00000000..fc750b25 --- /dev/null +++ b/languages/ada/soci-postgresql.ads @@ -0,0 +1,16 @@ +-- Copyright (C) 2008-2011 Maciej Sobczak +-- Distributed under the Boost Software License, Version 1.0. +-- (See accompanying file LICENSE_1_0.txt or copy at +-- http://www.boost.org/LICENSE_1_0.txt) + +package SOCI.PostgreSQL is + + -- + -- Registers the PostgreSQL backend so that it is ready for use + -- by the dynamic backend loader. + -- + procedure Register_Factory_PostgreSQL; + pragma Import (C, Register_Factory_PostgreSQL, + "register_factory_postgresql"); + +end SOCI.PostgreSQL; diff --git a/languages/ada/soci.adb b/languages/ada/soci.adb new file mode 100644 index 00000000..7f72f1bb --- /dev/null +++ b/languages/ada/soci.adb @@ -0,0 +1,1465 @@ +-- Copyright (C) 2008-2011 Maciej Sobczak +-- Distributed under the Boost Software License, Version 1.0. +-- (See accompanying file LICENSE_1_0.txt or copy at +-- http://www.boost.org/LICENSE_1_0.txt) + +with Ada.Strings.Fixed; +with Interfaces.C.Strings; + +package body SOCI is + + procedure Check_Session_State (Handle : in Session_Handle) is + + function Soci_Session_State (S : in Session_Handle) return Interfaces.C.int; + + pragma Import (C, Soci_Session_State, "soci_session_state"); + + function Soci_Session_Error_Message + (S : in Session_Handle) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Session_Error_Message, "soci_session_error_message"); + + State : constant Interfaces.C.int := Soci_Session_State (Handle); + Bad_State : constant Interfaces.C.int := 0; + + use type Interfaces.C.int; + + begin + if State = Bad_State then + declare + Message : constant String := + Interfaces.C.Strings.Value (Soci_Session_Error_Message (Handle)); + begin + raise Database_Error with Message; + end; + end if; + end Check_Session_State; + + function Make_Session_Handle (Connection_String : in String) return Session_Handle is + + function Soci_Create_Session (C : in Interfaces.C.char_array) return Session_Handle; + pragma Import (C, Soci_Create_Session, "soci_create_session"); + + Connection_String_C : constant Interfaces.C.char_array := + Interfaces.C.To_C (Connection_String); + + Handle : constant Session_Handle := + Soci_Create_Session (Connection_String_C); + + begin + if Handle = Null_Session_Handle then + raise Database_Error with "Cannot create session object."; + else + return Handle; + end if; + end Make_Session_Handle; + + function Data_State_To_Int (State : in Data_State) return Interfaces.C.int is + begin + if State = Data_Not_Null then + return 1; + else + return 0; + end if; + end Data_State_To_Int; + + function Int_To_Data_State (State : in Interfaces.C.int) return Data_State is + use type Interfaces.C.int; + begin + if State /= 0 then + return Data_Not_Null; + else + return Data_Null; + end if; + end Int_To_Data_State; + + procedure Check_Is_Open (This : in Session'Class) is + begin + if not This.Initialized then + raise Database_Error with "Session is not initialized."; + end if; + end Check_Is_Open; + + procedure Check_Statement_State (Handle : in Statement_Handle) is + + function Soci_Statement_State (S : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Statement_State, "soci_statement_state"); + + function Soci_Statement_Error_Message + (S : in Statement_Handle) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Statement_Error_Message, "soci_statement_error_message"); + + State : constant Interfaces.C.int := Soci_Statement_State (Handle); + Bad_State : constant Interfaces.C.int := 0; + + use type Interfaces.C.int; + + begin + if State = Bad_State then + declare + Message : constant String := + Interfaces.C.Strings.Value (Soci_Statement_Error_Message (Handle)); + begin + raise Database_Error with Message; + end; + end if; + end Check_Statement_State; + + function String_To_Time (Source : in String) return Ada.Calendar.Time is + + Year_N : Natural; + Month_N : Natural; + Day_N : Natural; + Hour_N : Natural; + Minute_N : Natural; + Second_N : Natural; + + procedure Get_Next_Number + (Source : in String; + Position : in out Natural; + Result : out Natural) is + + I : Natural; + begin + I := Ada.Strings.Fixed.Index (Source => Source, + Pattern => " ", + From => Position); + + if I /= 0 then + Result := Natural'Value (Source (Position .. I)); + Position := I + 1; + else + Result := Natural'Value (Source (Position .. Source'Last)); + Position := 0; + end if; + end Get_Next_Number; + + Pos : Natural := 1; + + begin + + Get_Next_Number (Source => Source, Position => Pos, Result => Year_N); + Get_Next_Number (Source => Source, Position => Pos, Result => Month_N); + Get_Next_Number (Source => Source, Position => Pos, Result => Day_N); + Get_Next_Number (Source => Source, Position => Pos, Result => Hour_N); + Get_Next_Number (Source => Source, Position => Pos, Result => Minute_N); + Get_Next_Number (Source => Source, Position => Pos, Result => Second_N); + + return Ada.Calendar.Time_Of (Year_N, Month_N, Day_N, + Duration (Hour_N * 3_600 + Minute_N * 60 + Second_N)); + + end String_To_Time; + + function Time_To_String (Date : in Ada.Calendar.Time) return String is + + Year : Ada.Calendar.Year_Number; + Month : Ada.Calendar.Month_Number; + Day : Ada.Calendar.Day_Number; + Seconds : Ada.Calendar.Day_Duration; + + Hour : Natural; + Minute : Natural; + Seconds_N : Natural; + + begin + Ada.Calendar.Split (Date, Year, Month, Day, Seconds); + Seconds_N := Natural (Seconds); + + Hour := Seconds_N / 3_600; + Minute := (Seconds_N - Natural (Hour) * 3_600) / 60; + Seconds_N := Seconds_N - Natural (Hour) * 3_600 - Natural (Minute) * 60; + return Ada.Calendar.Year_Number'Image (Year) & " " & + Ada.Calendar.Month_Number'Image (Month) & " " & + Ada.Calendar.Day_Number'Image (Day) & " " & + Natural'Image (Hour) & " " & + Natural'Image (Minute) & " " & + Natural'Image (Seconds_N); + end Time_To_String; + + + function Make_Session (Connection_String : in String) return Session is + begin + return S : Session do + S.Handle := Make_Session_Handle (Connection_String); + S.Initialized := True; + Check_Session_State (S.Handle); + end return; + end Make_Session; + + procedure Open (This : in out Session; Connection_String : in String) is + begin + if This.Initialized then + raise Database_Error with "Session is already initialized."; + else + declare + Handle : constant Session_Handle := + Make_Session_Handle (Connection_String); + begin + Check_Session_State (Handle); + + This.Handle := Handle; + This.Initialized := True; + end; + end if; + end Open; + + procedure Close (This : in out Session) is + + procedure Soci_Destroy_Session (S : in Session_Handle); + pragma Import (C, Soci_Destroy_Session, "soci_destroy_session"); + + begin + if This.Initialized then + if This.Belongs_To_Pool then + raise Database_Error with "Cannot close session - not an owner (session in pool)."; + else + Soci_Destroy_Session (This.Handle); + This.Initialized := False; + end if; + end if; + end Close; + + function Is_Open (This : in Session) return Boolean is + begin + return This.Initialized; + end Is_Open; + + procedure Finalize (This : in out Session) is + begin + if This.Initialized then + if This.Belongs_To_Pool then + This.Pool.all.Give_Back (This.Position_In_Pool); + This.Initialized := False; + else + This.Close; + end if; + end if; + end Finalize; + + procedure Start (This : in Session) is + + procedure Soci_Begin (S : in Session_Handle); + pragma Import (C, Soci_Begin, "soci_begin"); + + begin + Check_Is_Open (This); + Soci_Begin (This.Handle); + Check_Session_State (This.Handle); + end Start; + + procedure Commit (This : in Session) is + + procedure Soci_Commit (S : in Session_Handle); + pragma Import (C, Soci_Commit, "soci_commit"); + + begin + Check_Is_Open (This); + Soci_Commit (This.Handle); + Check_Session_State (This.Handle); + end Commit; + + procedure Rollback (This : in Session) is + + procedure Soci_Rollback (S : in Session_Handle); + pragma Import (C, Soci_Rollback, "soci_rollback"); + + begin + Check_Is_Open (This); + Soci_Rollback (This.Handle); + Check_Session_State (This.Handle); + end Rollback; + + procedure Execute (This : in Session; Query : in String) is + S : Statement := Make_Statement (This); + begin + S.Prepare (Query); + S.Execute; + end Execute; + + protected body Connection_Pool_PS is + + procedure Open (Position : in Positive; Connection_String : in String) is + begin + if Position > Size then + raise Database_Error with "Index out of range."; + end if; + + Connections (Position).Open (Connection_String); + end Open; + + procedure Close (Position : in Positive) is + begin + if Position > Size then + raise Database_Error with "Index out of range."; + end if; + + if Is_Used (Position) then + raise Database_Error with "Cannot close connection that is currently in use."; + end if; + + Connections (Position).Close; + end Close; + + entry Lease (S : in out Session'Class) when Available is + Found : Boolean := False; + begin + if S.Initialized then + raise Database_Error with "This session is already initialized."; + end if; + + -- Find some connection in the pool that is not currently used. + for I in 1 .. Size loop + if not Is_Used (I) then + Check_Is_Open (Connections (I)); + + S.Handle := Connections (I).Handle; + S.Initialized := True; + S.Belongs_To_Pool := True; + S.Position_In_Pool := I; + + -- WORKAROUND: + -- The S.Pool component is set in the Lease procedure + -- of the Connection_Pool type, because here the access + -- to the protected object could not be taken (compiler bug). + + Is_Used (I) := True; + Found := True; + exit; + end if; + end loop; + + if not Found then + raise Database_Error with "Internal error."; + end if; + + -- Update the Available flag. + Found := False; + for I in 1 .. Size loop + if not Is_Used (I) then + Found := True; + exit; + end if; + end loop; + Available := Found; + + end Lease; + + procedure Give_Back (Position : in Positive) is + begin + if Position > Size then + raise Database_Error with "Index out of range."; + end if; + + if not Is_Used (Position) then + raise Database_Error with "Cannot give back connection that is not in use."; + end if; + + Is_Used (Position) := False; + Available := True; + end Give_Back; + + end Connection_Pool_PS; + + procedure Open + (This : in out Connection_Pool; + Position : in Positive; + Connection_String : in String) is + begin + This.Pool.Open (Position, Connection_String); + end Open; + + procedure Close (This : in out Connection_Pool; Position : in Positive) is + begin + This.Pool.Close (Position); + end Close; + + procedure Lease (This : in out Connection_Pool; S : in out Session'Class) is + begin + This.Pool.Lease (S); + + -- WORKAROUND: + -- The S.Pool component is set here because the access + -- to protected object cannot be taken in protected body (compiler bug.) + + -- JUSTIFICATION: + -- The Unchecked_Access is taken here to enable the session to properly + -- "unregister" from the pool in Session's Finalize. + -- An alternative would be to rely on the user to explicitly unlock + -- the appropriate entry in the pool, which is too error prone. + -- It is assumed that connection pool always has wider lifetime + -- than that of the session which is temporarily leased from the pool + -- - this guarantees that S.Pool always points to a valid pool object. + + S.Pool := This.Pool'Unchecked_Access; + end Lease; + + function Make_Statement (Sess : in Session'Class) return Statement is + + function Soci_Create_Statement (Sess : in Session_Handle) return Statement_Handle; + pragma Import (C, Soci_Create_Statement, "soci_create_statement"); + + begin + Check_Is_Open (Sess); + + declare + Handle : constant Statement_Handle := + Soci_Create_Statement (Sess.Handle); + begin + + return S : Statement do + S.Handle := Handle; + S.Initialized := True; + Check_Statement_State (S.Handle); + end return; + end; + end Make_Statement; + + procedure Finalize (This : in out Statement) is + + procedure Soci_Destroy_Statement (S : in Statement_Handle); + pragma Import (C, Soci_Destroy_Statement, "soci_destroy_statement"); + + begin + if This.Initialized then + Soci_Destroy_Statement (This.Handle); + This.Initialized := False; + end if; + end Finalize; + + procedure Prepare (This : in Statement; Query : in String) is + + procedure Soci_Prepare (St : in Statement_Handle; Q : in Interfaces.C.char_array); + pragma Import (C, Soci_Prepare, "soci_prepare"); + + Query_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Query); + + begin + Soci_Prepare (This.Handle, Query_C); + Check_Statement_State (This.Handle); + end Prepare; + + procedure Execute (This : in Statement; With_Data_Exchange : in Boolean := False) is + Result : constant Boolean := This.Execute (With_Data_Exchange); + begin + null; + end Execute; + + function Execute + (This : in Statement; + With_Data_Exchange : in Boolean := False) + return Boolean is + + function Soci_Execute + (St : in Statement_Handle; + WDE : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, Soci_Execute, "soci_execute"); + + WDE_C : Interfaces.C.int; + Result : Interfaces.C.int; + + use type Interfaces.C.int; + + begin + if With_Data_Exchange then + WDE_C := 1; + else + WDE_C := 0; + end if; + + Result := Soci_Execute (This.Handle, WDE_C); + Check_Statement_State (This.Handle); + + return Result /= 0; + end Execute; + + function Fetch (This : in Statement) return Boolean is + + function Soci_Fetch (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Fetch, "soci_fetch"); + + Result : constant Interfaces.C.int := Soci_Fetch (This.Handle); + + use type Interfaces.C.int; + + begin + Check_Statement_State (This.Handle); + return Result /= 0; + end Fetch; + + function Got_Data (This : in Statement) return Boolean is + + function Soci_Got_Data (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Got_Data, "soci_got_data"); + + Result : constant Interfaces.C.int := Soci_Got_Data (This.Handle); + + use type Interfaces.C.int; + + begin + Check_Statement_State (This.Handle); + return Result /= 0; + end Got_Data; + + function Into_String (This : in Statement) return Into_Position is + + function Soci_Into_String (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_String, "soci_into_string"); + + Result : constant Interfaces.C.int := Soci_Into_String (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_String; + + function Into_Integer (This : in Statement) return Into_Position is + + function Soci_Into_Int (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Int, "soci_into_int"); + + Result : constant Interfaces.C.int := Soci_Into_Int (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Integer; + + function Into_Long_Long_Integer (This : in Statement) return Into_Position is + + function Soci_Into_Long_Long (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Long_Long, "soci_into_long_long"); + + Result : constant Interfaces.C.int := Soci_Into_Long_Long (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Long_Long_Integer; + + function Into_Long_Float (This : in Statement) return Into_Position is + + function Soci_Into_Double (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Double, "soci_into_double"); + + Result : constant Interfaces.C.int := Soci_Into_Double (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Long_Float; + + function Into_Time (This : in Statement) return Into_Position is + + function Soci_Into_Date (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Date, "soci_into_date"); + + Result : constant Interfaces.C.int := Soci_Into_Date (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Time; + + function Into_Vector_String (This : in Statement) return Into_Position is + + function Soci_Into_String_V (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_String_V, "soci_into_string_v"); + + Result : constant Interfaces.C.int := Soci_Into_String_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Vector_String; + + function Into_Vector_Integer (This : in Statement) return Into_Position is + + function Soci_Into_Int_V (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Int_V, "soci_into_int_v"); + + Result : constant Interfaces.C.int := Soci_Into_Int_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Vector_Integer; + + function Into_Vector_Long_Long_Integer (This : in Statement) return Into_Position is + + function Soci_Into_Long_Long_V (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Long_Long_V, "soci_into_long_long_v"); + + Result : constant Interfaces.C.int := Soci_Into_Long_Long_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Vector_Long_Long_Integer; + + function Into_Vector_Long_Float (This : in Statement) return Into_Position is + + function Soci_Into_Double_V (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Double_V, "soci_into_double_v"); + + Result : constant Interfaces.C.int := Soci_Into_Double_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Vector_Long_Float; + + function Into_Vector_Time (This : in Statement) return Into_Position is + + function Soci_Into_Date_V (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Date_V, "soci_into_date_v"); + + Result : constant Interfaces.C.int := Soci_Into_Date_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Vector_Time; + + function Get_Into_State + (This : in Statement; + Position : in Into_Position) + return Data_State is + + function Soci_Get_Into_State + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Into_State, "soci_get_into_state"); + + Result : constant Interfaces.C.int := + Soci_Get_Into_State (This.Handle, Interfaces.C.int (Position)); + + use type Interfaces.C.int; + + begin + Check_Statement_State (This.Handle); + return Int_To_Data_State (Result); + end Get_Into_State; + + function Get_Into_String + (This : in Statement; + Position : in Into_Position) + return String is + + function Soci_Get_Into_String + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Into_String, "soci_get_into_string"); + + Result : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Into_String (This.Handle, Interfaces.C.int (Position)); + + begin + Check_Statement_State (This.Handle); + return Interfaces.C.Strings.Value (Result); + end Get_Into_String; + + function Get_Into_Integer + (This : in Statement; + Position : in Into_Position) + return DB_Integer is + + function Soci_Get_Into_Int + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Into_Int, "soci_get_into_int"); + + Result : constant Interfaces.C.int := + Soci_Get_Into_Int (This.Handle, Interfaces.C.int (Position)); + + begin + Check_Statement_State (This.Handle); + return DB_Integer (Result); + end Get_Into_Integer; + + function Get_Into_Long_Long_Integer + (This : in Statement; + Position : in Into_Position) + return DB_Long_Long_Integer is + + function Soci_Get_Into_Long_Long + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.Integer_64; + pragma Import (C, Soci_Get_Into_Long_Long, "soci_get_into_long_long"); + + Result : constant Interfaces.Integer_64 := + Soci_Get_Into_Long_Long (This.Handle, Interfaces.C.int (Position)); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Long_Integer (Result); + end Get_Into_Long_Long_Integer; + + function Get_Into_Long_Float + (This : in Statement; + Position : in Into_Position) + return DB_Long_Float is + + function Soci_Get_Into_Double + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.C.double; + pragma Import (C, Soci_Get_Into_Double, "soci_get_into_double"); + + Result : constant Interfaces.C.double := + Soci_Get_Into_Double (This.Handle, Interfaces.C.int (Position)); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Float (Result); + end Get_Into_Long_Float; + + function Get_Into_Time + (This : in Statement; + Position : in Into_Position) + return Ada.Calendar.Time is + + function Soci_Get_Into_Date + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Into_Date, "soci_get_into_date"); + + Result_C : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Into_Date (This.Handle, Interfaces.C.int (Position)); + Result : constant String := Interfaces.C.Strings.Value (Result_C); + + begin + Check_Statement_State (This.Handle); + return String_To_Time (Result); + end Get_Into_Time; + + function Get_Into_Vectors_Size (This : in Statement) return Natural is + + function Soci_Into_Get_Size_V + (St : in Statement_Handle) + return Interfaces.C.int; + pragma Import (C, Soci_Into_Get_Size_V, "soci_into_get_size_v"); + + Result_C : constant Interfaces.C.int := Soci_Into_Get_Size_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Natural (Result_C); + end Get_Into_Vectors_Size; + + function Into_Vectors_First_Index (This : in Statement) return Vector_Index is + begin + return 0; + end Into_Vectors_First_Index; + + function Into_Vectors_Last_Index (This : in Statement) return Vector_Index is + begin + return Vector_Index (This.Get_Into_Vectors_Size - 1); + end Into_Vectors_Last_Index; + + procedure Into_Vectors_Resize (This : in Statement; New_Size : in Natural) is + + procedure Soci_Into_Resize_V + (St : in Statement_Handle; + New_Size : in Interfaces.C.int); + pragma Import (C, Soci_Into_Resize_V, "soci_into_resize_v"); + + begin + Soci_Into_Resize_V (This.Handle, Interfaces.C.int (New_Size)); + Check_Statement_State (This.Handle); + end Into_Vectors_Resize; + + function Get_Into_Vector_State + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return Data_State is + + function Soci_Get_Into_State_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Into_State_V, "soci_get_into_state_v"); + + Result : constant Interfaces.C.int := + Soci_Get_Into_State_V + (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + + use type Interfaces.C.int; + + begin + Check_Statement_State (This.Handle); + return Int_To_Data_State (Result); + end Get_Into_Vector_State; + + function Get_Into_Vector_String + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) return String is + + function Soci_Get_Into_String_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Into_String_V, "soci_get_into_string_v"); + + Result : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Into_String_V (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + + begin + Check_Statement_State (This.Handle); + return Interfaces.C.Strings.Value (Result); + end Get_Into_Vector_String; + + function Get_Into_Vector_Integer + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Integer is + + function Soci_Get_Into_Int_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Into_Int_V, "soci_get_into_int_v"); + + Result : constant Interfaces.C.int := + Soci_Get_Into_Int_V (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + + begin + Check_Statement_State (This.Handle); + return DB_Integer (Result); + end Get_Into_Vector_Integer; + + function Get_Into_Vector_Long_Long_Integer + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Long_Long_Integer is + + function Soci_Get_Into_Long_Long_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.Integer_64; + pragma Import (C, Soci_Get_Into_Long_Long_V, "soci_get_into_long_long_v"); + + Result : constant Interfaces.Integer_64 := + Soci_Get_Into_Long_Long_V (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Long_Integer (Result); + end Get_Into_Vector_Long_Long_Integer; + + function Get_Into_Vector_Long_Float + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Long_Float is + + function Soci_Get_Into_Double_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.C.double; + pragma Import (C, Soci_Get_Into_Double_V, "soci_get_into_double_v"); + + Result : constant Interfaces.C.double := + Soci_Get_Into_Double_V (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Float (Result); + end Get_Into_Vector_Long_Float; + + function Get_Into_Vector_Time + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return Ada.Calendar.Time is + + function Soci_Get_Into_Date_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Into_Date_V, "soci_get_into_date_v"); + + Result_C : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Into_Date_V (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + Result : constant String := Interfaces.C.Strings.Value (Result_C); + + begin + Check_Statement_State (This.Handle); + return String_To_Time (Result); + end Get_Into_Vector_Time; + + procedure Use_String (This : in Statement; Name : in String) is + + procedure Soci_Use_String + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_String, "soci_use_string"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_String (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_String; + + procedure Use_Integer (This : in Statement; Name : in String) is + + procedure Soci_Use_Int + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Int, "soci_use_int"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Int (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Integer; + + procedure Use_Long_Long_Integer (This : in Statement; Name : in String) is + + procedure Soci_Use_Long_Long + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Long_Long, "soci_use_long_long"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Long_Long (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Long_Long_Integer; + + procedure Use_Long_Float (This : in Statement; Name : in String) is + + procedure Soci_Use_Double + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Double, "soci_use_double"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Double (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Long_Float; + + procedure Use_Time (This : in Statement; Name : in String) is + + procedure Soci_Use_Date + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Date, "soci_use_date"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Date (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Time; + + procedure Use_Vector_String (This : in Statement; Name : in String) is + + procedure Soci_Use_String_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_String_V, "soci_use_string_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_String_V (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Vector_String; + + procedure Use_Vector_Integer (This : in Statement; Name : in String) is + + procedure Soci_Use_Int_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Int_V, "soci_use_int_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Int_V (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Vector_Integer; + + procedure Use_Vector_Long_Long_Integer (This : in Statement; Name : in String) is + + procedure Soci_Use_Long_Long_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Long_Long_V, "soci_use_long_long_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Long_Long_V (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Vector_Long_Long_Integer; + + procedure Use_Vector_Long_Float (This : in Statement; Name : in String) is + + procedure Soci_Use_Double_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Double_V, "soci_use_double_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Double_V (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Vector_Long_Float; + + procedure Use_Vector_Time (This : in Statement; Name : in String) is + + procedure Soci_Use_Date_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Date_V, "soci_use_date_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Date_V (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Vector_Time; + + procedure Set_Use_State + (This : in Statement; + Name : in String; + State : in Data_State) is + + procedure Soci_Set_Use_State + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + State : in Interfaces.C.int); + pragma Import (C, Soci_Set_Use_State, "soci_set_use_state"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + State_C : constant Interfaces.C.int := Data_State_To_Int (State); + + begin + Soci_Set_Use_State (This.Handle, Name_C, State_C); + Check_Statement_State (This.Handle); + end Set_Use_State; + + procedure Set_Use_String + (This : in Statement; + Name : in String; + Value : in String) is + + procedure Soci_Set_Use_String + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Value : in Interfaces.C.char_array); + pragma Import (C, Soci_Set_Use_String, "soci_set_use_string"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Value_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Value); + + begin + Soci_Set_Use_String (This.Handle, Name_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_String; + + procedure Set_Use_Integer + (This : in Statement; + Name : in String; + Value : in DB_Integer) is + + procedure Soci_Set_Use_Int + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Value : in Interfaces.C.int); + pragma Import (C, Soci_Set_Use_Int, "soci_set_use_int"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Value_C : constant Interfaces.C.int := Interfaces.C.int (Value); + + begin + Soci_Set_Use_Int (This.Handle, Name_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Integer; + + procedure Set_Use_Long_Long_Integer + (This : in Statement; + Name : in String; + Value : in DB_Long_Long_Integer) is + + procedure Soci_Set_Use_Long_Long + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Value : in Interfaces.Integer_64); + pragma Import (C, Soci_Set_Use_Long_Long, "soci_set_use_long_long"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Value_C : constant Interfaces.Integer_64 := Interfaces.Integer_64 (Value); + + begin + Soci_Set_Use_Long_Long (This.Handle, Name_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Long_Long_Integer; + + procedure Set_Use_Long_Float + (This : in Statement; + Name : in String; + Value : in DB_Long_Float) is + + procedure Soci_Set_Use_Double + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Value : in Interfaces.C.double); + pragma Import (C, Soci_Set_Use_Double, "soci_set_use_double"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Value_C : constant Interfaces.C.double := Interfaces.C.double (Value); + + begin + Soci_Set_Use_Double (This.Handle, Name_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Long_Float; + + procedure Set_Use_Time + (This : in Statement; + Name : in String; + Value : in Ada.Calendar.Time) is + + procedure Soci_Set_Use_Date + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Value : in Interfaces.C.char_array); + pragma Import (C, Soci_Set_Use_Date, "soci_set_use_date"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Value_C : constant Interfaces.C.char_array := + Interfaces.C.To_C (Time_To_String (Value)); + + begin + Soci_Set_Use_Date (This.Handle, Name_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Time; + + function Get_Use_Vectors_Size (This : in Statement) return Natural is + + function Soci_Use_Get_Size_V + (St : in Statement_Handle) + return Interfaces.C.int; + pragma Import (C, Soci_Use_Get_Size_V, "soci_use_get_size_v"); + + Result_C : constant Interfaces.C.int := Soci_Use_Get_Size_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Natural (Result_C); + end Get_Use_Vectors_Size; + + function Use_Vectors_First_Index (This : in Statement) return Vector_Index is + begin + return 0; + end Use_Vectors_First_Index; + + function Use_Vectors_Last_Index (This : in Statement) return Vector_Index is + begin + return Vector_Index (This.Get_Use_Vectors_Size - 1); + end Use_Vectors_Last_Index; + + procedure Use_Vectors_Resize (This : in Statement; New_Size : in Natural) is + + procedure Soci_Use_Resize_V + (St : in Statement_Handle; + New_Size : in Interfaces.C.int); + pragma Import (C, Soci_Use_Resize_V, "soci_use_resize_v"); + + begin + Soci_Use_Resize_V (This.Handle, Interfaces.C.int (New_Size)); + Check_Statement_State (This.Handle); + end Use_Vectors_Resize; + + procedure Set_Use_Vector_State + (This : in Statement; + Name : in String; + Index : in Vector_Index; + State : in Data_State) is + + procedure Soci_Set_Use_State_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + State : in Interfaces.C.int); + pragma Import (C, Soci_Set_Use_State_V, "soci_set_use_state_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + State_C : constant Interfaces.C.int := Data_State_To_Int (State); + + begin + Soci_Set_Use_State_V (This.Handle, Name_C, Index_C, State_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_State; + + procedure Set_Use_Vector_String + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in String) is + + procedure Soci_Set_Use_String_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + Value : in Interfaces.C.char_array); + pragma Import (C, Soci_Set_Use_String_V, "soci_set_use_string_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + Value_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Value); + + begin + Soci_Set_Use_String_V (This.Handle, Name_C, Index_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_String; + + procedure Set_Use_Vector_Integer + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Integer) is + + procedure Soci_Set_Use_Int_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + Value : in Interfaces.C.int); + pragma Import (C, Soci_Set_Use_Int_V, "soci_set_use_int_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + Value_C : constant Interfaces.C.int := Interfaces.C.int (Value); + + begin + Soci_Set_Use_Int_V (This.Handle, Name_C, Index_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_Integer; + + procedure Set_Use_Vector_Long_Long_Integer + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Long_Long_Integer) is + + procedure Soci_Set_Use_Long_Long_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + Value : in Interfaces.Integer_64); + pragma Import (C, Soci_Set_Use_Long_Long_V, "soci_set_use_long_long_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + Value_C : constant Interfaces.Integer_64 := Interfaces.Integer_64 (Value); + + begin + Soci_Set_Use_Long_Long_V (This.Handle, Name_C, Index_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_Long_Long_Integer; + + procedure Set_Use_Vector_Long_Float + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Long_Float) is + + procedure Soci_Set_Use_Double_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + Value : in Interfaces.C.double); + pragma Import (C, Soci_Set_Use_Double_V, "soci_set_use_double_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + Value_C : constant Interfaces.C.double := Interfaces.C.double (Value); + + begin + Soci_Set_Use_Double_V (This.Handle, Name_C, Index_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_Long_Float; + + procedure Set_Use_Vector_Time + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in Ada.Calendar.Time) is + + procedure Soci_Set_Use_Date_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + Value : in Interfaces.C.char_array); + pragma Import (C, Soci_Set_Use_Date_V, "soci_set_use_date_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + Value_C : constant Interfaces.C.char_array := + Interfaces.C.To_C (Time_To_String (Value)); + + begin + Soci_Set_Use_Date_V (This.Handle, Name_C, Index_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_Time; + + function Get_Use_State + (This : in Statement; + Name : in String) return Data_State is + + function Soci_Get_Use_State + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Use_State, "soci_get_use_state"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result : constant Interfaces.C.int := + Soci_Get_Use_State (This.Handle, Name_C); + + use type Interfaces.C.int; + + begin + Check_Statement_State (This.Handle); + return Int_To_Data_State (Result); + end Get_Use_State; + + function Get_Use_String + (This : in Statement; + Name : in String) + return String is + + function Soci_Get_Use_String + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Use_String, "soci_get_use_string"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Use_String (This.Handle, Name_C); + + begin + Check_Statement_State (This.Handle); + return Interfaces.C.Strings.Value (Result); + end Get_Use_String; + + function Get_Use_Integer + (This : in Statement; + Name : in String) + return DB_Integer is + + function Soci_Get_Use_Int + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Use_Int, "soci_get_use_int"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result : constant Interfaces.C.int := + Soci_Get_Use_Int (This.Handle, Name_C); + + begin + Check_Statement_State (This.Handle); + return DB_Integer (Result); + end Get_Use_Integer; + + function Get_Use_Long_Long_Integer + (This : in Statement; + Name : in String) + return DB_Long_Long_Integer is + + function Soci_Get_Use_Long_Long + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.Integer_64; + pragma Import (C, Soci_Get_Use_Long_Long, "soci_get_use_long_long"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result : constant Interfaces.Integer_64 := + Soci_Get_Use_Long_Long (This.Handle, Name_C); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Long_Integer (Result); + end Get_Use_Long_Long_Integer; + + function Get_Use_Long_Float + (This : in Statement; + Name : in String) + return DB_Long_Float is + + function Soci_Get_Use_Double + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.C.double; + pragma Import (C, Soci_Get_Use_Double, "soci_get_use_double"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result : constant Interfaces.C.double := + Soci_Get_Use_Double (This.Handle, Name_C); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Float (Result); + end Get_Use_Long_Float; + + function Get_Use_Time + (This : in Statement; + Name : in String) + return Ada.Calendar.Time is + + function Soci_Get_Use_Date + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Use_Date, "soci_get_use_date"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result_C : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Use_Date (This.Handle, Name_C); + Result : constant String := Interfaces.C.Strings.Value (Result_C); + + begin + Check_Statement_State (This.Handle); + return String_To_Time (Result); + end Get_Use_Time; + +end SOCI; diff --git a/languages/ada/soci.ads b/languages/ada/soci.ads new file mode 100644 index 00000000..93b59678 --- /dev/null +++ b/languages/ada/soci.ads @@ -0,0 +1,486 @@ +-- +-- Thin wrapper for the simple interface of the SOCI database access library. +-- +-- Copyright (C) 2008-2011 Maciej Sobczak +-- Distributed under the Boost Software License, Version 1.0. +-- (See accompanying file LICENSE_1_0.txt or copy at +-- http://www.boost.org/LICENSE_1_0.txt) + +with Ada.Calendar; +with Interfaces.C; + +private with System; +private with Ada.Finalization; + +package SOCI is + + -- + -- General exception related to database and library usage. + -- + + Database_Error : exception; + + -- + -- Session. + -- + + type Session is tagged limited private; + + not overriding + function Make_Session (Connection_String : in String) return Session; + + not overriding + procedure Open (This : in out Session; Connection_String : in String); + + not overriding + procedure Close (This : in out Session); + + not overriding + function Is_Open (This : in Session) return Boolean; + + -- Transaction management. + + not overriding + procedure Start (This : in Session); + + not overriding + procedure Commit (This : in Session); + + not overriding + procedure Rollback (This : in Session); + + -- Immediate query execution. + not overriding + procedure Execute (This : in Session; Query : in String); + + -- + -- Connection pool management. + -- + + type Connection_Pool (Size : Positive) is tagged limited private; + + not overriding + procedure Open + (This : in out Connection_Pool; + Position : in Positive; + Connection_String : in String); + + not overriding + procedure Close (This : in out Connection_Pool; Position : in Positive); + + not overriding + procedure Lease (This : in out Connection_Pool; S : in out Session'Class); + + -- + -- Statement. + -- + + type Statement (<>) is tagged limited private; + + type Data_State is (Data_Null, Data_Not_Null); + + type Into_Position is private; + + type Vector_Index is new Natural; + + not overriding + function Make_Statement (Sess : in Session'Class) return Statement; + + -- Statement preparation and execution. + + not overriding + procedure Prepare (This : in Statement; Query : in String); + + not overriding + procedure Execute + (This : in Statement; + With_Data_Exchange : in Boolean := False); + + not overriding + function Execute + (This : in Statement; + With_Data_Exchange : in Boolean := False) return Boolean; + + not overriding + function Fetch (This : in Statement) return Boolean; + + not overriding + function Got_Data (This : in Statement) return Boolean; + + -- + -- Data items handling. + -- + + -- Database-specific types. + -- These types are most likely identical to standard Integer, + -- Long_Long_Integer and Long_Float, but are defined distinctly + -- to avoid interfacing problems with other compilers. + + type DB_Integer is new Interfaces.C.int; + type DB_Long_Long_Integer is new Interfaces.Integer_64; + type DB_Long_Float is new Interfaces.C.double; + + -- Creation of single into elements. + + not overriding + function Into_String (This : in Statement) return Into_Position; + + not overriding + function Into_Integer (This : in Statement) return Into_Position; + + not overriding + function Into_Long_Long_Integer (This : in Statement) return Into_Position; + + not overriding + function Into_Long_Float (This : in Statement) return Into_Position; + + not overriding + function Into_Time (This : in Statement) return Into_Position; + + -- Creation of vector into elements. + + not overriding + function Into_Vector_String (This : in Statement) return Into_Position; + + not overriding + function Into_Vector_Integer (This : in Statement) return Into_Position; + + not overriding + function Into_Vector_Long_Long_Integer (This : in Statement) return Into_Position; + + not overriding + function Into_Vector_Long_Float (This : in Statement) return Into_Position; + + not overriding + function Into_Vector_Time (This : in Statement) return Into_Position; + + -- Inspection of single into elements. + + not overriding + function Get_Into_State + (This : in Statement; + Position : in Into_Position) + return Data_State; + + not overriding + function Get_Into_String + (This : in Statement; + Position : in Into_Position) + return String; + + not overriding + function Get_Into_Integer + (This : in Statement; + Position : in Into_Position) + return DB_Integer; + + not overriding + function Get_Into_Long_Long_Integer + (This : in Statement; + Position : in Into_Position) + return DB_Long_Long_Integer; + + not overriding + function Get_Into_Long_Float + (This : in Statement; + Position : in Into_Position) + return DB_Long_Float; + + not overriding + function Get_Into_Time + (This : in Statement; + Position : in Into_Position) + return Ada.Calendar.Time; + + -- Inspection of vector into elements. + + not overriding + function Get_Into_Vectors_Size (This : in Statement) return Natural; + + not overriding + function Into_Vectors_First_Index (This : in Statement) return Vector_Index; + + not overriding + function Into_Vectors_Last_Index (This : in Statement) return Vector_Index; + + not overriding + procedure Into_Vectors_Resize (This : in Statement; New_Size : in Natural); + + not overriding + function Get_Into_Vector_State + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return Data_State; + + not overriding + function Get_Into_Vector_String + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return String; + + not overriding + function Get_Into_Vector_Integer + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Integer; + + not overriding + function Get_Into_Vector_Long_Long_Integer + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Long_Long_Integer; + + not overriding + function Get_Into_Vector_Long_Float + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Long_Float; + + not overriding + function Get_Into_Vector_Time + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return Ada.Calendar.Time; + + -- Creation of single use elements. + + not overriding + procedure Use_String (This : in Statement; Name : in String); + + not overriding + procedure Use_Integer (This : in Statement; Name : in String); + + not overriding + procedure Use_Long_Long_Integer (This : in Statement; Name : in String); + + not overriding + procedure Use_Long_Float (This : in Statement; Name : in String); + + not overriding + procedure Use_Time (This : in Statement; Name : in String); + + -- Creation of vector use elements. + + not overriding + procedure Use_Vector_String (This : in Statement; Name : in String); + + not overriding + procedure Use_Vector_Integer (This : in Statement; Name : in String); + + not overriding + procedure Use_Vector_Long_Long_Integer (This : in Statement; Name : in String); + + not overriding + procedure Use_Vector_Long_Float (This : in Statement; Name : in String); + + not overriding + procedure Use_Vector_Time (This : in Statement; Name : in String); + + -- Modifiers for single use elements. + + not overriding + procedure Set_Use_State + (This : in Statement; + Name : in String; + State : in Data_State); + + not overriding + procedure Set_Use_String + (This : in Statement; + Name : in String; + Value : in String); + + not overriding + procedure Set_Use_Integer + (This : in Statement; + Name : in String; + Value : in DB_Integer); + + not overriding + procedure Set_Use_Long_Long_Integer + (This : in Statement; + Name : in String; + Value : in DB_Long_Long_Integer); + + not overriding + procedure Set_Use_Long_Float + (This : in Statement; + Name : in String; + Value : in DB_Long_Float); + + not overriding + procedure Set_Use_Time + (This : in Statement; + Name : in String; + Value : in Ada.Calendar.Time); + + -- Modifiers for vector use elements. + + not overriding + function Get_Use_Vectors_Size (This : in Statement) return Natural; + + not overriding + function Use_Vectors_First_Index (This : in Statement) return Vector_Index; + + not overriding + function Use_Vectors_Last_Index (This : in Statement) return Vector_Index; + + not overriding + procedure Use_Vectors_Resize (This : in Statement; New_Size : in Natural); + + not overriding + procedure Set_Use_Vector_State + (This : in Statement; + Name : in String; + Index : in Vector_Index; + State : in Data_State); + + not overriding + procedure Set_Use_Vector_String + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in String); + + not overriding + procedure Set_Use_Vector_Integer + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Integer); + + not overriding + procedure Set_Use_Vector_Long_Long_Integer + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Long_Long_Integer); + + not overriding + procedure Set_Use_Vector_Long_Float + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Long_Float); + + not overriding + procedure Set_Use_Vector_Time + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in Ada.Calendar.Time); + + -- Inspection of single use elements. + -- + -- Note: Use elements can be modified by the database if they + -- are bound to out and inout parameters of stored procedures + -- (although this is not supported by all database backends). + -- This feature is available only for single use elements. + + not overriding + function Get_Use_State + (This : in Statement; + Name : in String) + return Data_State; + + not overriding + function Get_Use_String + (This : in Statement; + Name : in String) + return String; + + not overriding + function Get_Use_Integer + (This : in Statement; + Name : in String) + return DB_Integer; + + not overriding + function Get_Use_Long_Long_Integer + (This : in Statement; + Name : in String) + return DB_Long_Long_Integer; + + not overriding + function Get_Use_Long_Float + (This : in Statement; + Name : in String) + return DB_Long_Float; + + not overriding + function Get_Use_Time + (This : in Statement; + Name : in String) + return Ada.Calendar.Time; + +private + + -- Connection pool and supporting types. + + type Connection_Array is array (Positive range <>) of Session; + type Used_Array is array (Positive range <>) of Boolean; + + -- Protected state for the connection pool. + protected type Connection_Pool_PS (Size : Positive) is + + procedure Open (Position : in Positive; Connection_String : in String); + procedure Close (Position : in Positive); + + entry Lease (S : in out Session'Class); + procedure Give_Back (Position : in Positive); + + private + + Connections : Connection_Array (1 .. Size); + Is_Used : Used_Array (1 .. Size) := (others => False); + Available : Boolean := True; + + end Connection_Pool_PS; + type Connection_Pool_PS_Ptr is access all Connection_Pool_PS; + + type Connection_Pool (Size : Positive) is tagged limited record + Pool : aliased Connection_Pool_PS (Size); + end record; + + -- Session and supporting types. + + type Session_Handle is new System.Address; + + Null_Session_Handle : constant Session_Handle := + Session_Handle (System.Null_Address); + + type Session is new Ada.Finalization.Limited_Controlled with record + Handle : Session_Handle; + Initialized : Boolean := False; + Belongs_To_Pool : Boolean := False; + Pool : Connection_Pool_PS_Ptr; + Position_In_Pool : Positive; + end record; + + overriding + procedure Finalize (This : in out Session); + + -- Statement and supporting types. + + type Statement_Handle is new System.Address; + + Null_Statement_Handle : constant Statement_Handle := + Statement_Handle (System.Null_Address); + + type Statement is new Ada.Finalization.Limited_Controlled with record + Handle : Statement_Handle; + Initialized : Boolean := False; + end record; + + overriding + procedure Finalize (This : in out Statement); + + type Into_Position is new Natural; + +end SOCI; diff --git a/languages/ada/soci_ada.gpr b/languages/ada/soci_ada.gpr new file mode 100644 index 00000000..fe783c8d --- /dev/null +++ b/languages/ada/soci_ada.gpr @@ -0,0 +1,14 @@ +with "std_cpp.gpr"; +with "soci_core.gpr"; + +project SOCI_Ada is + for Source_Dirs use ("."); + for Object_Dir use "."; + for Library_Name use "soci_ada"; + for Library_Dir use "lib"; + for Library_Kind use "static"; + + package Compiler is + for Default_Switches ("Ada") use ("-gnat05", "-O2"); + end Compiler; +end SOCI_Ada; diff --git a/languages/ada/soci_core.gpr b/languages/ada/soci_core.gpr new file mode 100644 index 00000000..02837807 --- /dev/null +++ b/languages/ada/soci_core.gpr @@ -0,0 +1,7 @@ +project SOCI_Core is + for Externally_Built use "true"; + for Source_Dirs use (); + for Library_Dir use "../../core"; + for Library_Name use "soci_core"; + for Library_Kind use "static"; +end SOCI_Core; diff --git a/languages/ada/soci_postgresql.gpr b/languages/ada/soci_postgresql.gpr new file mode 100644 index 00000000..3ce31dbe --- /dev/null +++ b/languages/ada/soci_postgresql.gpr @@ -0,0 +1,8 @@ +project SOCI_PostgreSQL is + for Externally_Built use "true"; + for Source_Dirs use (); + for Library_Dir use "../../backends/postgresql"; + for Library_Name use "soci_postgresql"; + for Library_Kind use "static"; +end SOCI_PostgreSQL; + diff --git a/languages/ada/std_cpp.gpr b/languages/ada/std_cpp.gpr new file mode 100644 index 00000000..699a5adc --- /dev/null +++ b/languages/ada/std_cpp.gpr @@ -0,0 +1,7 @@ +project Std_Cpp is + for Externally_Built use "true"; + for Source_Dirs use (); + for Library_Dir use "."; + for Library_Name use "stdc++"; + for Library_Kind use "static"; +end Std_Cpp; diff --git a/languages/ada/test/postgresql_test.adb b/languages/ada/test/postgresql_test.adb new file mode 100644 index 00000000..0d671a48 --- /dev/null +++ b/languages/ada/test/postgresql_test.adb @@ -0,0 +1,609 @@ +with SOCI; +with SOCI.PostgreSQL; +with Ada.Text_IO; +with Ada.Calendar; +with Ada.Exceptions; +with Ada.Numerics.Discrete_Random; +with Ada.Command_Line; + +procedure PostgreSQL_Test is + + procedure Test_1 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing basic constructor function"); + + declare + S : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + null; + end; + exception + when E : SOCI.Database_Error => + Ada.Text_IO.Put_Line ("Database_Error: "); + Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Message (E)); + end Test_1; + + procedure Test_2 (Connection_String : in String) is + S : SOCI.Session; + begin + Ada.Text_IO.Put_Line ("testing open/close"); + + S.Close; + S.Open (Connection_String); + S.Close; + end Test_2; + + procedure Test_3 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing empty start/commit"); + + declare + S : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + S.Start; + S.Commit; + end; + end Test_3; + + procedure Test_4 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing simple statements"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + SQL.Execute ("create table ada_test ( i integer )"); + SQL.Execute ("drop table ada_test"); + end; + end Test_4; + + procedure Test_5 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing independent statements"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + St_1 : SOCI.Statement := SOCI.Make_Statement (SQL); + St_2 : SOCI.Statement := SOCI.Make_Statement (SQL); + begin + St_1.Prepare ("create table ada_test ( i integer )"); + St_2.Prepare ("drop table ada_test"); + St_1.Execute; + St_2.Execute; + end; + end Test_5; + + procedure Test_6 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing data types and into elements"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + Pos := St.Into_String; + St.Prepare ("select 'Hello'"); + St.Execute (True); + pragma Assert (St.Get_Into_String (Pos) = "Hello"); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + Value : SOCI.DB_Integer; + use type SOCI.DB_Integer; + begin + Pos := St.Into_Integer; + St.Prepare ("select 123"); + St.Execute (True); + Value := St.Get_Into_Integer (Pos); + pragma Assert (Value = 123); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + Value : SOCI.DB_Long_Long_Integer; + use type SOCI.DB_Long_Long_Integer; + begin + Pos := St.Into_Long_Long_Integer; + St.Prepare ("select 10000000000"); + St.Execute (True); + Value := St.Get_Into_Long_Long_Integer (Pos); + pragma Assert (Value = 10_000_000_000); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + Value : SOCI.DB_Long_Float; + use type SOCI.DB_Long_Float; + begin + Pos := St.Into_Long_Float; + St.Prepare ("select 3.625"); + St.Execute (True); + Value := St.Get_Into_Long_Float (Pos); + pragma Assert (Value = SOCI.DB_Long_Float (3.625)); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + Value : Ada.Calendar.Time; + begin + Pos := St.Into_Time; + St.Prepare ("select timestamp '2008-06-30 21:01:02'"); + St.Execute (True); + Value := St.Get_Into_Time (Pos); + pragma Assert (Ada.Calendar.Year (Value) = 2008); + pragma Assert (Ada.Calendar.Month (Value) = 6); + pragma Assert (Ada.Calendar.Day (Value) = 30); + pragma Assert + (Ada.Calendar.Seconds (Value) = + Ada.Calendar.Day_Duration (21 * 3_600 + 1 * 60 + 2)); + end; + end; + end Test_6; + + procedure Test_7 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing types with into vectors"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos_Id : SOCI.Into_Position; + Pos_Str : SOCI.Into_Position; + Pos_LL : SOCI.Into_Position; + Pos_LF : SOCI.Into_Position; + Pos_TM : SOCI.Into_Position; + + use type SOCI.Data_State; + use type Ada.Calendar.Time; + use type SOCI.DB_Integer; + use type SOCI.DB_Long_Long_Integer; + use type SOCI.DB_Long_Float; + + begin + SQL.Execute ("create table soci_test (" & + " id integer," & + " str varchar (20)," & + " ll bigint," & + " lf double precision," & + " tm timestamp" & + ")"); + SQL.Execute ("insert into soci_test (id, str, ll, lf, tm)" & + " values (1, 'abc', 10000000000, 3.0, timestamp '2008-06-30 21:01:02')"); + SQL.Execute ("insert into soci_test (id, str, ll, lf, tm)" & + " values (2, 'xyz', -10000000001, -3.125, timestamp '2008-07-01 21:01:03')"); + SQL.Execute ("insert into soci_test (id, str, ll, lf, tm)" & + " values (3, null, null, null, null)"); + + Pos_Id := St.Into_Vector_Integer; + Pos_Str := St.Into_Vector_String; + Pos_LL := St.Into_Vector_Long_Long_Integer; + Pos_LF := St.Into_Vector_Long_Float; + Pos_TM := St.Into_Vector_Time; + + St.Into_Vectors_Resize (10); -- arbitrary batch size + + St.Prepare ("select id, str, ll, lf, tm from soci_test order by id"); + St.Execute (True); + + pragma Assert (St.Get_Into_Vectors_Size = 3); + + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 0) = 1); + pragma Assert (St.Get_Into_Vector_State (Pos_Str, 0) = SOCI.Data_Not_Null); + pragma Assert (St.Get_Into_Vector_String (Pos_Str, 0) = "abc"); + pragma Assert (St.Get_Into_Vector_Long_Long_Integer (Pos_LL, 0) = 10_000_000_000); + pragma Assert (St.Get_Into_Vector_Long_Float (Pos_LF, 0) = SOCI.DB_Long_Float (3.0)); + pragma Assert (St.Get_Into_Vector_Time (Pos_TM, 0) = + Ada.Calendar.Time_Of (2008, 6, 30, + Duration (21 * 3_600 + 1 * 60 + 2))); + + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 1) = 2); + pragma Assert (St.Get_Into_Vector_State (Pos_Str, 1) = SOCI.Data_Not_Null); + pragma Assert (St.Get_Into_Vector_String (Pos_Str, 1) = "xyz"); + pragma Assert (St.Get_Into_Vector_Long_Long_Integer (Pos_LL, 1) = -10_000_000_001); + pragma Assert (St.Get_Into_Vector_Long_Float (Pos_LF, 1) = SOCI.DB_Long_Float (-3.125)); + pragma Assert (St.Get_Into_Vector_Time (Pos_TM, 1) = + Ada.Calendar.Time_Of (2008, 7, 1, + Duration (21 * 3_600 + 1 * 60 + 3))); + + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 2) = 3); + pragma Assert (St.Get_Into_Vector_State (Pos_Str, 2) = SOCI.Data_Null); + pragma Assert (St.Get_Into_Vector_State (Pos_LL, 2) = SOCI.Data_Null); + pragma Assert (St.Get_Into_Vector_State (Pos_LF, 2) = SOCI.Data_Null); + pragma Assert (St.Get_Into_Vector_State (Pos_TM, 2) = SOCI.Data_Null); + + SQL.Execute ("drop table soci_test"); + end; + end Test_7; + + procedure Test_8 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing multi-batch operation with into vectors"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos_Id : SOCI.Into_Position; + Got_Data : Boolean; + + use type SOCI.DB_Integer; + begin + SQL.Execute ("create table soci_test (" & + " id integer" & + ")"); + SQL.Execute ("insert into soci_test (id) values (1)"); + SQL.Execute ("insert into soci_test (id) values (2)"); + SQL.Execute ("insert into soci_test (id) values (3)"); + SQL.Execute ("insert into soci_test (id) values (4)"); + SQL.Execute ("insert into soci_test (id) values (5)"); + SQL.Execute ("insert into soci_test (id) values (6)"); + SQL.Execute ("insert into soci_test (id) values (7)"); + SQL.Execute ("insert into soci_test (id) values (8)"); + SQL.Execute ("insert into soci_test (id) values (9)"); + SQL.Execute ("insert into soci_test (id) values (10)"); + + Pos_Id := St.Into_Vector_Integer; + St.Into_Vectors_Resize (4); -- batch of 4 elements + + St.Prepare ("select id from soci_test order by id"); + St.Execute; + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Vectors_Size = 4); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 0) = 1); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 1) = 2); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 2) = 3); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 3) = 4); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Vectors_Size = 4); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 0) = 5); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 1) = 6); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 2) = 7); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 3) = 8); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Vectors_Size = 2); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 0) = 9); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 1) = 10); + + Got_Data := St.Fetch; + pragma Assert (not Got_Data); + pragma Assert (St.Get_Into_Vectors_Size = 0); + + SQL.Execute ("drop table soci_test"); + end; + end Test_8; + + procedure Test_9 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing data types and use elements"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + + use type SOCI.DB_Integer; + use type SOCI.DB_Long_Long_Integer; + use type SOCI.DB_Long_Float; + begin + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + St.Use_String ("value"); + St.Set_Use_String ("value", "123"); + Pos := St.Into_Integer; + St.Prepare ("select cast(:value as integer)"); + St.Execute (True); + pragma Assert (St.Get_Into_Integer (Pos) = 123); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + St.Use_Integer ("value"); + St.Set_Use_Integer ("value", 123); + Pos := St.Into_String; + St.Prepare ("select cast(:value as text)"); + St.Execute (True); + pragma Assert (St.Get_Into_String (Pos) = "123"); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + St.Use_Long_Long_Integer ("value"); + St.Set_Use_Long_Long_Integer ("value", 10_000_000_000); + Pos := St.Into_String; + St.Prepare ("select cast(:value as text)"); + St.Execute (True); + pragma Assert (St.Get_Into_String (Pos) = "10000000000"); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + St.Use_Long_Float ("value"); + St.Set_Use_Long_Float ("value", SOCI.DB_Long_Float (5.625)); + Pos := St.Into_String; + St.Prepare ("select cast(:value as text)"); + St.Execute (True); + pragma Assert (St.Get_Into_String (Pos) = "5.625"); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + St.Use_Time ("value"); + St.Set_Use_Time ("value", Ada.Calendar.Time_Of + (2008, 7, 1, Ada.Calendar.Day_Duration (3723))); + Pos := St.Into_String; + St.Prepare ("select cast(:value as text)"); + St.Execute (True); + pragma Assert (St.Get_Into_String (Pos) = "2008-07-01 01:02:03"); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + use type SOCI.Data_State; + begin + St.Use_Integer ("value"); + St.Set_Use_State ("value", SOCI.Data_Null); + Pos := St.Into_Integer; + St.Prepare ("select cast(:value as integer)"); + St.Execute (True); + pragma Assert (St.Get_Into_State (Pos) = SOCI.Data_Null); + end; + end; + end Test_9; + + procedure Test_10 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing vector use elements and row traversal with single into elements"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + + Time_1 : constant Ada.Calendar.Time := Ada.Calendar.Time_Of + (2008, 7, 1, Ada.Calendar.Day_Duration (1)); + Time_2 : constant Ada.Calendar.Time := Ada.Calendar.Time_Of + (2008, 7, 2, Ada.Calendar.Day_Duration (2)); + Time_3 : constant Ada.Calendar.Time := Ada.Calendar.Time_Of + (2008, 7, 3, Ada.Calendar.Day_Duration (3)); + Time_4 : constant Ada.Calendar.Time := Ada.Calendar.Time_Of + (2008, 7, 4, Ada.Calendar.Day_Duration (4)); + Time_5 : constant Ada.Calendar.Time := Ada.Calendar.Time_Of + (2008, 7, 5, Ada.Calendar.Day_Duration (5)); + + begin + SQL.Execute ("create table soci_test (" & + " id integer," & + " str varchar (20)," & + " ll bigint," & + " lf double precision," & + " tm timestamp" & + ")"); + + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + begin + St.Use_Vector_Integer ("id"); + St.Use_Vector_String ("str"); + St.Use_Vector_Long_Long_Integer ("ll"); + St.Use_Vector_Long_Float ("lf"); + St.Use_Vector_Time ("tm"); + + St.Use_Vectors_Resize (6); + St.Set_Use_Vector_Integer ("id", 0, 1); + St.Set_Use_Vector_Integer ("id", 1, 2); + St.Set_Use_Vector_Integer ("id", 2, 3); + St.Set_Use_Vector_Integer ("id", 3, 4); + St.Set_Use_Vector_Integer ("id", 4, 5); + St.Set_Use_Vector_Integer ("id", 5, 6); + St.Set_Use_Vector_String ("str", 0, "abc"); + St.Set_Use_Vector_String ("str", 1, "def"); + St.Set_Use_Vector_String ("str", 2, "ghi"); + St.Set_Use_Vector_String ("str", 3, "jklm"); + St.Set_Use_Vector_String ("str", 4, "no"); + St.Set_Use_Vector_State ("str", 5, SOCI.Data_Null); + St.Set_Use_Vector_Long_Long_Integer ("ll", 0, 10_000_000_000); + St.Set_Use_Vector_Long_Long_Integer ("ll", 1, 10_000_000_001); + St.Set_Use_Vector_Long_Long_Integer ("ll", 2, 10_000_000_002); + St.Set_Use_Vector_Long_Long_Integer ("ll", 3, 10_000_000_003); + St.Set_Use_Vector_Long_Long_Integer ("ll", 4, 10_000_000_004); + St.Set_Use_Vector_State ("ll", 5, SOCI.Data_Null); + St.Set_Use_Vector_Long_Float ("lf", 0, SOCI.DB_Long_Float (0.0)); + St.Set_Use_Vector_Long_Float ("lf", 1, SOCI.DB_Long_Float (0.125)); + St.Set_Use_Vector_Long_Float ("lf", 2, SOCI.DB_Long_Float (0.25)); + St.Set_Use_Vector_Long_Float ("lf", 3, SOCI.DB_Long_Float (0.5)); + St.Set_Use_Vector_Long_Float ("lf", 4, SOCI.DB_Long_Float (0.625)); + St.Set_Use_Vector_State ("lf", 5, SOCI.Data_Null); + St.Set_Use_Vector_Time ("tm", 0, Time_1); + St.Set_Use_Vector_Time ("tm", 1, Time_2); + St.Set_Use_Vector_Time ("tm", 2, Time_3); + St.Set_Use_Vector_Time ("tm", 3, Time_4); + St.Set_Use_Vector_Time ("tm", 4, Time_5); + St.Set_Use_Vector_State ("tm", 5, SOCI.Data_Null); + + St.Prepare ("insert into soci_test (id, str, ll, lf, tm)" & + " values (:id, :str, :ll, :lf, :tm)"); + St.Execute (True); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos_Id : SOCI.Into_Position; + Pos_Str : SOCI.Into_Position; + Pos_LL : SOCI.Into_Position; + Pos_LF : SOCI.Into_Position; + Pos_TM : SOCI.Into_Position; + Got_Data : Boolean; + + use type Ada.Calendar.Time; + use type SOCI.Data_State; + use type SOCI.DB_Integer; + use type SOCI.DB_Long_Long_Integer; + use type SOCI.DB_Long_Float; + + begin + Pos_Id := St.Into_Integer; + Pos_Str := St.Into_String; + Pos_LL := St.Into_Long_Long_Integer; + Pos_LF := St.Into_Long_Float; + Pos_TM := St.Into_Time; + + St.Prepare ("select id, str, ll, lf, tm from soci_test order by id"); + St.Execute; + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 1); + pragma Assert (St.Get_Into_String (Pos_Str) = "abc"); + pragma Assert (St.Get_Into_Long_Long_Integer (Pos_LL) = 10_000_000_000); + pragma Assert (St.Get_Into_Long_Float (Pos_LF) = SOCI.DB_Long_Float (0.0)); + pragma Assert (St.Get_Into_Time (Pos_TM) = Time_1); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 2); + pragma Assert (St.Get_Into_String (Pos_Str) = "def"); + pragma Assert (St.Get_Into_Long_Long_Integer (Pos_LL) = 10_000_000_001); + pragma Assert (St.Get_Into_Long_Float (Pos_LF) = SOCI.DB_Long_Float (0.125)); + pragma Assert (St.Get_Into_Time (Pos_TM) = Time_2); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 3); + pragma Assert (St.Get_Into_String (Pos_Str) = "ghi"); + pragma Assert (St.Get_Into_Long_Long_Integer (Pos_LL) = 10_000_000_002); + pragma Assert (St.Get_Into_Long_Float (Pos_LF) = SOCI.DB_Long_Float (0.25)); + pragma Assert (St.Get_Into_Time (Pos_TM) = Time_3); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 4); + pragma Assert (St.Get_Into_String (Pos_Str) = "jklm"); + pragma Assert (St.Get_Into_Long_Long_Integer (Pos_LL) = 10_000_000_003); + pragma Assert (St.Get_Into_Long_Float (Pos_LF) = SOCI.DB_Long_Float (0.5)); + pragma Assert (St.Get_Into_Time (Pos_TM) = Time_4); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 5); + pragma Assert (St.Get_Into_String (Pos_Str) = "no"); + pragma Assert (St.Get_Into_Long_Long_Integer (Pos_LL) = 10_000_000_004); + pragma Assert (St.Get_Into_Long_Float (Pos_LF) = SOCI.DB_Long_Float (0.625)); + pragma Assert (St.Get_Into_Time (Pos_TM) = Time_5); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_State (Pos_Id) = SOCI.Data_Not_Null); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 6); + pragma Assert (St.Get_Into_State (Pos_Str) = SOCI.Data_Null); + pragma Assert (St.Get_Into_State (Pos_LL) = SOCI.Data_Null); + pragma Assert (St.Get_Into_State (Pos_LF) = SOCI.Data_Null); + pragma Assert (St.Get_Into_State (Pos_TM) = SOCI.Data_Null); + + Got_Data := St.Fetch; + pragma Assert (not Got_Data); + end; + + SQL.Execute ("drop table soci_test"); + end; + end Test_10; + + procedure Test_11 (Connection_String : in String) is + + -- test parameters: + Pool_Size : constant := 3; + Number_Of_Tasks : constant := 10; + Iterations_Per_Task : constant := 1000; + + type Small_Integer is mod 20; + package My_Random is new Ada.Numerics.Discrete_Random (Small_Integer); + Rand : My_Random.Generator; + + Pool : SOCI.Connection_Pool (Pool_Size); + + begin + Ada.Text_IO.Put_Line ("testing connection pool"); + + My_Random.Reset (Rand); + + for I in 1 .. Pool_Size loop + Pool.Open (I, Connection_String); + end loop; + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + SQL.Execute ("create table soci_test ( id integer )"); + end; + + declare + + task type Worker; + task body Worker is + begin + + for I in 1 .. Iterations_Per_Task loop + declare + SQL : SOCI.Session; + V : Small_Integer; + begin + Pool.Lease (SQL); + + V := My_Random.Random (Rand); + SQL.Execute ("insert into soci_test (id) values (" & + Small_Integer'Image (V) & ")"); + end; + end loop; + exception + when others => + Ada.Text_IO.Put_Line ("An exception occured in the worker task."); + end Worker; + + W : array (1 .. Number_Of_Tasks) of Worker; + + begin + Ada.Text_IO.Put_Line ("--> waiting for the tasks to complete (might take a while)"); + end; + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + SQL.Execute ("drop table soci_test"); + end; + end Test_11; + +begin + if Ada.Command_Line.Argument_Count /= 1 then + Ada.Text_IO.Put_Line ("Expecting one argument: connection string"); + return; + end if; + + declare + Connection_String : String := Ada.Command_Line.Argument (1); + begin + Ada.Text_IO.Put_Line ("testing with " & Connection_String); + + SOCI.PostgreSQL.Register_Factory_PostgreSQL; + + Test_1 (Connection_String); + Test_2 (Connection_String); + Test_3 (Connection_String); + Test_4 (Connection_String); + Test_5 (Connection_String); + Test_6 (Connection_String); + Test_7 (Connection_String); + Test_8 (Connection_String); + Test_9 (Connection_String); + Test_10 (Connection_String); + Test_11 (Connection_String); + end; +end PostgreSQL_Test; diff --git a/languages/ada/test/postgresql_test.gpr b/languages/ada/test/postgresql_test.gpr new file mode 100644 index 00000000..1af59d32 --- /dev/null +++ b/languages/ada/test/postgresql_test.gpr @@ -0,0 +1,12 @@ +with "../soci_ada.gpr"; +with "../soci_postgresql.gpr"; +with "../postgresql_client.gpr"; + +project PostgreSQL_Test is + for Main use ("postgresql_test"); + + package Compiler is + for Default_Switches ("Ada") use ("-gnat05", "-gnata"); + end Compiler; +end PostgreSQL_Test; + From 445a33d2e8dc008c505c91a86ace7600daedc0fd Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 3 Jul 2011 17:35:27 +0200 Subject: [PATCH 16/19] [Build] Integrated latest changes (=> ~3.1.0 version). --- CHANGES | 65 + CMakeLists.txt | 24 + TODO | 2 - autogen.sh | 69 - backends/odbc/standard-use-type.cpp | 4 +- backends/odbc/vector-into-type.cpp | 6 + backends/odbc/vector-use-type.cpp | 4 + backends/oracle/standard-into-type.cpp | 12 +- backends/oracle/standard-use-type.cpp | 22 +- backends/oracle/statement.cpp | 3 +- backends/oracle/vector-into-type.cpp | 50 +- backends/oracle/vector-use-type.cpp | 43 +- backends/postgresql/Makefile.basic | 49 +- backends/postgresql/error.cpp | 48 + backends/postgresql/error.h | 32 + backends/postgresql/session.cpp | 4 +- backends/postgresql/soci-postgresql.h | 12 + backends/postgresql/statement.cpp | 21 +- backends/postgresql/test/test-postgresql.cpp | 2 +- cmake/SociVersion.cmake | 59 + cmake/modules/FindODBC.cmake | 57 + cmake/modules/FindSoci.cmake | 100 ++ core/Makefile.basic | 7 +- core/backend-loader.cpp | 15 +- core/test/common-tests.h | 2 +- core/version.h | 32 + languages/ada/postgresql_client.gpr | 8 + languages/ada/soci-mysql.ads | 16 + languages/ada/soci-oracle.ads | 16 + languages/ada/soci-postgresql.ads | 16 + languages/ada/soci.adb | 1465 ++++++++++++++++++ languages/ada/soci.ads | 486 ++++++ languages/ada/soci_ada.gpr | 14 + languages/ada/soci_core.gpr | 7 + languages/ada/soci_postgresql.gpr | 8 + languages/ada/std_cpp.gpr | 7 + languages/ada/test/postgresql_test.adb | 609 ++++++++ languages/ada/test/postgresql_test.gpr | 12 + 38 files changed, 3300 insertions(+), 108 deletions(-) delete mode 100755 autogen.sh create mode 100644 backends/postgresql/error.cpp create mode 100644 backends/postgresql/error.h create mode 100644 cmake/SociVersion.cmake create mode 100644 cmake/modules/FindODBC.cmake create mode 100644 cmake/modules/FindSoci.cmake create mode 100644 core/version.h create mode 100644 languages/ada/postgresql_client.gpr create mode 100644 languages/ada/soci-mysql.ads create mode 100644 languages/ada/soci-oracle.ads create mode 100644 languages/ada/soci-postgresql.ads create mode 100644 languages/ada/soci.adb create mode 100644 languages/ada/soci.ads create mode 100644 languages/ada/soci_ada.gpr create mode 100644 languages/ada/soci_core.gpr create mode 100644 languages/ada/soci_postgresql.gpr create mode 100644 languages/ada/std_cpp.gpr create mode 100644 languages/ada/test/postgresql_test.adb create mode 100644 languages/ada/test/postgresql_test.gpr diff --git a/CHANGES b/CHANGES index a4bb1d84..901fc822 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,70 @@ This file contains the history of changes in the SOCI library. +--- +Version 3.1.0 differs from 3.0.0 in the following ways: + + TODO - to be reviewed + +- Added Ada language binding + +- Migraded build system from GNU Autotools and Visual Studio projects to CMake + +- CMake build tested with Visual Studio, GCC and clang + +- Incorporated a compromise for naming versioned shared libraries + +- Enhanced and improved integration with Boost libraries: +-- Boost.DateTime +-- Boost.Fusion +-- Boost.Optional +-- Boost.Tuple + +- Bug fixes and improvements in core and backends: +-- Added soci::values::get_properties accessor useful for composing soci::type_conversion +-- Export advanced API of backend loader from DLL. +-- Added static factory registration functions for backends +-- Added get_affected_rows operation +-- Fixed thread-safety of connection pool under Windows +-- Fixed bug with droping const qualifiers when binding to std::vector +-- Fixed bug in default initialization of an object of const backend_factory wihch requires user-provided default constructor (see C++03/C++0x) +-- Fixes for 64-bit builds +-- Removed redundant exchange_traits breaking ODR on LP64 +-- Better ODBC support +-- Type conversion support for unsigned integer types +-- Bug ID:1971436 - incorrect rowset copy operations +-- Bug ID:2010367 - memory leak (ODBC) +-- Bug ID:2010409 - invalid memory allocaton in define by position (ODBC) +-- Bug ID:2021243 - long long type support in Visual C++ +-- Patch ID:2483066 - 64bit Linux and 64bit integer submitted +-- Patch ID:2809809 - Fix build with GCC 4.4 +-- Patch ID:2809810 - Fix SQLite3 build with GCC 4.3 +-- Patch ID:2581206 - Windows unicode application +-- Patch ID:3058275 - install target for cmake build submitted +-- Patch ID:3069375 - use $(prefix)/lib64 on AMD64 platforms. +-- Improved performance while accessing query results (MySQL) +-- Bug fixes for PROCEDURE support (MySQL) +-- Removed throw statements from mysql_rowid_backend and mysql_blob_backend destructors (MySQL) +-- Verify that prepared statements survive session::reconnect() operatoin (MySQL) +-- Improved support for time and date (MySQL, PostgreSQL) +-- Fixed bug with strings of length exceeding 255 characters (ODBC) +-- Improved interpretation of the connect string (Oracle) +-- Added handling of unsigned long long (Oracle, SQLite3, PostgreSQL) +-- Fixes in integral types support (PostgreSQL) +-- Support for colon-casts (PostgreSQL) +-- Added possibility for use BLOB (PostgreSQL) +-- Added support for connection property "synchronous=on|off" (SQLite3) +-- Improved BLOB data handling (SQLite3) +-- Improved boolean type suppport (SQLite3) +-- Session timeout support (SQLite3) +-- Improved tests clean-up (SQLite3) +-- Added missing typedef of sqlite3_destructor_type which has been defined in sqlite3.h but since 3.3.10 (see comment for reference to SQLite ticket) + +- Updated tests for various backends and SQL data types + +- Migrated from CVS to Git repository + +- Changed naming convensions and style across all the source code + --- Version 3.0.0 differs from 2.2.0 in the following ways: diff --git a/CMakeLists.txt b/CMakeLists.txt index f654e24e..9dd12414 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,28 @@ # +# This file is part of CMake configuration for SOCI library +# +# Copyright (C) 2009-2010 Mateusz Loskot +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# +################################################################################# +# General settings +################################################################################# +cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) + +project(SOCI) + +################################################################################# +# SOCI CMake modules +################################################################################# + +# Path to additional CMake modules +set(CMAKE_MODULE_PATH ${SOCI_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) +set(CMAKE_MODULE_PATH ${SOCI_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) + +include(SociUtilities) + message(STATUS "") # diff --git a/TODO b/TODO index 31cf44b6..e69de29b 100644 --- a/TODO +++ b/TODO @@ -1,2 +0,0 @@ -1. [PostgreSQL] statement.cpp:197, re-declare vector of input parameters should -with const char* elements instead of non-const. diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index db532084..00000000 --- a/autogen.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# $Id: autogen.sh,v 1.3 2008/05/28 20:05:17 mloskot Exp $ -# -# Run this to generate all the initial makefiles, etc. -# This was lifted from the Gimp, and adapted slightly -# by Raph Levien -# -# Customized for C++/Tk by Mateusz Loskot -# -DIE=0 - -PROJECT="SOCI" - -for libtoolize in glibtoolize libtoolize; do - LIBTOOLIZE=`which $libtoolize 2>/dev/null` - if test -x "$LIBTOOLIZE"; then - break; - fi -done - -if test -d "autom4te.cache"; then - rm -rf autom4te.cache -fi - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have autoconf installed to compile $PROJECT." - echo "Get latest version from ftp://ftp.gnu.org/pub/gnu/autoconf/" - DIE=1 -} - -($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have libtool installed to compile $PROJECT." - echo "Get latest version from ftp://ftp.gnu.org/pub/gnu/libtool/" - DIE=1 -} - -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have automake installed to compile $PROJECT." - echo "Get latest version from ftp://ftp.gnu.org/pub/gnu/automake/" - DIE=1 -} - -(aclocal --version) < /dev/null > /dev/null 2>&1 || { - echo "Error:" - echo "You must have aclocal installed to compile $PROJECT." - echo "aclocal is installed together with automake, so" - echo "get latest version from ftp://ftp.gnu.org/pub/gnu/automake/" - DIE=1 -} -if test "$DIE" -eq 1; then - exit 1 -fi - -echo "Running aclocal..." -aclocal -I ../build/m4 -echo "Running libtoolize..." -$LIBTOOLIZE --force --copy -echo "Running automake..." -automake --add-missing --copy -echo "Running autoconf..." -autoconf - -echo -echo "Now type './configure' to generate Makefile files for $PROJECT." -echo "Run './configure --help' to get list of possible options." - diff --git a/backends/odbc/standard-use-type.cpp b/backends/odbc/standard-use-type.cpp index 1edc025f..8c572ce1 100644 --- a/backends/odbc/standard-use-type.cpp +++ b/backends/odbc/standard-use-type.cpp @@ -97,7 +97,9 @@ void odbc_standard_use_type_backend::prepare_for_bind( case x_statement: case x_rowid: break; - } + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported + } } void odbc_standard_use_type_backend::bind_helper(int &position, void *data, exchange_type type) diff --git a/backends/odbc/vector-into-type.cpp b/backends/odbc/vector-into-type.cpp index cd49591e..c43dbc5c 100644 --- a/backends/odbc/vector-into-type.cpp +++ b/backends/odbc/vector-into-type.cpp @@ -136,6 +136,8 @@ void odbc_vector_into_type_backend::define_by_pos( case x_statement: break; // not supported case x_rowid: break; // not supported case x_blob: break; // not supported + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported } SQLRETURN rc = SQLBindCol(statement_.hstmt_, static_cast(position++), @@ -312,6 +314,8 @@ void odbc_vector_into_type_backend::resize(std::size_t sz) case x_statement: break; // not supported case x_rowid: break; // not supported case x_blob: break; // not supported + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported } } @@ -371,6 +375,8 @@ std::size_t odbc_vector_into_type_backend::size() case x_statement: break; // not supported case x_rowid: break; // not supported case x_blob: break; // not supported + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported } return sz; diff --git a/backends/odbc/vector-use-type.cpp b/backends/odbc/vector-use-type.cpp index 32e142e1..ebefd1c4 100644 --- a/backends/odbc/vector-use-type.cpp +++ b/backends/odbc/vector-use-type.cpp @@ -165,6 +165,8 @@ void odbc_vector_use_type_backend::prepare_for_bind(void *&data, SQLUINTEGER &si case x_statement: break; // not supported case x_rowid: break; // not supported case x_blob: break; // not supported + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported } colSize_ = size; @@ -365,6 +367,8 @@ std::size_t odbc_vector_use_type_backend::size() case x_statement: break; // not supported case x_rowid: break; // not supported case x_blob: break; // not supported + case x_long_long: break; // TODO: verify if can be supported + case x_unsigned_long_long: break; // TODO: verify if can be supported } return sz; diff --git a/backends/oracle/standard-into-type.cpp b/backends/oracle/standard-into-type.cpp index f2bbdcdb..6c0bd1a7 100644 --- a/backends/oracle/standard-into-type.cpp +++ b/backends/oracle/standard-into-type.cpp @@ -6,17 +6,18 @@ // #define SOCI_ORACLE_SOURCE -#include "error.h" // #if defined(SOCI_HEADERS_BURIED) # include # include +# include # include # include # include #else # include # include +# include # include # include # include @@ -96,6 +97,7 @@ void oracle_standard_into_type_backend::define_by_pos( // cases that require adjustments and buffer management case x_long_long: + case x_unsigned_long_long: oracleType = SQLT_STR; size = 100; // arbitrary buffer length buf_ = new char[size]; @@ -201,6 +203,14 @@ void oracle_standard_into_type_backend::post_fetch( *v = strtoll(buf_, NULL, 10); } } + else if (type_ == x_unsigned_long_long) + { + if (indOCIHolder_ != -1) + { + unsigned long long *v = static_cast(data_); + *v = strtoull(buf_, NULL, 10); + } + } else if (type_ == x_stdtm) { if (indOCIHolder_ != -1) diff --git a/backends/oracle/standard-use-type.cpp b/backends/oracle/standard-use-type.cpp index d490def6..182a3906 100644 --- a/backends/oracle/standard-use-type.cpp +++ b/backends/oracle/standard-use-type.cpp @@ -6,17 +6,18 @@ // #define SOCI_ORACLE_SOURCE -#include "error.h" // #if defined(SOCI_HEADERS_BURIED) # include # include +# include # include # include # include #else # include # include +# include # include # include # include @@ -94,6 +95,7 @@ void oracle_standard_use_type_backend::prepare_for_bind( // cases that require adjustments and buffer management case x_long_long: + case x_unsigned_long_long: oracleType = SQLT_STR; size = 100; // arbitrary buffer length buf_ = new char[size]; @@ -252,6 +254,12 @@ void oracle_standard_use_type_backend::pre_use(indicator const *ind) snprintf(buf_, size, "%lld", *static_cast(data_)); } break; + case x_unsigned_long_long: + { + size_t const size = 100; // arbitrary, but consistent with prepare_for_bind + snprintf(buf_, size, "%llu", *static_cast(data_)); + } + break; case x_double: if (readOnly_) { @@ -383,6 +391,18 @@ void oracle_standard_use_type_backend::post_use(bool gotData, indicator *ind) } } break; + case x_unsigned_long_long: + if (readOnly_) + { + unsigned long long const original = *static_cast(data_); + unsigned long long const bound = strtoull(buf_, NULL, 10); + + if (original != bound) + { + throw soci_error("Attempted modification of const use element"); + } + } + break; case x_double: if (readOnly_) { diff --git a/backends/oracle/statement.cpp b/backends/oracle/statement.cpp index 570f3fa0..76977c4c 100644 --- a/backends/oracle/statement.cpp +++ b/backends/oracle/statement.cpp @@ -6,12 +6,13 @@ // #define SOCI_ORACLE_SOURCE -#include "error.h" // #if defined(SOCI_HEADERS_BURIED) +# include # include # include #else +# include # include # include #endif diff --git a/backends/oracle/vector-into-type.cpp b/backends/oracle/vector-into-type.cpp index 194ac764..13db4406 100644 --- a/backends/oracle/vector-into-type.cpp +++ b/backends/oracle/vector-into-type.cpp @@ -6,14 +6,15 @@ // #define SOCI_ORACLE_SOURCE -#include "error.h" // #if defined(SOCI_HEADERS_BURIED) # include +# include # include # include #else # include +# include # include # include #endif @@ -128,6 +129,21 @@ void oracle_vector_into_type_backend::define_by_pos( data = buf_; } break; + case x_unsigned_long_long: + { + oracleType = SQLT_STR; + std::vector *v + = static_cast *>(data); + colSize_ = 100; // arbitrary buffer size for each entry + std::size_t const bufSize = colSize_ * v->size(); + buf_ = new char[bufSize]; + + prepare_indicators(v->size()); + + size = static_cast(colSize_); + data = buf_; + } + break; case x_stdstring: { oracleType = SQLT_CHR; @@ -222,6 +238,24 @@ void oracle_vector_into_type_backend::post_fetch(bool gotData, indicator *ind) pos += colSize_; } } + else if (type_ == x_unsigned_long_long) + { + std::vector *vp + = static_cast *>(data_); + + std::vector &v(*vp); + + char *pos = buf_; + std::size_t const vsize = v.size(); + for (std::size_t i = 0; i != vsize; ++i) + { + if (indOCIHolderVec_[i] != -1) + { + v[i] = strtoull(pos, NULL, 10); + } + pos += colSize_; + } + } else if (type_ == x_stdtm) { std::vector *vp @@ -339,6 +373,13 @@ void oracle_vector_into_type_backend::resize(std::size_t sz) v->resize(sz); } break; + case x_unsigned_long_long: + { + std::vector *v + = static_cast *>(data_); + v->resize(sz); + } + break; case x_double: { std::vector *v @@ -405,6 +446,13 @@ std::size_t oracle_vector_into_type_backend::size() sz = v->size(); } break; + case x_unsigned_long_long: + { + std::vector *v + = static_cast *>(data_); + sz = v->size(); + } + break; case x_double: { std::vector *v diff --git a/backends/oracle/vector-use-type.cpp b/backends/oracle/vector-use-type.cpp index 80c226eb..0107b427 100644 --- a/backends/oracle/vector-use-type.cpp +++ b/backends/oracle/vector-use-type.cpp @@ -6,12 +6,13 @@ // #define SOCI_ORACLE_SOURCE -#include "error.h" // #if defined(SOCI_HEADERS_BURIED) +# include # include # include #else +# include # include # include #endif @@ -120,6 +121,24 @@ void oracle_vector_use_type_backend::prepare_for_bind( prepare_indicators(vecSize); } break; + case x_unsigned_long_long: + { + std::vector *vp + = static_cast *>(data); + std::vector &v(*vp); + + std::size_t const vecSize = v.size(); + std::size_t const entrySize = 100; // arbitrary + std::size_t const bufSize = entrySize * vecSize; + buf_ = new char[bufSize]; + + oracleType = SQLT_STR; + data = buf_; + size = entrySize; + + prepare_indicators(vecSize); + } + break; case x_stdstring: { std::vector *vp @@ -251,6 +270,21 @@ void oracle_vector_use_type_backend::pre_use(indicator const *ind) pos += entrySize; } } + else if (type_ == x_unsigned_long_long) + { + std::vector *vp + = static_cast *>(data_); + std::vector &v(*vp); + + char *pos = buf_; + std::size_t const entrySize = 100; // arbitrary, but consistent + std::size_t const vecSize = v.size(); + for (std::size_t i = 0; i != vecSize; ++i) + { + snprintf(pos, entrySize, "%llu", v[i]); + pos += entrySize; + } + } else if (type_ == x_stdtm) { std::vector *vp @@ -336,6 +370,13 @@ std::size_t oracle_vector_use_type_backend::size() sz = vp->size(); } break; + case x_unsigned_long_long: + { + std::vector *vp + = static_cast *>(data_); + sz = vp->size(); + } + break; case x_double: { std::vector *vp diff --git a/backends/postgresql/Makefile.basic b/backends/postgresql/Makefile.basic index 429d4399..01a70fca 100644 --- a/backends/postgresql/Makefile.basic +++ b/backends/postgresql/Makefile.basic @@ -2,20 +2,32 @@ # values might depend on your environment - feel free to set it accordingly. PGSQLINCLUDEDIR = -I/usr/include +PGSQLLIBDIR = -L/usr/lib +PGSQLLIBS = -lpq # The rest of the Makefile is indepentent of the target environment. COMPILER = g++ CXXFLAGS = -Wall -pedantic -Wno-long-long -CXXFLAGSSO = ${CXXFLAGS} -fPIC +SHARED_CXXFLAGS = ${CXXFLAGS} -fPIC INCLUDEDIRS = -I../../core ${PGSQLINCLUDEDIR} +SHARED_LIBDIRS = ${PGSQLLIBDIR} +SHARED_LIBS = ${PGSQLLIBS} ../../core/libsoci_core.a -OBJECTS = blob.o factory.o row-id.o session.o standard-into-type.o \ +UNAME = $(shell uname) +ifeq ($(UNAME),Darwin) + SHARED_LINK_FLAGS = -dynamiclib -flat_namespace -undefined suppress +else + SHARED_LINK_FLAGS = -shared +endif + + +OBJECTS = blob.o error.o factory.o row-id.o session.o standard-into-type.o \ standard-use-type.o statement.o vector-into-type.o vector-use-type.o \ common.o -OBJECTSSO = blob-s.o factory-s.o row-id-s.o session-s.o \ +SHARED_OBJECTS = blob-s.o error-s.o factory-s.o row-id-s.o session-s.o \ standard-into-type-s.o standard-use-type-s.o statement-s.o \ vector-into-type-s.o vector-use-type-s.o common-s.o @@ -28,6 +40,9 @@ libsoci_postgresql.a : ${OBJECTS} blob.o : blob.cpp ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} +error.o : error.cpp + ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + common.o : common.cpp ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} @@ -56,39 +71,43 @@ vector-use-type.o : vector-use-type.cpp ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} -shared : ${OBJECTSSO} - ${COMPILER} -shared -o libsoci_postgresql.so ${OBJECTSSO} +shared : ${SHARED_OBJECTS} + ${COMPILER} ${SHARED_LINK_FLAGS} -o libsoci_postgresql.so \ + ${SHARED_OBJECTS} ${SHARED_LIBDIRS} ${SHARED_LIBS} rm *.o blob-s.o : blob.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} + +error-s.o : error.cpp + ${COMPILER} -c -o $@ $? ${CXXFLAGS} ${INCLUDEDIRS} common-s.o : common.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} factory-s.o : factory.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} row-id-s.o : row-id.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} session-s.o : session.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} standard-into-type-s.o : standard-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} standard-use-type-s.o : standard-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} statement-s.o : statement.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} vector-into-type-s.o : vector-into-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} vector-use-type-s.o : vector-use-type.cpp - ${COMPILER} -c -o $@ $? ${CXXFLAGSSO} ${INCLUDEDIRS} + ${COMPILER} -c -o $@ $? ${SHARED_CXXFLAGS} ${INCLUDEDIRS} clean : diff --git a/backends/postgresql/error.cpp b/backends/postgresql/error.cpp new file mode 100644 index 00000000..5f29c601 --- /dev/null +++ b/backends/postgresql/error.cpp @@ -0,0 +1,48 @@ +// +// Copyright (C) 2011 Gevorg Voskanyan +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#define SOCI_POSTGRESQL_SOURCE +#include "soci-postgresql.h" +#include "error.h" +#include +#include + +using namespace soci; +using namespace soci::details; +using namespace soci::details::postgresql; + +postgresql_soci_error::postgresql_soci_error( + std::string const & msg, char const *sqlst) + : soci_error(msg) +{ + assert(std::strlen(sqlst) == 5); + std::memcpy(sqlstate_, sqlst, 5); +} + +std::string postgresql_soci_error::sqlstate() const +{ + return std::string(sqlstate_, 5); +} + +void soci::details::postgresql::get_error_details(PGresult *res, + std::string &msg, std::string &sqlstate) +{ + msg = PQresultErrorMessage(res); + const char *sqlst = PQresultErrorField(res, PG_DIAG_SQLSTATE); + assert(sqlst); + assert(std::strlen(sqlst) == 5); + sqlstate.assign(sqlst, 5); +} + +void soci::details::postgresql::throw_postgresql_soci_error(PGresult *res) +{ + std::string msg; + std::string sqlstate; + + get_error_details(res, msg, sqlstate); + throw postgresql_soci_error(msg, sqlstate.c_str()); +} diff --git a/backends/postgresql/error.h b/backends/postgresql/error.h new file mode 100644 index 00000000..22e8394d --- /dev/null +++ b/backends/postgresql/error.h @@ -0,0 +1,32 @@ +// +// Copyright (C) 2011 Gevorg Voskanyan +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_POSTGRESQL_ERROR_H_INCLUDED +#define SOCI_POSTGRESQL_ERROR_H_INCLUDED + +#include "soci-postgresql.h" + +namespace soci +{ + +namespace details +{ + +namespace postgresql +{ + +void throw_postgresql_soci_error(PGresult *res); + +void get_error_details(PGresult *res, std::string &msg, std::string &sqlstate); + +} // namespace postgresql + +} // namespace details + +} // namespace soci + +#endif diff --git a/backends/postgresql/session.cpp b/backends/postgresql/session.cpp index 5c703565..5de875d7 100644 --- a/backends/postgresql/session.cpp +++ b/backends/postgresql/session.cpp @@ -7,6 +7,7 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" +#include "error.h" #include // libpq #include #include @@ -24,6 +25,7 @@ using namespace soci; using namespace soci::details; +using namespace soci::details::postgresql; postgresql_session_backend::postgresql_session_backend(std::string const& connectString) : statementCount_(0) @@ -66,7 +68,7 @@ void hard_exec(PGconn * conn, char const * query, char const * errMsg) ExecStatusType const status = PQresultStatus(result); if (PGRES_COMMAND_OK != status) { - throw soci_error(PQresultErrorMessage(result)); + throw_postgresql_soci_error(result); } PQclear(result); diff --git a/backends/postgresql/soci-postgresql.h b/backends/postgresql/soci-postgresql.h index 22b74927..e31f0557 100644 --- a/backends/postgresql/soci-postgresql.h +++ b/backends/postgresql/soci-postgresql.h @@ -1,5 +1,6 @@ // // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton +// Copyright (C) 2011 Gevorg Voskanyan // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -40,6 +41,17 @@ namespace soci { +class postgresql_soci_error : public soci_error +{ +public: + postgresql_soci_error(std::string const & msg, char const * sqlst); + + std::string sqlstate() const; + +private: + char sqlstate_[ 5 ]; // not std::string to keep copy-constructor no-throw +}; + struct postgresql_statement_backend; struct postgresql_standard_into_type_backend : details::standard_into_type_backend { diff --git a/backends/postgresql/statement.cpp b/backends/postgresql/statement.cpp index 4e9b4570..67d58370 100644 --- a/backends/postgresql/statement.cpp +++ b/backends/postgresql/statement.cpp @@ -7,6 +7,7 @@ #define SOCI_POSTGRESQL_SOURCE #include "soci-postgresql.h" +#include "error.h" #include #include // libpq #include @@ -26,7 +27,7 @@ using namespace soci; using namespace soci::details; - +using namespace soci::details::postgresql; postgresql_statement_backend::postgresql_statement_backend( postgresql_session_backend &session) @@ -164,7 +165,7 @@ void postgresql_statement_backend::prepare(std::string const & query, ExecStatusType status = PQresultStatus(res); if (status != PGRES_COMMAND_OK) { - throw soci_error(PQresultErrorMessage(res)); + throw_postgresql_soci_error(res); } PQclear(res); } @@ -299,18 +300,19 @@ postgresql_statement_backend::execute(int number) #endif // SOCI_POSTGRESQL_NOPARAMS + if (result_ == NULL) + { + throw soci_error("Cannot execute query."); + } + if (numberOfExecutions > 1) { // there are only bulk use elements (no intos) - if (result_ == NULL) - { - throw soci_error("Cannot execute query."); - } ExecStatusType status = PQresultStatus(result_); if (status != PGRES_COMMAND_OK) { - throw soci_error(PQresultErrorMessage(result_)); + throw_postgresql_soci_error(result_); } PQclear(result_); } @@ -396,7 +398,10 @@ postgresql_statement_backend::execute(int number) } else { - throw soci_error(PQresultErrorMessage(result_)); + throw_postgresql_soci_error(result_); + + // dummy, never reach + return ef_no_data; } } diff --git a/backends/postgresql/test/test-postgresql.cpp b/backends/postgresql/test/test-postgresql.cpp index 838eb214..b219da9e 100644 --- a/backends/postgresql/test/test-postgresql.cpp +++ b/backends/postgresql/test/test-postgresql.cpp @@ -8,7 +8,7 @@ // #if defined(SOCI_HEADERS_BURIED) # include -# include +# include # include #else # include diff --git a/cmake/SociVersion.cmake b/cmake/SociVersion.cmake new file mode 100644 index 00000000..72ff138c --- /dev/null +++ b/cmake/SociVersion.cmake @@ -0,0 +1,59 @@ +################################################################################ +# SociVersion.cmake - part of CMake configuration of SOCI library +################################################################################ +# Copyright (C) 2010 Mateusz Loskot +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +################################################################################ +# Macros in this module: +# +# soci_version - defines version information for SOCI library +# +################################################################################ + +# Defines version information for SOCI library +# +# soci_version(MAJOR major_version MINOR minor_version PATCH patch_level) +# +# MAJOR.MINOR version is used to set SOVERSION +# +macro(soci_version) + parse_arguments(THIS_VERSION "MAJOR;MINOR;PATCH;" + "" + ${ARGN}) + + # Set version components + set(${PROJECT_NAME}_VERSION_MAJOR ${THIS_VERSION_MAJOR}) + set(${PROJECT_NAME}_VERSION_MINOR ${THIS_VERSION_MINOR}) + set(${PROJECT_NAME}_VERSION_PATCH ${THIS_VERSION_PATCH}) + + # Set VERSION string + set(${PROJECT_NAME}_VERSION + "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}") + + # Set SOVERSION based on major and minor + set(${PROJECT_NAME}_SOVERSION + "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}") + + # Set ABI version string used to name binary output and, by SOCI loader, to find binaries. + # On Windows, ABI version is specified using binary file name suffix. + # On Unix, suffix ix empty and SOVERSION is used instead. + if (UNIX) + set(${PROJECT_NAME}_ABI_VERSION ${${PROJECT_NAME}_SOVERSION}) + elseif(WIN32) + set(${PROJECT_NAME}_ABI_VERSION + "${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}") + else() + message(FATAL_ERROR "Ambiguous target platform with unknown ABI version scheme. Giving up.") + endif() + + message(STATUS "") + + boost_report_value(${PROJECT_NAME}_VERSION) + boost_report_value(${PROJECT_NAME}_ABI_VERSION) + + add_definitions(-DSOCI_ABI_VERSION="${${PROJECT_NAME}_ABI_VERSION}") + +endmacro() diff --git a/cmake/modules/FindODBC.cmake b/cmake/modules/FindODBC.cmake new file mode 100644 index 00000000..9348a716 --- /dev/null +++ b/cmake/modules/FindODBC.cmake @@ -0,0 +1,57 @@ +# +# Find the ODBC driver manager includes and library. +# +# ODBC is an open standard for connecting to different databases in a +# semi-vendor-independent fashion. First you install the ODBC driver +# manager. Then you need a driver for each separate database you want +# to connect to (unless a generic one works). VTK includes neither +# the driver manager nor the vendor-specific drivers: you have to find +# those yourself. +# +# This module defines +# ODBC_INCLUDE_DIRECTORIES, where to find sql.h +# ODBC_LIBRARIES, the libraries to link against to use ODBC +# ODBC_FOUND. If false, you cannot build anything that requires MySQL. + +# also defined, but not for general use is +# ODBC_LIBRARY, where to find the ODBC driver manager library. + +set(ODBC_FOUND FALSE) + +find_path(ODBC_INCLUDE_DIRECTORIES sql.h + /usr/include + /usr/include/odbc + /usr/local/include + /usr/local/include/odbc + /usr/local/odbc/include + "C:/Program Files/ODBC/include" + "C:/Program Files/Microsoft SDKs/Windows/v7.0/include" + "C:/Program Files/Microsoft SDKs/Windows/v6.0a/include" + "C:/ODBC/include" + DOC "Specify the directory containing sql.h." +) + +find_library(ODBC_LIBRARY + NAMES iodbc odbc odbcinst odbc32 + PATHS + /usr/lib + /usr/lib/odbc + /usr/local/lib + /usr/local/lib/odbc + /usr/local/odbc/lib + "C:/Program Files/ODBC/lib" + "C:/ODBC/lib/debug" + "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" + DOC "Specify the ODBC driver manager library here." +) + +if(ODBC_LIBRARY) + if(ODBC_INCLUDE_DIRECTORIES) + set( ODBC_FOUND 1 ) + endif() +endif() + +set(ODBC_LIBRARIES ${ODBC_LIBRARY}) + +mark_as_advanced(ODBC_FOUND ODBC_LIBRARY ODBC_EXTRA_LIBRARIES ODBC_INCLUDE_DIRECTORIES) + diff --git a/cmake/modules/FindSoci.cmake b/cmake/modules/FindSoci.cmake new file mode 100644 index 00000000..fc0d0850 --- /dev/null +++ b/cmake/modules/FindSoci.cmake @@ -0,0 +1,100 @@ +############################################################################### +# CMake module to search for SOCI library +# +# WARNING: This module is experimental work in progress. +# +# This module defines: +# SOCI_INCLUDE_DIRS = include dirs to be used when using the soci library +# SOCI_LIBRARY = full path to the soci library +# SOCI_VERSION = the soci version found (not yet. soci does not provide that info.) +# SOCI_FOUND = true if soci was found +# +# This module respects: +# LIB_SUFFIX = (64|32|"") Specifies the suffix for the lib directory +# +# For each component you specify in find_package(), the following variables are set. +# +# SOCI_${COMPONENT}_PLUGIN = full path to the soci plugin +# SOCI_${COMPONENT}_FOUND +# +# Copyright (c) 2011 Michael Jansen +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# +############################################################################### +# +### Global Configuration Section +# +SET(_SOCI_ALL_PLUGINS mysql odbc postgresql sqlite3) +SET(_SOCI_REQUIRED_VARS SOCI_INCLUDE_DIR SOCI_LIBRARY) + +# +### FIRST STEP: Find the soci headers. +# +FIND_PATH( + SOCI_INCLUDE_DIR soci.h + PATH "/usr/local" + PATH_SUFFIXES "" "soci" + DOC "Soci (http://soci.sourceforge.net) include directory") +MARK_AS_ADVANCED(SOCI_INCLUDE_DIR) + +SET(SOCI_INCLUDE_DIRS ${SOCI_INCLUDE_DIR}) + +# +### SECOND STEP: Find the soci core library. Respect LIB_SUFFIX +# +FIND_LIBRARY( + SOCI_LIBRARY + NAMES soci_core + HINTS ${SOCI_INCLUDE_DIR}/.. + PATH_SUFFIXES lib${LIB_SUFFIX}) +MARK_AS_ADVANCED(SOCI_LIBRARY) + +GET_FILENAME_COMPONENT(SOCI_LIBRARY_DIR ${SOCI_LIBRARY} PATH) +MARK_AS_ADVANCED(SOCI_LIBRARY_DIR) + +# +### THIRD STEP: Find all installed plugins if the library was found +# +IF(SOCI_INCLUDE_DIR AND SOCI_LIBRARY) + + MESSAGE(STATUS "Soci found: Looking for plugins") + FOREACH(plugin IN LISTS _SOCI_ALL_PLUGINS) + + FIND_LIBRARY( + SOCI_${plugin}_PLUGIN + NAMES soci_${plugin} + HINTS ${SOCI_INCLUDE_DIR}/.. + PATH_SUFFIXES lib${LIB_SUFFIX}) + MARK_AS_ADVANCED(SOCI_${plugin}_PLUGIN) + + IF(SOCI_${plugin}_PLUGIN) + MESSAGE(STATUS " * Plugin ${plugin} found ${SOCI_${plugin}_LIBRARY}.") + SET(SOCI_${plugin}_FOUND True) + ELSE() + MESSAGE(STATUS " * Plugin ${plugin} not found.") + SET(SOCI_${plugin}_FOUND False) + ENDIF() + + ENDFOREACH() + + # + ### FOURTH CHECK: Check if the required components were all found + # + FOREACH(component ${Soci_FIND_COMPONENTS}) + IF(${SOCI_${component}_FOUND}) + # Does not work with NOT ... . No idea why. + ELSE() + MESSAGE(SEND_ERROR "Required component ${component} not found.") + ENDIF() + ENDFOREACH() + +ENDIF() + +# +### ADHERE TO STANDARDS +# +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Soci DEFAULT_MSG ${_SOCI_REQUIRED_VARS}) + diff --git a/core/Makefile.basic b/core/Makefile.basic index 05512fb0..f24fa2f1 100644 --- a/core/Makefile.basic +++ b/core/Makefile.basic @@ -1,6 +1,9 @@ COMPILER = g++ -CXXFLAGS = -Wall -pedantic -Wno-long-long -DSOCI_ABI_VERSION=3.1.0 +CXXFLAGS = -Wall -pedantic -Wno-long-long INCLUDEDIRS = + +BACKENDLOADERDEFS = -DSOCI_LIB_PREFIX=\"libsoci_\" -DSOCI_LIB_SUFFIX=\".so\" + OBJS = session.o statement.o row.o values.o \ into-type.o use-type.o \ blob.o rowid.o procedure.o ref-counted-prepare-info.o ref-counted-statement.o \ @@ -63,7 +66,7 @@ transaction.o : transaction.cpp ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} backend-loader.o : backend-loader.cpp - ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} + ${COMPILER} -c $? ${CXXFLAGS} ${BACKENDLOADERDEFS} ${INCLUDEDIRS} connection-pool.o : connection-pool.cpp ${COMPILER} -c $? ${CXXFLAGS} ${INCLUDEDIRS} diff --git a/core/backend-loader.cpp b/core/backend-loader.cpp index 286bf8ce..10bef3da 100644 --- a/core/backend-loader.cpp +++ b/core/backend-loader.cpp @@ -4,9 +4,6 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // -#ifndef SOCI_ABI_VERSION -#error "SOCI_ABI_VERSION define is required to configure backend loader" -#endif #define SOCI_SOURCE #include "backend-loader.h" @@ -41,7 +38,12 @@ typedef HMODULE soci_handler_t; #endif #define DLCLOSE(x) FreeLibrary(x) #define DLSYM(x, y) GetProcAddress(x, y) + +#ifdef SOCI_ABI_VERSION #define LIBNAME(x) (SOCI_LIB_PREFIX + x + "_" SOCI_ABI_VERSION SOCI_LIB_SUFFIX) +#else +#define LIBNAME(x) (SOCI_LIB_PREFIX + x + SOCI_LIB_SUFFIX) +#endif // SOCI_ABI_VERSION #else @@ -58,12 +60,19 @@ typedef void * soci_handler_t; #define DLOPEN(x) dlopen(x, RTLD_LAZY) #define DLCLOSE(x) dlclose(x) #define DLSYM(x, y) dlsym(x, y) + +#ifdef SOCI_ABI_VERSION + #ifdef __APPLE__ #define LIBNAME(x) (SOCI_LIB_PREFIX + x + "." SOCI_ABI_VERSION SOCI_LIB_SUFFIX) #else #define LIBNAME(x) (SOCI_LIB_PREFIX + x + SOCI_LIB_SUFFIX "." SOCI_ABI_VERSION) #endif +#else +#define LIBNAME(x) (SOCI_LIB_PREFIX + x + SOCI_LIB_SUFFIX) +#endif // SOCI_ABI_VERSION + #endif // _WIN32 diff --git a/core/test/common-tests.h b/core/test/common-tests.h index c4098446..899c05b2 100644 --- a/core/test/common-tests.h +++ b/core/test/common-tests.h @@ -1367,7 +1367,7 @@ void test7() #else // Older PostgreSQL does not support use elements. - sql << "insert into test7(i1, i2, i3) values(5, 6, 7)"; + sql << "insert into soci_test(i1, i2, i3) values(5, 6, 7)"; #endif // SOCI_PGSQL_NOPARAMS diff --git a/core/version.h b/core/version.h new file mode 100644 index 00000000..40be09fd --- /dev/null +++ b/core/version.h @@ -0,0 +1,32 @@ +// SOCI version.hpp configuration header file + +// +// Copyright (C) 2011 Mateusz Loskot +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef SOCI_VERSION_HPP +#define SOCI_VERSION_HPP + +// +// Caution, this is the only SOCI header that is guarenteed +// to change with every SOCI release, including this header +// will cause a recompile every time a new SOCI version is +// released. +// +// SOCI_VERSION % 100 is the patch level +// SOCI_VERSION / 100 % 1000 is the minor version +// SOCI_VERSION / 100000 is the major version + +#define SOCI_VERSION 300100 + +// +// SOCI_LIB_VERSION must be defined to be the same as SOCI_VERSION +// but as a *string* in the form "x_y[_z]" where x is the major version +// number, y is the minor version number, and z is the patch level if not 0. + +#define SOCI_LIB_VERSION "3_1_0" + +#endif // SOCI_VERSION_HPP diff --git a/languages/ada/postgresql_client.gpr b/languages/ada/postgresql_client.gpr new file mode 100644 index 00000000..f29b3498 --- /dev/null +++ b/languages/ada/postgresql_client.gpr @@ -0,0 +1,8 @@ +project PostgreSQL_Client is + for Externally_Built use "true"; + for Source_Dirs use (); + for Library_Dir use "/usr/local/lib"; + for Library_Name use "pq"; + for Library_Kind use "static"; +end PostgreSQL_Client; + diff --git a/languages/ada/soci-mysql.ads b/languages/ada/soci-mysql.ads new file mode 100644 index 00000000..10156fbc --- /dev/null +++ b/languages/ada/soci-mysql.ads @@ -0,0 +1,16 @@ +-- Copyright (C) 2008-2011 Maciej Sobczak +-- Distributed under the Boost Software License, Version 1.0. +-- (See accompanying file LICENSE_1_0.txt or copy at +-- http://www.boost.org/LICENSE_1_0.txt) + +package SOCI.MySQL is + + -- + -- Registers the MySQL backend so that it is ready for use + -- by the dynamic backend loader. + -- + procedure Register_Factory_MySQL; + pragma Import (C, Register_Factory_MySQL, + "register_factory_mysql"); + +end SOCI.MySQL; diff --git a/languages/ada/soci-oracle.ads b/languages/ada/soci-oracle.ads new file mode 100644 index 00000000..ed8bc667 --- /dev/null +++ b/languages/ada/soci-oracle.ads @@ -0,0 +1,16 @@ +-- Copyright (C) 2008-2011 Maciej Sobczak +-- Distributed under the Boost Software License, Version 1.0. +-- (See accompanying file LICENSE_1_0.txt or copy at +-- http://www.boost.org/LICENSE_1_0.txt) + +package SOCI.Oracle is + + -- + -- Registers the Oracle backend so that it is ready for use + -- by the dynamic backend loader. + -- + procedure Register_Factory_Oracle; + pragma Import (C, Register_Factory_Oracle, + "register_factory_oracle"); + +end SOCI.Oracle; diff --git a/languages/ada/soci-postgresql.ads b/languages/ada/soci-postgresql.ads new file mode 100644 index 00000000..fc750b25 --- /dev/null +++ b/languages/ada/soci-postgresql.ads @@ -0,0 +1,16 @@ +-- Copyright (C) 2008-2011 Maciej Sobczak +-- Distributed under the Boost Software License, Version 1.0. +-- (See accompanying file LICENSE_1_0.txt or copy at +-- http://www.boost.org/LICENSE_1_0.txt) + +package SOCI.PostgreSQL is + + -- + -- Registers the PostgreSQL backend so that it is ready for use + -- by the dynamic backend loader. + -- + procedure Register_Factory_PostgreSQL; + pragma Import (C, Register_Factory_PostgreSQL, + "register_factory_postgresql"); + +end SOCI.PostgreSQL; diff --git a/languages/ada/soci.adb b/languages/ada/soci.adb new file mode 100644 index 00000000..7f72f1bb --- /dev/null +++ b/languages/ada/soci.adb @@ -0,0 +1,1465 @@ +-- Copyright (C) 2008-2011 Maciej Sobczak +-- Distributed under the Boost Software License, Version 1.0. +-- (See accompanying file LICENSE_1_0.txt or copy at +-- http://www.boost.org/LICENSE_1_0.txt) + +with Ada.Strings.Fixed; +with Interfaces.C.Strings; + +package body SOCI is + + procedure Check_Session_State (Handle : in Session_Handle) is + + function Soci_Session_State (S : in Session_Handle) return Interfaces.C.int; + + pragma Import (C, Soci_Session_State, "soci_session_state"); + + function Soci_Session_Error_Message + (S : in Session_Handle) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Session_Error_Message, "soci_session_error_message"); + + State : constant Interfaces.C.int := Soci_Session_State (Handle); + Bad_State : constant Interfaces.C.int := 0; + + use type Interfaces.C.int; + + begin + if State = Bad_State then + declare + Message : constant String := + Interfaces.C.Strings.Value (Soci_Session_Error_Message (Handle)); + begin + raise Database_Error with Message; + end; + end if; + end Check_Session_State; + + function Make_Session_Handle (Connection_String : in String) return Session_Handle is + + function Soci_Create_Session (C : in Interfaces.C.char_array) return Session_Handle; + pragma Import (C, Soci_Create_Session, "soci_create_session"); + + Connection_String_C : constant Interfaces.C.char_array := + Interfaces.C.To_C (Connection_String); + + Handle : constant Session_Handle := + Soci_Create_Session (Connection_String_C); + + begin + if Handle = Null_Session_Handle then + raise Database_Error with "Cannot create session object."; + else + return Handle; + end if; + end Make_Session_Handle; + + function Data_State_To_Int (State : in Data_State) return Interfaces.C.int is + begin + if State = Data_Not_Null then + return 1; + else + return 0; + end if; + end Data_State_To_Int; + + function Int_To_Data_State (State : in Interfaces.C.int) return Data_State is + use type Interfaces.C.int; + begin + if State /= 0 then + return Data_Not_Null; + else + return Data_Null; + end if; + end Int_To_Data_State; + + procedure Check_Is_Open (This : in Session'Class) is + begin + if not This.Initialized then + raise Database_Error with "Session is not initialized."; + end if; + end Check_Is_Open; + + procedure Check_Statement_State (Handle : in Statement_Handle) is + + function Soci_Statement_State (S : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Statement_State, "soci_statement_state"); + + function Soci_Statement_Error_Message + (S : in Statement_Handle) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Statement_Error_Message, "soci_statement_error_message"); + + State : constant Interfaces.C.int := Soci_Statement_State (Handle); + Bad_State : constant Interfaces.C.int := 0; + + use type Interfaces.C.int; + + begin + if State = Bad_State then + declare + Message : constant String := + Interfaces.C.Strings.Value (Soci_Statement_Error_Message (Handle)); + begin + raise Database_Error with Message; + end; + end if; + end Check_Statement_State; + + function String_To_Time (Source : in String) return Ada.Calendar.Time is + + Year_N : Natural; + Month_N : Natural; + Day_N : Natural; + Hour_N : Natural; + Minute_N : Natural; + Second_N : Natural; + + procedure Get_Next_Number + (Source : in String; + Position : in out Natural; + Result : out Natural) is + + I : Natural; + begin + I := Ada.Strings.Fixed.Index (Source => Source, + Pattern => " ", + From => Position); + + if I /= 0 then + Result := Natural'Value (Source (Position .. I)); + Position := I + 1; + else + Result := Natural'Value (Source (Position .. Source'Last)); + Position := 0; + end if; + end Get_Next_Number; + + Pos : Natural := 1; + + begin + + Get_Next_Number (Source => Source, Position => Pos, Result => Year_N); + Get_Next_Number (Source => Source, Position => Pos, Result => Month_N); + Get_Next_Number (Source => Source, Position => Pos, Result => Day_N); + Get_Next_Number (Source => Source, Position => Pos, Result => Hour_N); + Get_Next_Number (Source => Source, Position => Pos, Result => Minute_N); + Get_Next_Number (Source => Source, Position => Pos, Result => Second_N); + + return Ada.Calendar.Time_Of (Year_N, Month_N, Day_N, + Duration (Hour_N * 3_600 + Minute_N * 60 + Second_N)); + + end String_To_Time; + + function Time_To_String (Date : in Ada.Calendar.Time) return String is + + Year : Ada.Calendar.Year_Number; + Month : Ada.Calendar.Month_Number; + Day : Ada.Calendar.Day_Number; + Seconds : Ada.Calendar.Day_Duration; + + Hour : Natural; + Minute : Natural; + Seconds_N : Natural; + + begin + Ada.Calendar.Split (Date, Year, Month, Day, Seconds); + Seconds_N := Natural (Seconds); + + Hour := Seconds_N / 3_600; + Minute := (Seconds_N - Natural (Hour) * 3_600) / 60; + Seconds_N := Seconds_N - Natural (Hour) * 3_600 - Natural (Minute) * 60; + return Ada.Calendar.Year_Number'Image (Year) & " " & + Ada.Calendar.Month_Number'Image (Month) & " " & + Ada.Calendar.Day_Number'Image (Day) & " " & + Natural'Image (Hour) & " " & + Natural'Image (Minute) & " " & + Natural'Image (Seconds_N); + end Time_To_String; + + + function Make_Session (Connection_String : in String) return Session is + begin + return S : Session do + S.Handle := Make_Session_Handle (Connection_String); + S.Initialized := True; + Check_Session_State (S.Handle); + end return; + end Make_Session; + + procedure Open (This : in out Session; Connection_String : in String) is + begin + if This.Initialized then + raise Database_Error with "Session is already initialized."; + else + declare + Handle : constant Session_Handle := + Make_Session_Handle (Connection_String); + begin + Check_Session_State (Handle); + + This.Handle := Handle; + This.Initialized := True; + end; + end if; + end Open; + + procedure Close (This : in out Session) is + + procedure Soci_Destroy_Session (S : in Session_Handle); + pragma Import (C, Soci_Destroy_Session, "soci_destroy_session"); + + begin + if This.Initialized then + if This.Belongs_To_Pool then + raise Database_Error with "Cannot close session - not an owner (session in pool)."; + else + Soci_Destroy_Session (This.Handle); + This.Initialized := False; + end if; + end if; + end Close; + + function Is_Open (This : in Session) return Boolean is + begin + return This.Initialized; + end Is_Open; + + procedure Finalize (This : in out Session) is + begin + if This.Initialized then + if This.Belongs_To_Pool then + This.Pool.all.Give_Back (This.Position_In_Pool); + This.Initialized := False; + else + This.Close; + end if; + end if; + end Finalize; + + procedure Start (This : in Session) is + + procedure Soci_Begin (S : in Session_Handle); + pragma Import (C, Soci_Begin, "soci_begin"); + + begin + Check_Is_Open (This); + Soci_Begin (This.Handle); + Check_Session_State (This.Handle); + end Start; + + procedure Commit (This : in Session) is + + procedure Soci_Commit (S : in Session_Handle); + pragma Import (C, Soci_Commit, "soci_commit"); + + begin + Check_Is_Open (This); + Soci_Commit (This.Handle); + Check_Session_State (This.Handle); + end Commit; + + procedure Rollback (This : in Session) is + + procedure Soci_Rollback (S : in Session_Handle); + pragma Import (C, Soci_Rollback, "soci_rollback"); + + begin + Check_Is_Open (This); + Soci_Rollback (This.Handle); + Check_Session_State (This.Handle); + end Rollback; + + procedure Execute (This : in Session; Query : in String) is + S : Statement := Make_Statement (This); + begin + S.Prepare (Query); + S.Execute; + end Execute; + + protected body Connection_Pool_PS is + + procedure Open (Position : in Positive; Connection_String : in String) is + begin + if Position > Size then + raise Database_Error with "Index out of range."; + end if; + + Connections (Position).Open (Connection_String); + end Open; + + procedure Close (Position : in Positive) is + begin + if Position > Size then + raise Database_Error with "Index out of range."; + end if; + + if Is_Used (Position) then + raise Database_Error with "Cannot close connection that is currently in use."; + end if; + + Connections (Position).Close; + end Close; + + entry Lease (S : in out Session'Class) when Available is + Found : Boolean := False; + begin + if S.Initialized then + raise Database_Error with "This session is already initialized."; + end if; + + -- Find some connection in the pool that is not currently used. + for I in 1 .. Size loop + if not Is_Used (I) then + Check_Is_Open (Connections (I)); + + S.Handle := Connections (I).Handle; + S.Initialized := True; + S.Belongs_To_Pool := True; + S.Position_In_Pool := I; + + -- WORKAROUND: + -- The S.Pool component is set in the Lease procedure + -- of the Connection_Pool type, because here the access + -- to the protected object could not be taken (compiler bug). + + Is_Used (I) := True; + Found := True; + exit; + end if; + end loop; + + if not Found then + raise Database_Error with "Internal error."; + end if; + + -- Update the Available flag. + Found := False; + for I in 1 .. Size loop + if not Is_Used (I) then + Found := True; + exit; + end if; + end loop; + Available := Found; + + end Lease; + + procedure Give_Back (Position : in Positive) is + begin + if Position > Size then + raise Database_Error with "Index out of range."; + end if; + + if not Is_Used (Position) then + raise Database_Error with "Cannot give back connection that is not in use."; + end if; + + Is_Used (Position) := False; + Available := True; + end Give_Back; + + end Connection_Pool_PS; + + procedure Open + (This : in out Connection_Pool; + Position : in Positive; + Connection_String : in String) is + begin + This.Pool.Open (Position, Connection_String); + end Open; + + procedure Close (This : in out Connection_Pool; Position : in Positive) is + begin + This.Pool.Close (Position); + end Close; + + procedure Lease (This : in out Connection_Pool; S : in out Session'Class) is + begin + This.Pool.Lease (S); + + -- WORKAROUND: + -- The S.Pool component is set here because the access + -- to protected object cannot be taken in protected body (compiler bug.) + + -- JUSTIFICATION: + -- The Unchecked_Access is taken here to enable the session to properly + -- "unregister" from the pool in Session's Finalize. + -- An alternative would be to rely on the user to explicitly unlock + -- the appropriate entry in the pool, which is too error prone. + -- It is assumed that connection pool always has wider lifetime + -- than that of the session which is temporarily leased from the pool + -- - this guarantees that S.Pool always points to a valid pool object. + + S.Pool := This.Pool'Unchecked_Access; + end Lease; + + function Make_Statement (Sess : in Session'Class) return Statement is + + function Soci_Create_Statement (Sess : in Session_Handle) return Statement_Handle; + pragma Import (C, Soci_Create_Statement, "soci_create_statement"); + + begin + Check_Is_Open (Sess); + + declare + Handle : constant Statement_Handle := + Soci_Create_Statement (Sess.Handle); + begin + + return S : Statement do + S.Handle := Handle; + S.Initialized := True; + Check_Statement_State (S.Handle); + end return; + end; + end Make_Statement; + + procedure Finalize (This : in out Statement) is + + procedure Soci_Destroy_Statement (S : in Statement_Handle); + pragma Import (C, Soci_Destroy_Statement, "soci_destroy_statement"); + + begin + if This.Initialized then + Soci_Destroy_Statement (This.Handle); + This.Initialized := False; + end if; + end Finalize; + + procedure Prepare (This : in Statement; Query : in String) is + + procedure Soci_Prepare (St : in Statement_Handle; Q : in Interfaces.C.char_array); + pragma Import (C, Soci_Prepare, "soci_prepare"); + + Query_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Query); + + begin + Soci_Prepare (This.Handle, Query_C); + Check_Statement_State (This.Handle); + end Prepare; + + procedure Execute (This : in Statement; With_Data_Exchange : in Boolean := False) is + Result : constant Boolean := This.Execute (With_Data_Exchange); + begin + null; + end Execute; + + function Execute + (This : in Statement; + With_Data_Exchange : in Boolean := False) + return Boolean is + + function Soci_Execute + (St : in Statement_Handle; + WDE : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, Soci_Execute, "soci_execute"); + + WDE_C : Interfaces.C.int; + Result : Interfaces.C.int; + + use type Interfaces.C.int; + + begin + if With_Data_Exchange then + WDE_C := 1; + else + WDE_C := 0; + end if; + + Result := Soci_Execute (This.Handle, WDE_C); + Check_Statement_State (This.Handle); + + return Result /= 0; + end Execute; + + function Fetch (This : in Statement) return Boolean is + + function Soci_Fetch (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Fetch, "soci_fetch"); + + Result : constant Interfaces.C.int := Soci_Fetch (This.Handle); + + use type Interfaces.C.int; + + begin + Check_Statement_State (This.Handle); + return Result /= 0; + end Fetch; + + function Got_Data (This : in Statement) return Boolean is + + function Soci_Got_Data (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Got_Data, "soci_got_data"); + + Result : constant Interfaces.C.int := Soci_Got_Data (This.Handle); + + use type Interfaces.C.int; + + begin + Check_Statement_State (This.Handle); + return Result /= 0; + end Got_Data; + + function Into_String (This : in Statement) return Into_Position is + + function Soci_Into_String (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_String, "soci_into_string"); + + Result : constant Interfaces.C.int := Soci_Into_String (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_String; + + function Into_Integer (This : in Statement) return Into_Position is + + function Soci_Into_Int (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Int, "soci_into_int"); + + Result : constant Interfaces.C.int := Soci_Into_Int (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Integer; + + function Into_Long_Long_Integer (This : in Statement) return Into_Position is + + function Soci_Into_Long_Long (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Long_Long, "soci_into_long_long"); + + Result : constant Interfaces.C.int := Soci_Into_Long_Long (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Long_Long_Integer; + + function Into_Long_Float (This : in Statement) return Into_Position is + + function Soci_Into_Double (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Double, "soci_into_double"); + + Result : constant Interfaces.C.int := Soci_Into_Double (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Long_Float; + + function Into_Time (This : in Statement) return Into_Position is + + function Soci_Into_Date (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Date, "soci_into_date"); + + Result : constant Interfaces.C.int := Soci_Into_Date (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Time; + + function Into_Vector_String (This : in Statement) return Into_Position is + + function Soci_Into_String_V (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_String_V, "soci_into_string_v"); + + Result : constant Interfaces.C.int := Soci_Into_String_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Vector_String; + + function Into_Vector_Integer (This : in Statement) return Into_Position is + + function Soci_Into_Int_V (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Int_V, "soci_into_int_v"); + + Result : constant Interfaces.C.int := Soci_Into_Int_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Vector_Integer; + + function Into_Vector_Long_Long_Integer (This : in Statement) return Into_Position is + + function Soci_Into_Long_Long_V (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Long_Long_V, "soci_into_long_long_v"); + + Result : constant Interfaces.C.int := Soci_Into_Long_Long_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Vector_Long_Long_Integer; + + function Into_Vector_Long_Float (This : in Statement) return Into_Position is + + function Soci_Into_Double_V (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Double_V, "soci_into_double_v"); + + Result : constant Interfaces.C.int := Soci_Into_Double_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Vector_Long_Float; + + function Into_Vector_Time (This : in Statement) return Into_Position is + + function Soci_Into_Date_V (St : in Statement_Handle) return Interfaces.C.int; + pragma Import (C, Soci_Into_Date_V, "soci_into_date_v"); + + Result : constant Interfaces.C.int := Soci_Into_Date_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Into_Position (Result); + end Into_Vector_Time; + + function Get_Into_State + (This : in Statement; + Position : in Into_Position) + return Data_State is + + function Soci_Get_Into_State + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Into_State, "soci_get_into_state"); + + Result : constant Interfaces.C.int := + Soci_Get_Into_State (This.Handle, Interfaces.C.int (Position)); + + use type Interfaces.C.int; + + begin + Check_Statement_State (This.Handle); + return Int_To_Data_State (Result); + end Get_Into_State; + + function Get_Into_String + (This : in Statement; + Position : in Into_Position) + return String is + + function Soci_Get_Into_String + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Into_String, "soci_get_into_string"); + + Result : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Into_String (This.Handle, Interfaces.C.int (Position)); + + begin + Check_Statement_State (This.Handle); + return Interfaces.C.Strings.Value (Result); + end Get_Into_String; + + function Get_Into_Integer + (This : in Statement; + Position : in Into_Position) + return DB_Integer is + + function Soci_Get_Into_Int + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Into_Int, "soci_get_into_int"); + + Result : constant Interfaces.C.int := + Soci_Get_Into_Int (This.Handle, Interfaces.C.int (Position)); + + begin + Check_Statement_State (This.Handle); + return DB_Integer (Result); + end Get_Into_Integer; + + function Get_Into_Long_Long_Integer + (This : in Statement; + Position : in Into_Position) + return DB_Long_Long_Integer is + + function Soci_Get_Into_Long_Long + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.Integer_64; + pragma Import (C, Soci_Get_Into_Long_Long, "soci_get_into_long_long"); + + Result : constant Interfaces.Integer_64 := + Soci_Get_Into_Long_Long (This.Handle, Interfaces.C.int (Position)); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Long_Integer (Result); + end Get_Into_Long_Long_Integer; + + function Get_Into_Long_Float + (This : in Statement; + Position : in Into_Position) + return DB_Long_Float is + + function Soci_Get_Into_Double + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.C.double; + pragma Import (C, Soci_Get_Into_Double, "soci_get_into_double"); + + Result : constant Interfaces.C.double := + Soci_Get_Into_Double (This.Handle, Interfaces.C.int (Position)); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Float (Result); + end Get_Into_Long_Float; + + function Get_Into_Time + (This : in Statement; + Position : in Into_Position) + return Ada.Calendar.Time is + + function Soci_Get_Into_Date + (St : in Statement_Handle; + P : in Interfaces.C.int) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Into_Date, "soci_get_into_date"); + + Result_C : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Into_Date (This.Handle, Interfaces.C.int (Position)); + Result : constant String := Interfaces.C.Strings.Value (Result_C); + + begin + Check_Statement_State (This.Handle); + return String_To_Time (Result); + end Get_Into_Time; + + function Get_Into_Vectors_Size (This : in Statement) return Natural is + + function Soci_Into_Get_Size_V + (St : in Statement_Handle) + return Interfaces.C.int; + pragma Import (C, Soci_Into_Get_Size_V, "soci_into_get_size_v"); + + Result_C : constant Interfaces.C.int := Soci_Into_Get_Size_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Natural (Result_C); + end Get_Into_Vectors_Size; + + function Into_Vectors_First_Index (This : in Statement) return Vector_Index is + begin + return 0; + end Into_Vectors_First_Index; + + function Into_Vectors_Last_Index (This : in Statement) return Vector_Index is + begin + return Vector_Index (This.Get_Into_Vectors_Size - 1); + end Into_Vectors_Last_Index; + + procedure Into_Vectors_Resize (This : in Statement; New_Size : in Natural) is + + procedure Soci_Into_Resize_V + (St : in Statement_Handle; + New_Size : in Interfaces.C.int); + pragma Import (C, Soci_Into_Resize_V, "soci_into_resize_v"); + + begin + Soci_Into_Resize_V (This.Handle, Interfaces.C.int (New_Size)); + Check_Statement_State (This.Handle); + end Into_Vectors_Resize; + + function Get_Into_Vector_State + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return Data_State is + + function Soci_Get_Into_State_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Into_State_V, "soci_get_into_state_v"); + + Result : constant Interfaces.C.int := + Soci_Get_Into_State_V + (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + + use type Interfaces.C.int; + + begin + Check_Statement_State (This.Handle); + return Int_To_Data_State (Result); + end Get_Into_Vector_State; + + function Get_Into_Vector_String + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) return String is + + function Soci_Get_Into_String_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Into_String_V, "soci_get_into_string_v"); + + Result : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Into_String_V (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + + begin + Check_Statement_State (This.Handle); + return Interfaces.C.Strings.Value (Result); + end Get_Into_Vector_String; + + function Get_Into_Vector_Integer + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Integer is + + function Soci_Get_Into_Int_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Into_Int_V, "soci_get_into_int_v"); + + Result : constant Interfaces.C.int := + Soci_Get_Into_Int_V (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + + begin + Check_Statement_State (This.Handle); + return DB_Integer (Result); + end Get_Into_Vector_Integer; + + function Get_Into_Vector_Long_Long_Integer + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Long_Long_Integer is + + function Soci_Get_Into_Long_Long_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.Integer_64; + pragma Import (C, Soci_Get_Into_Long_Long_V, "soci_get_into_long_long_v"); + + Result : constant Interfaces.Integer_64 := + Soci_Get_Into_Long_Long_V (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Long_Integer (Result); + end Get_Into_Vector_Long_Long_Integer; + + function Get_Into_Vector_Long_Float + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Long_Float is + + function Soci_Get_Into_Double_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.C.double; + pragma Import (C, Soci_Get_Into_Double_V, "soci_get_into_double_v"); + + Result : constant Interfaces.C.double := + Soci_Get_Into_Double_V (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Float (Result); + end Get_Into_Vector_Long_Float; + + function Get_Into_Vector_Time + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return Ada.Calendar.Time is + + function Soci_Get_Into_Date_V + (St : in Statement_Handle; + P : in Interfaces.C.int; + I : in Interfaces.C.int) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Into_Date_V, "soci_get_into_date_v"); + + Result_C : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Into_Date_V (This.Handle, + Interfaces.C.int (Position), + Interfaces.C.int (Index)); + Result : constant String := Interfaces.C.Strings.Value (Result_C); + + begin + Check_Statement_State (This.Handle); + return String_To_Time (Result); + end Get_Into_Vector_Time; + + procedure Use_String (This : in Statement; Name : in String) is + + procedure Soci_Use_String + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_String, "soci_use_string"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_String (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_String; + + procedure Use_Integer (This : in Statement; Name : in String) is + + procedure Soci_Use_Int + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Int, "soci_use_int"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Int (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Integer; + + procedure Use_Long_Long_Integer (This : in Statement; Name : in String) is + + procedure Soci_Use_Long_Long + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Long_Long, "soci_use_long_long"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Long_Long (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Long_Long_Integer; + + procedure Use_Long_Float (This : in Statement; Name : in String) is + + procedure Soci_Use_Double + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Double, "soci_use_double"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Double (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Long_Float; + + procedure Use_Time (This : in Statement; Name : in String) is + + procedure Soci_Use_Date + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Date, "soci_use_date"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Date (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Time; + + procedure Use_Vector_String (This : in Statement; Name : in String) is + + procedure Soci_Use_String_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_String_V, "soci_use_string_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_String_V (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Vector_String; + + procedure Use_Vector_Integer (This : in Statement; Name : in String) is + + procedure Soci_Use_Int_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Int_V, "soci_use_int_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Int_V (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Vector_Integer; + + procedure Use_Vector_Long_Long_Integer (This : in Statement; Name : in String) is + + procedure Soci_Use_Long_Long_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Long_Long_V, "soci_use_long_long_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Long_Long_V (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Vector_Long_Long_Integer; + + procedure Use_Vector_Long_Float (This : in Statement; Name : in String) is + + procedure Soci_Use_Double_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Double_V, "soci_use_double_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Double_V (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Vector_Long_Float; + + procedure Use_Vector_Time (This : in Statement; Name : in String) is + + procedure Soci_Use_Date_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array); + pragma Import (C, Soci_Use_Date_V, "soci_use_date_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + + begin + Soci_Use_Date_V (This.Handle, Name_C); + Check_Statement_State (This.Handle); + end Use_Vector_Time; + + procedure Set_Use_State + (This : in Statement; + Name : in String; + State : in Data_State) is + + procedure Soci_Set_Use_State + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + State : in Interfaces.C.int); + pragma Import (C, Soci_Set_Use_State, "soci_set_use_state"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + State_C : constant Interfaces.C.int := Data_State_To_Int (State); + + begin + Soci_Set_Use_State (This.Handle, Name_C, State_C); + Check_Statement_State (This.Handle); + end Set_Use_State; + + procedure Set_Use_String + (This : in Statement; + Name : in String; + Value : in String) is + + procedure Soci_Set_Use_String + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Value : in Interfaces.C.char_array); + pragma Import (C, Soci_Set_Use_String, "soci_set_use_string"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Value_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Value); + + begin + Soci_Set_Use_String (This.Handle, Name_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_String; + + procedure Set_Use_Integer + (This : in Statement; + Name : in String; + Value : in DB_Integer) is + + procedure Soci_Set_Use_Int + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Value : in Interfaces.C.int); + pragma Import (C, Soci_Set_Use_Int, "soci_set_use_int"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Value_C : constant Interfaces.C.int := Interfaces.C.int (Value); + + begin + Soci_Set_Use_Int (This.Handle, Name_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Integer; + + procedure Set_Use_Long_Long_Integer + (This : in Statement; + Name : in String; + Value : in DB_Long_Long_Integer) is + + procedure Soci_Set_Use_Long_Long + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Value : in Interfaces.Integer_64); + pragma Import (C, Soci_Set_Use_Long_Long, "soci_set_use_long_long"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Value_C : constant Interfaces.Integer_64 := Interfaces.Integer_64 (Value); + + begin + Soci_Set_Use_Long_Long (This.Handle, Name_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Long_Long_Integer; + + procedure Set_Use_Long_Float + (This : in Statement; + Name : in String; + Value : in DB_Long_Float) is + + procedure Soci_Set_Use_Double + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Value : in Interfaces.C.double); + pragma Import (C, Soci_Set_Use_Double, "soci_set_use_double"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Value_C : constant Interfaces.C.double := Interfaces.C.double (Value); + + begin + Soci_Set_Use_Double (This.Handle, Name_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Long_Float; + + procedure Set_Use_Time + (This : in Statement; + Name : in String; + Value : in Ada.Calendar.Time) is + + procedure Soci_Set_Use_Date + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Value : in Interfaces.C.char_array); + pragma Import (C, Soci_Set_Use_Date, "soci_set_use_date"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Value_C : constant Interfaces.C.char_array := + Interfaces.C.To_C (Time_To_String (Value)); + + begin + Soci_Set_Use_Date (This.Handle, Name_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Time; + + function Get_Use_Vectors_Size (This : in Statement) return Natural is + + function Soci_Use_Get_Size_V + (St : in Statement_Handle) + return Interfaces.C.int; + pragma Import (C, Soci_Use_Get_Size_V, "soci_use_get_size_v"); + + Result_C : constant Interfaces.C.int := Soci_Use_Get_Size_V (This.Handle); + + begin + Check_Statement_State (This.Handle); + return Natural (Result_C); + end Get_Use_Vectors_Size; + + function Use_Vectors_First_Index (This : in Statement) return Vector_Index is + begin + return 0; + end Use_Vectors_First_Index; + + function Use_Vectors_Last_Index (This : in Statement) return Vector_Index is + begin + return Vector_Index (This.Get_Use_Vectors_Size - 1); + end Use_Vectors_Last_Index; + + procedure Use_Vectors_Resize (This : in Statement; New_Size : in Natural) is + + procedure Soci_Use_Resize_V + (St : in Statement_Handle; + New_Size : in Interfaces.C.int); + pragma Import (C, Soci_Use_Resize_V, "soci_use_resize_v"); + + begin + Soci_Use_Resize_V (This.Handle, Interfaces.C.int (New_Size)); + Check_Statement_State (This.Handle); + end Use_Vectors_Resize; + + procedure Set_Use_Vector_State + (This : in Statement; + Name : in String; + Index : in Vector_Index; + State : in Data_State) is + + procedure Soci_Set_Use_State_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + State : in Interfaces.C.int); + pragma Import (C, Soci_Set_Use_State_V, "soci_set_use_state_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + State_C : constant Interfaces.C.int := Data_State_To_Int (State); + + begin + Soci_Set_Use_State_V (This.Handle, Name_C, Index_C, State_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_State; + + procedure Set_Use_Vector_String + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in String) is + + procedure Soci_Set_Use_String_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + Value : in Interfaces.C.char_array); + pragma Import (C, Soci_Set_Use_String_V, "soci_set_use_string_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + Value_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Value); + + begin + Soci_Set_Use_String_V (This.Handle, Name_C, Index_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_String; + + procedure Set_Use_Vector_Integer + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Integer) is + + procedure Soci_Set_Use_Int_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + Value : in Interfaces.C.int); + pragma Import (C, Soci_Set_Use_Int_V, "soci_set_use_int_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + Value_C : constant Interfaces.C.int := Interfaces.C.int (Value); + + begin + Soci_Set_Use_Int_V (This.Handle, Name_C, Index_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_Integer; + + procedure Set_Use_Vector_Long_Long_Integer + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Long_Long_Integer) is + + procedure Soci_Set_Use_Long_Long_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + Value : in Interfaces.Integer_64); + pragma Import (C, Soci_Set_Use_Long_Long_V, "soci_set_use_long_long_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + Value_C : constant Interfaces.Integer_64 := Interfaces.Integer_64 (Value); + + begin + Soci_Set_Use_Long_Long_V (This.Handle, Name_C, Index_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_Long_Long_Integer; + + procedure Set_Use_Vector_Long_Float + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Long_Float) is + + procedure Soci_Set_Use_Double_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + Value : in Interfaces.C.double); + pragma Import (C, Soci_Set_Use_Double_V, "soci_set_use_double_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + Value_C : constant Interfaces.C.double := Interfaces.C.double (Value); + + begin + Soci_Set_Use_Double_V (This.Handle, Name_C, Index_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_Long_Float; + + procedure Set_Use_Vector_Time + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in Ada.Calendar.Time) is + + procedure Soci_Set_Use_Date_V + (St : in Statement_Handle; + Name : in Interfaces.C.char_array; + Index : in Interfaces.C.int; + Value : in Interfaces.C.char_array); + pragma Import (C, Soci_Set_Use_Date_V, "soci_set_use_date_v"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Index_C : constant Interfaces.C.int := Interfaces.C.int (Index); + Value_C : constant Interfaces.C.char_array := + Interfaces.C.To_C (Time_To_String (Value)); + + begin + Soci_Set_Use_Date_V (This.Handle, Name_C, Index_C, Value_C); + Check_Statement_State (This.Handle); + end Set_Use_Vector_Time; + + function Get_Use_State + (This : in Statement; + Name : in String) return Data_State is + + function Soci_Get_Use_State + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Use_State, "soci_get_use_state"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result : constant Interfaces.C.int := + Soci_Get_Use_State (This.Handle, Name_C); + + use type Interfaces.C.int; + + begin + Check_Statement_State (This.Handle); + return Int_To_Data_State (Result); + end Get_Use_State; + + function Get_Use_String + (This : in Statement; + Name : in String) + return String is + + function Soci_Get_Use_String + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Use_String, "soci_get_use_string"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Use_String (This.Handle, Name_C); + + begin + Check_Statement_State (This.Handle); + return Interfaces.C.Strings.Value (Result); + end Get_Use_String; + + function Get_Use_Integer + (This : in Statement; + Name : in String) + return DB_Integer is + + function Soci_Get_Use_Int + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.C.int; + pragma Import (C, Soci_Get_Use_Int, "soci_get_use_int"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result : constant Interfaces.C.int := + Soci_Get_Use_Int (This.Handle, Name_C); + + begin + Check_Statement_State (This.Handle); + return DB_Integer (Result); + end Get_Use_Integer; + + function Get_Use_Long_Long_Integer + (This : in Statement; + Name : in String) + return DB_Long_Long_Integer is + + function Soci_Get_Use_Long_Long + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.Integer_64; + pragma Import (C, Soci_Get_Use_Long_Long, "soci_get_use_long_long"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result : constant Interfaces.Integer_64 := + Soci_Get_Use_Long_Long (This.Handle, Name_C); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Long_Integer (Result); + end Get_Use_Long_Long_Integer; + + function Get_Use_Long_Float + (This : in Statement; + Name : in String) + return DB_Long_Float is + + function Soci_Get_Use_Double + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.C.double; + pragma Import (C, Soci_Get_Use_Double, "soci_get_use_double"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result : constant Interfaces.C.double := + Soci_Get_Use_Double (This.Handle, Name_C); + + begin + Check_Statement_State (This.Handle); + return DB_Long_Float (Result); + end Get_Use_Long_Float; + + function Get_Use_Time + (This : in Statement; + Name : in String) + return Ada.Calendar.Time is + + function Soci_Get_Use_Date + (St : in Statement_Handle; + Name : in Interfaces.C.char_array) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, Soci_Get_Use_Date, "soci_get_use_date"); + + Name_C : constant Interfaces.C.char_array := Interfaces.C.To_C (Name); + Result_C : constant Interfaces.C.Strings.chars_ptr := + Soci_Get_Use_Date (This.Handle, Name_C); + Result : constant String := Interfaces.C.Strings.Value (Result_C); + + begin + Check_Statement_State (This.Handle); + return String_To_Time (Result); + end Get_Use_Time; + +end SOCI; diff --git a/languages/ada/soci.ads b/languages/ada/soci.ads new file mode 100644 index 00000000..93b59678 --- /dev/null +++ b/languages/ada/soci.ads @@ -0,0 +1,486 @@ +-- +-- Thin wrapper for the simple interface of the SOCI database access library. +-- +-- Copyright (C) 2008-2011 Maciej Sobczak +-- Distributed under the Boost Software License, Version 1.0. +-- (See accompanying file LICENSE_1_0.txt or copy at +-- http://www.boost.org/LICENSE_1_0.txt) + +with Ada.Calendar; +with Interfaces.C; + +private with System; +private with Ada.Finalization; + +package SOCI is + + -- + -- General exception related to database and library usage. + -- + + Database_Error : exception; + + -- + -- Session. + -- + + type Session is tagged limited private; + + not overriding + function Make_Session (Connection_String : in String) return Session; + + not overriding + procedure Open (This : in out Session; Connection_String : in String); + + not overriding + procedure Close (This : in out Session); + + not overriding + function Is_Open (This : in Session) return Boolean; + + -- Transaction management. + + not overriding + procedure Start (This : in Session); + + not overriding + procedure Commit (This : in Session); + + not overriding + procedure Rollback (This : in Session); + + -- Immediate query execution. + not overriding + procedure Execute (This : in Session; Query : in String); + + -- + -- Connection pool management. + -- + + type Connection_Pool (Size : Positive) is tagged limited private; + + not overriding + procedure Open + (This : in out Connection_Pool; + Position : in Positive; + Connection_String : in String); + + not overriding + procedure Close (This : in out Connection_Pool; Position : in Positive); + + not overriding + procedure Lease (This : in out Connection_Pool; S : in out Session'Class); + + -- + -- Statement. + -- + + type Statement (<>) is tagged limited private; + + type Data_State is (Data_Null, Data_Not_Null); + + type Into_Position is private; + + type Vector_Index is new Natural; + + not overriding + function Make_Statement (Sess : in Session'Class) return Statement; + + -- Statement preparation and execution. + + not overriding + procedure Prepare (This : in Statement; Query : in String); + + not overriding + procedure Execute + (This : in Statement; + With_Data_Exchange : in Boolean := False); + + not overriding + function Execute + (This : in Statement; + With_Data_Exchange : in Boolean := False) return Boolean; + + not overriding + function Fetch (This : in Statement) return Boolean; + + not overriding + function Got_Data (This : in Statement) return Boolean; + + -- + -- Data items handling. + -- + + -- Database-specific types. + -- These types are most likely identical to standard Integer, + -- Long_Long_Integer and Long_Float, but are defined distinctly + -- to avoid interfacing problems with other compilers. + + type DB_Integer is new Interfaces.C.int; + type DB_Long_Long_Integer is new Interfaces.Integer_64; + type DB_Long_Float is new Interfaces.C.double; + + -- Creation of single into elements. + + not overriding + function Into_String (This : in Statement) return Into_Position; + + not overriding + function Into_Integer (This : in Statement) return Into_Position; + + not overriding + function Into_Long_Long_Integer (This : in Statement) return Into_Position; + + not overriding + function Into_Long_Float (This : in Statement) return Into_Position; + + not overriding + function Into_Time (This : in Statement) return Into_Position; + + -- Creation of vector into elements. + + not overriding + function Into_Vector_String (This : in Statement) return Into_Position; + + not overriding + function Into_Vector_Integer (This : in Statement) return Into_Position; + + not overriding + function Into_Vector_Long_Long_Integer (This : in Statement) return Into_Position; + + not overriding + function Into_Vector_Long_Float (This : in Statement) return Into_Position; + + not overriding + function Into_Vector_Time (This : in Statement) return Into_Position; + + -- Inspection of single into elements. + + not overriding + function Get_Into_State + (This : in Statement; + Position : in Into_Position) + return Data_State; + + not overriding + function Get_Into_String + (This : in Statement; + Position : in Into_Position) + return String; + + not overriding + function Get_Into_Integer + (This : in Statement; + Position : in Into_Position) + return DB_Integer; + + not overriding + function Get_Into_Long_Long_Integer + (This : in Statement; + Position : in Into_Position) + return DB_Long_Long_Integer; + + not overriding + function Get_Into_Long_Float + (This : in Statement; + Position : in Into_Position) + return DB_Long_Float; + + not overriding + function Get_Into_Time + (This : in Statement; + Position : in Into_Position) + return Ada.Calendar.Time; + + -- Inspection of vector into elements. + + not overriding + function Get_Into_Vectors_Size (This : in Statement) return Natural; + + not overriding + function Into_Vectors_First_Index (This : in Statement) return Vector_Index; + + not overriding + function Into_Vectors_Last_Index (This : in Statement) return Vector_Index; + + not overriding + procedure Into_Vectors_Resize (This : in Statement; New_Size : in Natural); + + not overriding + function Get_Into_Vector_State + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return Data_State; + + not overriding + function Get_Into_Vector_String + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return String; + + not overriding + function Get_Into_Vector_Integer + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Integer; + + not overriding + function Get_Into_Vector_Long_Long_Integer + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Long_Long_Integer; + + not overriding + function Get_Into_Vector_Long_Float + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return DB_Long_Float; + + not overriding + function Get_Into_Vector_Time + (This : in Statement; + Position : in Into_Position; + Index : in Vector_Index) + return Ada.Calendar.Time; + + -- Creation of single use elements. + + not overriding + procedure Use_String (This : in Statement; Name : in String); + + not overriding + procedure Use_Integer (This : in Statement; Name : in String); + + not overriding + procedure Use_Long_Long_Integer (This : in Statement; Name : in String); + + not overriding + procedure Use_Long_Float (This : in Statement; Name : in String); + + not overriding + procedure Use_Time (This : in Statement; Name : in String); + + -- Creation of vector use elements. + + not overriding + procedure Use_Vector_String (This : in Statement; Name : in String); + + not overriding + procedure Use_Vector_Integer (This : in Statement; Name : in String); + + not overriding + procedure Use_Vector_Long_Long_Integer (This : in Statement; Name : in String); + + not overriding + procedure Use_Vector_Long_Float (This : in Statement; Name : in String); + + not overriding + procedure Use_Vector_Time (This : in Statement; Name : in String); + + -- Modifiers for single use elements. + + not overriding + procedure Set_Use_State + (This : in Statement; + Name : in String; + State : in Data_State); + + not overriding + procedure Set_Use_String + (This : in Statement; + Name : in String; + Value : in String); + + not overriding + procedure Set_Use_Integer + (This : in Statement; + Name : in String; + Value : in DB_Integer); + + not overriding + procedure Set_Use_Long_Long_Integer + (This : in Statement; + Name : in String; + Value : in DB_Long_Long_Integer); + + not overriding + procedure Set_Use_Long_Float + (This : in Statement; + Name : in String; + Value : in DB_Long_Float); + + not overriding + procedure Set_Use_Time + (This : in Statement; + Name : in String; + Value : in Ada.Calendar.Time); + + -- Modifiers for vector use elements. + + not overriding + function Get_Use_Vectors_Size (This : in Statement) return Natural; + + not overriding + function Use_Vectors_First_Index (This : in Statement) return Vector_Index; + + not overriding + function Use_Vectors_Last_Index (This : in Statement) return Vector_Index; + + not overriding + procedure Use_Vectors_Resize (This : in Statement; New_Size : in Natural); + + not overriding + procedure Set_Use_Vector_State + (This : in Statement; + Name : in String; + Index : in Vector_Index; + State : in Data_State); + + not overriding + procedure Set_Use_Vector_String + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in String); + + not overriding + procedure Set_Use_Vector_Integer + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Integer); + + not overriding + procedure Set_Use_Vector_Long_Long_Integer + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Long_Long_Integer); + + not overriding + procedure Set_Use_Vector_Long_Float + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in DB_Long_Float); + + not overriding + procedure Set_Use_Vector_Time + (This : in Statement; + Name : in String; + Index : in Vector_Index; + Value : in Ada.Calendar.Time); + + -- Inspection of single use elements. + -- + -- Note: Use elements can be modified by the database if they + -- are bound to out and inout parameters of stored procedures + -- (although this is not supported by all database backends). + -- This feature is available only for single use elements. + + not overriding + function Get_Use_State + (This : in Statement; + Name : in String) + return Data_State; + + not overriding + function Get_Use_String + (This : in Statement; + Name : in String) + return String; + + not overriding + function Get_Use_Integer + (This : in Statement; + Name : in String) + return DB_Integer; + + not overriding + function Get_Use_Long_Long_Integer + (This : in Statement; + Name : in String) + return DB_Long_Long_Integer; + + not overriding + function Get_Use_Long_Float + (This : in Statement; + Name : in String) + return DB_Long_Float; + + not overriding + function Get_Use_Time + (This : in Statement; + Name : in String) + return Ada.Calendar.Time; + +private + + -- Connection pool and supporting types. + + type Connection_Array is array (Positive range <>) of Session; + type Used_Array is array (Positive range <>) of Boolean; + + -- Protected state for the connection pool. + protected type Connection_Pool_PS (Size : Positive) is + + procedure Open (Position : in Positive; Connection_String : in String); + procedure Close (Position : in Positive); + + entry Lease (S : in out Session'Class); + procedure Give_Back (Position : in Positive); + + private + + Connections : Connection_Array (1 .. Size); + Is_Used : Used_Array (1 .. Size) := (others => False); + Available : Boolean := True; + + end Connection_Pool_PS; + type Connection_Pool_PS_Ptr is access all Connection_Pool_PS; + + type Connection_Pool (Size : Positive) is tagged limited record + Pool : aliased Connection_Pool_PS (Size); + end record; + + -- Session and supporting types. + + type Session_Handle is new System.Address; + + Null_Session_Handle : constant Session_Handle := + Session_Handle (System.Null_Address); + + type Session is new Ada.Finalization.Limited_Controlled with record + Handle : Session_Handle; + Initialized : Boolean := False; + Belongs_To_Pool : Boolean := False; + Pool : Connection_Pool_PS_Ptr; + Position_In_Pool : Positive; + end record; + + overriding + procedure Finalize (This : in out Session); + + -- Statement and supporting types. + + type Statement_Handle is new System.Address; + + Null_Statement_Handle : constant Statement_Handle := + Statement_Handle (System.Null_Address); + + type Statement is new Ada.Finalization.Limited_Controlled with record + Handle : Statement_Handle; + Initialized : Boolean := False; + end record; + + overriding + procedure Finalize (This : in out Statement); + + type Into_Position is new Natural; + +end SOCI; diff --git a/languages/ada/soci_ada.gpr b/languages/ada/soci_ada.gpr new file mode 100644 index 00000000..fe783c8d --- /dev/null +++ b/languages/ada/soci_ada.gpr @@ -0,0 +1,14 @@ +with "std_cpp.gpr"; +with "soci_core.gpr"; + +project SOCI_Ada is + for Source_Dirs use ("."); + for Object_Dir use "."; + for Library_Name use "soci_ada"; + for Library_Dir use "lib"; + for Library_Kind use "static"; + + package Compiler is + for Default_Switches ("Ada") use ("-gnat05", "-O2"); + end Compiler; +end SOCI_Ada; diff --git a/languages/ada/soci_core.gpr b/languages/ada/soci_core.gpr new file mode 100644 index 00000000..02837807 --- /dev/null +++ b/languages/ada/soci_core.gpr @@ -0,0 +1,7 @@ +project SOCI_Core is + for Externally_Built use "true"; + for Source_Dirs use (); + for Library_Dir use "../../core"; + for Library_Name use "soci_core"; + for Library_Kind use "static"; +end SOCI_Core; diff --git a/languages/ada/soci_postgresql.gpr b/languages/ada/soci_postgresql.gpr new file mode 100644 index 00000000..3ce31dbe --- /dev/null +++ b/languages/ada/soci_postgresql.gpr @@ -0,0 +1,8 @@ +project SOCI_PostgreSQL is + for Externally_Built use "true"; + for Source_Dirs use (); + for Library_Dir use "../../backends/postgresql"; + for Library_Name use "soci_postgresql"; + for Library_Kind use "static"; +end SOCI_PostgreSQL; + diff --git a/languages/ada/std_cpp.gpr b/languages/ada/std_cpp.gpr new file mode 100644 index 00000000..699a5adc --- /dev/null +++ b/languages/ada/std_cpp.gpr @@ -0,0 +1,7 @@ +project Std_Cpp is + for Externally_Built use "true"; + for Source_Dirs use (); + for Library_Dir use "."; + for Library_Name use "stdc++"; + for Library_Kind use "static"; +end Std_Cpp; diff --git a/languages/ada/test/postgresql_test.adb b/languages/ada/test/postgresql_test.adb new file mode 100644 index 00000000..0d671a48 --- /dev/null +++ b/languages/ada/test/postgresql_test.adb @@ -0,0 +1,609 @@ +with SOCI; +with SOCI.PostgreSQL; +with Ada.Text_IO; +with Ada.Calendar; +with Ada.Exceptions; +with Ada.Numerics.Discrete_Random; +with Ada.Command_Line; + +procedure PostgreSQL_Test is + + procedure Test_1 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing basic constructor function"); + + declare + S : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + null; + end; + exception + when E : SOCI.Database_Error => + Ada.Text_IO.Put_Line ("Database_Error: "); + Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Message (E)); + end Test_1; + + procedure Test_2 (Connection_String : in String) is + S : SOCI.Session; + begin + Ada.Text_IO.Put_Line ("testing open/close"); + + S.Close; + S.Open (Connection_String); + S.Close; + end Test_2; + + procedure Test_3 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing empty start/commit"); + + declare + S : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + S.Start; + S.Commit; + end; + end Test_3; + + procedure Test_4 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing simple statements"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + SQL.Execute ("create table ada_test ( i integer )"); + SQL.Execute ("drop table ada_test"); + end; + end Test_4; + + procedure Test_5 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing independent statements"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + St_1 : SOCI.Statement := SOCI.Make_Statement (SQL); + St_2 : SOCI.Statement := SOCI.Make_Statement (SQL); + begin + St_1.Prepare ("create table ada_test ( i integer )"); + St_2.Prepare ("drop table ada_test"); + St_1.Execute; + St_2.Execute; + end; + end Test_5; + + procedure Test_6 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing data types and into elements"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + Pos := St.Into_String; + St.Prepare ("select 'Hello'"); + St.Execute (True); + pragma Assert (St.Get_Into_String (Pos) = "Hello"); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + Value : SOCI.DB_Integer; + use type SOCI.DB_Integer; + begin + Pos := St.Into_Integer; + St.Prepare ("select 123"); + St.Execute (True); + Value := St.Get_Into_Integer (Pos); + pragma Assert (Value = 123); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + Value : SOCI.DB_Long_Long_Integer; + use type SOCI.DB_Long_Long_Integer; + begin + Pos := St.Into_Long_Long_Integer; + St.Prepare ("select 10000000000"); + St.Execute (True); + Value := St.Get_Into_Long_Long_Integer (Pos); + pragma Assert (Value = 10_000_000_000); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + Value : SOCI.DB_Long_Float; + use type SOCI.DB_Long_Float; + begin + Pos := St.Into_Long_Float; + St.Prepare ("select 3.625"); + St.Execute (True); + Value := St.Get_Into_Long_Float (Pos); + pragma Assert (Value = SOCI.DB_Long_Float (3.625)); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + Value : Ada.Calendar.Time; + begin + Pos := St.Into_Time; + St.Prepare ("select timestamp '2008-06-30 21:01:02'"); + St.Execute (True); + Value := St.Get_Into_Time (Pos); + pragma Assert (Ada.Calendar.Year (Value) = 2008); + pragma Assert (Ada.Calendar.Month (Value) = 6); + pragma Assert (Ada.Calendar.Day (Value) = 30); + pragma Assert + (Ada.Calendar.Seconds (Value) = + Ada.Calendar.Day_Duration (21 * 3_600 + 1 * 60 + 2)); + end; + end; + end Test_6; + + procedure Test_7 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing types with into vectors"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos_Id : SOCI.Into_Position; + Pos_Str : SOCI.Into_Position; + Pos_LL : SOCI.Into_Position; + Pos_LF : SOCI.Into_Position; + Pos_TM : SOCI.Into_Position; + + use type SOCI.Data_State; + use type Ada.Calendar.Time; + use type SOCI.DB_Integer; + use type SOCI.DB_Long_Long_Integer; + use type SOCI.DB_Long_Float; + + begin + SQL.Execute ("create table soci_test (" & + " id integer," & + " str varchar (20)," & + " ll bigint," & + " lf double precision," & + " tm timestamp" & + ")"); + SQL.Execute ("insert into soci_test (id, str, ll, lf, tm)" & + " values (1, 'abc', 10000000000, 3.0, timestamp '2008-06-30 21:01:02')"); + SQL.Execute ("insert into soci_test (id, str, ll, lf, tm)" & + " values (2, 'xyz', -10000000001, -3.125, timestamp '2008-07-01 21:01:03')"); + SQL.Execute ("insert into soci_test (id, str, ll, lf, tm)" & + " values (3, null, null, null, null)"); + + Pos_Id := St.Into_Vector_Integer; + Pos_Str := St.Into_Vector_String; + Pos_LL := St.Into_Vector_Long_Long_Integer; + Pos_LF := St.Into_Vector_Long_Float; + Pos_TM := St.Into_Vector_Time; + + St.Into_Vectors_Resize (10); -- arbitrary batch size + + St.Prepare ("select id, str, ll, lf, tm from soci_test order by id"); + St.Execute (True); + + pragma Assert (St.Get_Into_Vectors_Size = 3); + + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 0) = 1); + pragma Assert (St.Get_Into_Vector_State (Pos_Str, 0) = SOCI.Data_Not_Null); + pragma Assert (St.Get_Into_Vector_String (Pos_Str, 0) = "abc"); + pragma Assert (St.Get_Into_Vector_Long_Long_Integer (Pos_LL, 0) = 10_000_000_000); + pragma Assert (St.Get_Into_Vector_Long_Float (Pos_LF, 0) = SOCI.DB_Long_Float (3.0)); + pragma Assert (St.Get_Into_Vector_Time (Pos_TM, 0) = + Ada.Calendar.Time_Of (2008, 6, 30, + Duration (21 * 3_600 + 1 * 60 + 2))); + + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 1) = 2); + pragma Assert (St.Get_Into_Vector_State (Pos_Str, 1) = SOCI.Data_Not_Null); + pragma Assert (St.Get_Into_Vector_String (Pos_Str, 1) = "xyz"); + pragma Assert (St.Get_Into_Vector_Long_Long_Integer (Pos_LL, 1) = -10_000_000_001); + pragma Assert (St.Get_Into_Vector_Long_Float (Pos_LF, 1) = SOCI.DB_Long_Float (-3.125)); + pragma Assert (St.Get_Into_Vector_Time (Pos_TM, 1) = + Ada.Calendar.Time_Of (2008, 7, 1, + Duration (21 * 3_600 + 1 * 60 + 3))); + + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 2) = 3); + pragma Assert (St.Get_Into_Vector_State (Pos_Str, 2) = SOCI.Data_Null); + pragma Assert (St.Get_Into_Vector_State (Pos_LL, 2) = SOCI.Data_Null); + pragma Assert (St.Get_Into_Vector_State (Pos_LF, 2) = SOCI.Data_Null); + pragma Assert (St.Get_Into_Vector_State (Pos_TM, 2) = SOCI.Data_Null); + + SQL.Execute ("drop table soci_test"); + end; + end Test_7; + + procedure Test_8 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing multi-batch operation with into vectors"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos_Id : SOCI.Into_Position; + Got_Data : Boolean; + + use type SOCI.DB_Integer; + begin + SQL.Execute ("create table soci_test (" & + " id integer" & + ")"); + SQL.Execute ("insert into soci_test (id) values (1)"); + SQL.Execute ("insert into soci_test (id) values (2)"); + SQL.Execute ("insert into soci_test (id) values (3)"); + SQL.Execute ("insert into soci_test (id) values (4)"); + SQL.Execute ("insert into soci_test (id) values (5)"); + SQL.Execute ("insert into soci_test (id) values (6)"); + SQL.Execute ("insert into soci_test (id) values (7)"); + SQL.Execute ("insert into soci_test (id) values (8)"); + SQL.Execute ("insert into soci_test (id) values (9)"); + SQL.Execute ("insert into soci_test (id) values (10)"); + + Pos_Id := St.Into_Vector_Integer; + St.Into_Vectors_Resize (4); -- batch of 4 elements + + St.Prepare ("select id from soci_test order by id"); + St.Execute; + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Vectors_Size = 4); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 0) = 1); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 1) = 2); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 2) = 3); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 3) = 4); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Vectors_Size = 4); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 0) = 5); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 1) = 6); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 2) = 7); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 3) = 8); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Vectors_Size = 2); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 0) = 9); + pragma Assert (St.Get_Into_Vector_Integer (Pos_Id, 1) = 10); + + Got_Data := St.Fetch; + pragma Assert (not Got_Data); + pragma Assert (St.Get_Into_Vectors_Size = 0); + + SQL.Execute ("drop table soci_test"); + end; + end Test_8; + + procedure Test_9 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing data types and use elements"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + + use type SOCI.DB_Integer; + use type SOCI.DB_Long_Long_Integer; + use type SOCI.DB_Long_Float; + begin + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + St.Use_String ("value"); + St.Set_Use_String ("value", "123"); + Pos := St.Into_Integer; + St.Prepare ("select cast(:value as integer)"); + St.Execute (True); + pragma Assert (St.Get_Into_Integer (Pos) = 123); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + St.Use_Integer ("value"); + St.Set_Use_Integer ("value", 123); + Pos := St.Into_String; + St.Prepare ("select cast(:value as text)"); + St.Execute (True); + pragma Assert (St.Get_Into_String (Pos) = "123"); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + St.Use_Long_Long_Integer ("value"); + St.Set_Use_Long_Long_Integer ("value", 10_000_000_000); + Pos := St.Into_String; + St.Prepare ("select cast(:value as text)"); + St.Execute (True); + pragma Assert (St.Get_Into_String (Pos) = "10000000000"); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + St.Use_Long_Float ("value"); + St.Set_Use_Long_Float ("value", SOCI.DB_Long_Float (5.625)); + Pos := St.Into_String; + St.Prepare ("select cast(:value as text)"); + St.Execute (True); + pragma Assert (St.Get_Into_String (Pos) = "5.625"); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + begin + St.Use_Time ("value"); + St.Set_Use_Time ("value", Ada.Calendar.Time_Of + (2008, 7, 1, Ada.Calendar.Day_Duration (3723))); + Pos := St.Into_String; + St.Prepare ("select cast(:value as text)"); + St.Execute (True); + pragma Assert (St.Get_Into_String (Pos) = "2008-07-01 01:02:03"); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos : SOCI.Into_Position; + use type SOCI.Data_State; + begin + St.Use_Integer ("value"); + St.Set_Use_State ("value", SOCI.Data_Null); + Pos := St.Into_Integer; + St.Prepare ("select cast(:value as integer)"); + St.Execute (True); + pragma Assert (St.Get_Into_State (Pos) = SOCI.Data_Null); + end; + end; + end Test_9; + + procedure Test_10 (Connection_String : in String) is + begin + Ada.Text_IO.Put_Line ("testing vector use elements and row traversal with single into elements"); + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + + Time_1 : constant Ada.Calendar.Time := Ada.Calendar.Time_Of + (2008, 7, 1, Ada.Calendar.Day_Duration (1)); + Time_2 : constant Ada.Calendar.Time := Ada.Calendar.Time_Of + (2008, 7, 2, Ada.Calendar.Day_Duration (2)); + Time_3 : constant Ada.Calendar.Time := Ada.Calendar.Time_Of + (2008, 7, 3, Ada.Calendar.Day_Duration (3)); + Time_4 : constant Ada.Calendar.Time := Ada.Calendar.Time_Of + (2008, 7, 4, Ada.Calendar.Day_Duration (4)); + Time_5 : constant Ada.Calendar.Time := Ada.Calendar.Time_Of + (2008, 7, 5, Ada.Calendar.Day_Duration (5)); + + begin + SQL.Execute ("create table soci_test (" & + " id integer," & + " str varchar (20)," & + " ll bigint," & + " lf double precision," & + " tm timestamp" & + ")"); + + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + begin + St.Use_Vector_Integer ("id"); + St.Use_Vector_String ("str"); + St.Use_Vector_Long_Long_Integer ("ll"); + St.Use_Vector_Long_Float ("lf"); + St.Use_Vector_Time ("tm"); + + St.Use_Vectors_Resize (6); + St.Set_Use_Vector_Integer ("id", 0, 1); + St.Set_Use_Vector_Integer ("id", 1, 2); + St.Set_Use_Vector_Integer ("id", 2, 3); + St.Set_Use_Vector_Integer ("id", 3, 4); + St.Set_Use_Vector_Integer ("id", 4, 5); + St.Set_Use_Vector_Integer ("id", 5, 6); + St.Set_Use_Vector_String ("str", 0, "abc"); + St.Set_Use_Vector_String ("str", 1, "def"); + St.Set_Use_Vector_String ("str", 2, "ghi"); + St.Set_Use_Vector_String ("str", 3, "jklm"); + St.Set_Use_Vector_String ("str", 4, "no"); + St.Set_Use_Vector_State ("str", 5, SOCI.Data_Null); + St.Set_Use_Vector_Long_Long_Integer ("ll", 0, 10_000_000_000); + St.Set_Use_Vector_Long_Long_Integer ("ll", 1, 10_000_000_001); + St.Set_Use_Vector_Long_Long_Integer ("ll", 2, 10_000_000_002); + St.Set_Use_Vector_Long_Long_Integer ("ll", 3, 10_000_000_003); + St.Set_Use_Vector_Long_Long_Integer ("ll", 4, 10_000_000_004); + St.Set_Use_Vector_State ("ll", 5, SOCI.Data_Null); + St.Set_Use_Vector_Long_Float ("lf", 0, SOCI.DB_Long_Float (0.0)); + St.Set_Use_Vector_Long_Float ("lf", 1, SOCI.DB_Long_Float (0.125)); + St.Set_Use_Vector_Long_Float ("lf", 2, SOCI.DB_Long_Float (0.25)); + St.Set_Use_Vector_Long_Float ("lf", 3, SOCI.DB_Long_Float (0.5)); + St.Set_Use_Vector_Long_Float ("lf", 4, SOCI.DB_Long_Float (0.625)); + St.Set_Use_Vector_State ("lf", 5, SOCI.Data_Null); + St.Set_Use_Vector_Time ("tm", 0, Time_1); + St.Set_Use_Vector_Time ("tm", 1, Time_2); + St.Set_Use_Vector_Time ("tm", 2, Time_3); + St.Set_Use_Vector_Time ("tm", 3, Time_4); + St.Set_Use_Vector_Time ("tm", 4, Time_5); + St.Set_Use_Vector_State ("tm", 5, SOCI.Data_Null); + + St.Prepare ("insert into soci_test (id, str, ll, lf, tm)" & + " values (:id, :str, :ll, :lf, :tm)"); + St.Execute (True); + end; + declare + St : SOCI.Statement := SOCI.Make_Statement (SQL); + Pos_Id : SOCI.Into_Position; + Pos_Str : SOCI.Into_Position; + Pos_LL : SOCI.Into_Position; + Pos_LF : SOCI.Into_Position; + Pos_TM : SOCI.Into_Position; + Got_Data : Boolean; + + use type Ada.Calendar.Time; + use type SOCI.Data_State; + use type SOCI.DB_Integer; + use type SOCI.DB_Long_Long_Integer; + use type SOCI.DB_Long_Float; + + begin + Pos_Id := St.Into_Integer; + Pos_Str := St.Into_String; + Pos_LL := St.Into_Long_Long_Integer; + Pos_LF := St.Into_Long_Float; + Pos_TM := St.Into_Time; + + St.Prepare ("select id, str, ll, lf, tm from soci_test order by id"); + St.Execute; + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 1); + pragma Assert (St.Get_Into_String (Pos_Str) = "abc"); + pragma Assert (St.Get_Into_Long_Long_Integer (Pos_LL) = 10_000_000_000); + pragma Assert (St.Get_Into_Long_Float (Pos_LF) = SOCI.DB_Long_Float (0.0)); + pragma Assert (St.Get_Into_Time (Pos_TM) = Time_1); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 2); + pragma Assert (St.Get_Into_String (Pos_Str) = "def"); + pragma Assert (St.Get_Into_Long_Long_Integer (Pos_LL) = 10_000_000_001); + pragma Assert (St.Get_Into_Long_Float (Pos_LF) = SOCI.DB_Long_Float (0.125)); + pragma Assert (St.Get_Into_Time (Pos_TM) = Time_2); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 3); + pragma Assert (St.Get_Into_String (Pos_Str) = "ghi"); + pragma Assert (St.Get_Into_Long_Long_Integer (Pos_LL) = 10_000_000_002); + pragma Assert (St.Get_Into_Long_Float (Pos_LF) = SOCI.DB_Long_Float (0.25)); + pragma Assert (St.Get_Into_Time (Pos_TM) = Time_3); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 4); + pragma Assert (St.Get_Into_String (Pos_Str) = "jklm"); + pragma Assert (St.Get_Into_Long_Long_Integer (Pos_LL) = 10_000_000_003); + pragma Assert (St.Get_Into_Long_Float (Pos_LF) = SOCI.DB_Long_Float (0.5)); + pragma Assert (St.Get_Into_Time (Pos_TM) = Time_4); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 5); + pragma Assert (St.Get_Into_String (Pos_Str) = "no"); + pragma Assert (St.Get_Into_Long_Long_Integer (Pos_LL) = 10_000_000_004); + pragma Assert (St.Get_Into_Long_Float (Pos_LF) = SOCI.DB_Long_Float (0.625)); + pragma Assert (St.Get_Into_Time (Pos_TM) = Time_5); + + Got_Data := St.Fetch; + pragma Assert (Got_Data); + pragma Assert (St.Get_Into_State (Pos_Id) = SOCI.Data_Not_Null); + pragma Assert (St.Get_Into_Integer (Pos_Id) = 6); + pragma Assert (St.Get_Into_State (Pos_Str) = SOCI.Data_Null); + pragma Assert (St.Get_Into_State (Pos_LL) = SOCI.Data_Null); + pragma Assert (St.Get_Into_State (Pos_LF) = SOCI.Data_Null); + pragma Assert (St.Get_Into_State (Pos_TM) = SOCI.Data_Null); + + Got_Data := St.Fetch; + pragma Assert (not Got_Data); + end; + + SQL.Execute ("drop table soci_test"); + end; + end Test_10; + + procedure Test_11 (Connection_String : in String) is + + -- test parameters: + Pool_Size : constant := 3; + Number_Of_Tasks : constant := 10; + Iterations_Per_Task : constant := 1000; + + type Small_Integer is mod 20; + package My_Random is new Ada.Numerics.Discrete_Random (Small_Integer); + Rand : My_Random.Generator; + + Pool : SOCI.Connection_Pool (Pool_Size); + + begin + Ada.Text_IO.Put_Line ("testing connection pool"); + + My_Random.Reset (Rand); + + for I in 1 .. Pool_Size loop + Pool.Open (I, Connection_String); + end loop; + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + SQL.Execute ("create table soci_test ( id integer )"); + end; + + declare + + task type Worker; + task body Worker is + begin + + for I in 1 .. Iterations_Per_Task loop + declare + SQL : SOCI.Session; + V : Small_Integer; + begin + Pool.Lease (SQL); + + V := My_Random.Random (Rand); + SQL.Execute ("insert into soci_test (id) values (" & + Small_Integer'Image (V) & ")"); + end; + end loop; + exception + when others => + Ada.Text_IO.Put_Line ("An exception occured in the worker task."); + end Worker; + + W : array (1 .. Number_Of_Tasks) of Worker; + + begin + Ada.Text_IO.Put_Line ("--> waiting for the tasks to complete (might take a while)"); + end; + + declare + SQL : SOCI.Session := SOCI.Make_Session (Connection_String); + begin + SQL.Execute ("drop table soci_test"); + end; + end Test_11; + +begin + if Ada.Command_Line.Argument_Count /= 1 then + Ada.Text_IO.Put_Line ("Expecting one argument: connection string"); + return; + end if; + + declare + Connection_String : String := Ada.Command_Line.Argument (1); + begin + Ada.Text_IO.Put_Line ("testing with " & Connection_String); + + SOCI.PostgreSQL.Register_Factory_PostgreSQL; + + Test_1 (Connection_String); + Test_2 (Connection_String); + Test_3 (Connection_String); + Test_4 (Connection_String); + Test_5 (Connection_String); + Test_6 (Connection_String); + Test_7 (Connection_String); + Test_8 (Connection_String); + Test_9 (Connection_String); + Test_10 (Connection_String); + Test_11 (Connection_String); + end; +end PostgreSQL_Test; diff --git a/languages/ada/test/postgresql_test.gpr b/languages/ada/test/postgresql_test.gpr new file mode 100644 index 00000000..1af59d32 --- /dev/null +++ b/languages/ada/test/postgresql_test.gpr @@ -0,0 +1,12 @@ +with "../soci_ada.gpr"; +with "../soci_postgresql.gpr"; +with "../postgresql_client.gpr"; + +project PostgreSQL_Test is + for Main use ("postgresql_test"); + + package Compiler is + for Default_Switches ("Ada") use ("-gnat05", "-gnata"); + end Compiler; +end PostgreSQL_Test; + From 56fc379f5821a85b096adc1c6623071e32139acf Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Thu, 14 Jul 2011 13:50:49 +0200 Subject: [PATCH 17/19] Latest changes from the master branch. --- CMakeLists.txt | 2 +- CTestConfig.cmake | 13 ++ backends/oracle/test/test-oracle.cpp | 22 +- cmake/SociBackend.cmake | 327 +++++++++++++++++++++++++++ 4 files changed, 361 insertions(+), 3 deletions(-) create mode 100644 CTestConfig.cmake create mode 100644 cmake/SociBackend.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 0473ee58..1c7d011b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ set(INCLUDEDIR "include" CACHE PATH "The directory to install includes into.") ################################################################################# # Enable CTest support ################################################################################# -#include(CTest) +include(CTest) enable_testing() # Define "make check" as alias for "make test" diff --git a/CTestConfig.cmake b/CTestConfig.cmake new file mode 100644 index 00000000..7ecf20dc --- /dev/null +++ b/CTestConfig.cmake @@ -0,0 +1,13 @@ +## This file should be placed in the root directory of your project. +## Then modify the CMakeLists.txt file in the root directory of your +## project to incorporate the testing dashboard. +## # The following are required to uses Dart and the Cdash dashboard +## ENABLE_TESTING() +## INCLUDE(CTest) +set(CTEST_PROJECT_NAME "SOCI") +set(CTEST_NIGHTLY_START_TIME "00:00:00 EST") + +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "my.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=SOCI") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/backends/oracle/test/test-oracle.cpp b/backends/oracle/test/test-oracle.cpp index e580f519..7066b2d7 100644 --- a/backends/oracle/test/test-oracle.cpp +++ b/backends/oracle/test/test-oracle.cpp @@ -18,6 +18,7 @@ // #include #include +#include #include #include @@ -39,7 +40,16 @@ void test1() sql << "select t from (select :t as t from dual)", into(t1), use(t2); - assert(memcmp(&t1, &t2, sizeof(std::tm)) == 0); + + assert(t1.tm_sec == t2.tm_sec); + assert(t1.tm_min == t2.tm_min); + assert(t1.tm_hour == t2.tm_hour); + assert(t1.tm_mday == t2.tm_mday); + assert(t1.tm_mon == t2.tm_mon); + assert(t1.tm_year == t2.tm_year); + assert(t1.tm_wday == t2.tm_wday); + assert(t1.tm_yday == t2.tm_yday); + assert(t1.tm_isdst == t2.tm_isdst); // make sure the date is stored properly in Oracle char buf[25]; @@ -62,7 +72,15 @@ void test1() sql << "select t from (select :t as t from dual)", into(t1), use(t2); - assert(memcmp(&t1, &t2, sizeof(std::tm)) == 0); + assert(t1.tm_sec == t2.tm_sec); + assert(t1.tm_min == t2.tm_min); + assert(t1.tm_hour == t2.tm_hour); + assert(t1.tm_mday == t2.tm_mday); + assert(t1.tm_mon == t2.tm_mon); + assert(t1.tm_year == t2.tm_year); + assert(t1.tm_wday == t2.tm_wday); + assert(t1.tm_yday == t2.tm_yday); + assert(t1.tm_isdst == t2.tm_isdst); // make sure the date is stored properly in Oracle char buf[25]; diff --git a/cmake/SociBackend.cmake b/cmake/SociBackend.cmake new file mode 100644 index 00000000..3deba6b5 --- /dev/null +++ b/cmake/SociBackend.cmake @@ -0,0 +1,327 @@ +################################################################################ +# SociBackend.cmake - part of CMake configuration of SOCI library +################################################################################ +# Copyright (C) 2010 Mateusz Loskot +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +################################################################################ +# Macros in this module: +# +# soci_backend +# - defines project of a database backend for SOCI library +# +# soci_backend_test +# - defines test project of a database backend for SOCI library +################################################################################ + +# Defines project of a database backend for SOCI library +# +# soci_backend(backendname +# HEADERS header1 header2 +# DEPENDS dependency1 dependency2 +# DESCRIPTION description +# AUTHORS author1 author2 +# MAINTAINERS maintainer1 maintainer2) +# +macro(soci_backend NAME) + parse_arguments(THIS_BACKEND + "HEADERS;DEPENDS;DESCRIPTION;AUTHORS;MAINTAINERS;" + "" + ${ARGN}) + + message(STATUS "") + colormsg(HIGREEN "${NAME} - ${THIS_BACKEND_DESCRIPTION}") + + # Backend name variants utils + string(TOLOWER "${PROJECT_NAME}" PROJECTNAMEL) + string(TOLOWER "${NAME}" NAMEL) + string(TOUPPER "${NAME}" NAMEU) + + # Backend option available to user + set(THIS_BACKEND_OPTION SOCI_${NAMEU}) + option(${THIS_BACKEND_OPTION} + "Attempt to build ${PROJECT_NAME} backend for ${NAME}" ON) + + # Determine required dependencies + set(THIS_BACKEND_DEPENDS_INCLUDE_DIRS) + set(THIS_BACKEND_DEPENDS_LIBRARIES) + set(THIS_BACKEND_DEPENDS_DEFS) + set(DEPENDS_NOT_FOUND) + + # CMake 2.8+ syntax only: + #foreach(dep IN LISTS THIS_BACKEND_DEPENDS) + foreach(dep ${THIS_BACKEND_DEPENDS}) + + soci_check_package_found(${dep} DEPEND_FOUND) + if(NOT DEPEND_FOUND) + list(APPEND DEPENDS_NOT_FOUND ${dep}) + else() + string(TOUPPER "${dep}" DEPU) + list(APPEND THIS_BACKEND_DEPENDS_INCLUDE_DIRS ${${DEPU}_INCLUDE_DIR}) + list(APPEND THIS_BACKEND_DEPENDS_INCLUDE_DIRS ${${DEPU}_INCLUDE_DIRS}) + list(APPEND THIS_BACKEND_DEPENDS_LIBRARIES ${${DEPU}_LIBRARIES}) + list(APPEND THIS_BACKEND_DEPENDS_DEFS -DHAVE_${DEPU}=1) + endif() + endforeach() + + list(LENGTH DEPENDS_NOT_FOUND NOT_FOUND_COUNT) + + if (NOT_FOUND_COUNT GREATER 0) + + colormsg(_RED_ "WARNING:") + colormsg(RED "Some required dependencies of ${NAME} backend not found:") + + if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8) + foreach(dep ${DEPENDS_NOT_FOUND}) + colormsg(RED " ${dep}") + endforeach() + else() + foreach(dep IN LISTS DEPENDS_NOT_FOUND) + colormsg(RED " ${dep}") + endforeach() + endif() + + # TODO: Abort or warn compilation may fail? --mloskot + colormsg(RED "Skipping") + + set(${THIS_BACKEND_OPTION} OFF) + + else(NOT_FOUND_COUNT GREATER 0) + + if(${THIS_BACKEND_OPTION}) + + # Backend-specific include directories + list(APPEND THIS_BACKEND_DEPENDS_INCLUDE_DIRS ${SOCI_SOURCE_DIR}/core) + set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES + "${THIS_BACKEND_DEPENDS_INCLUDE_DIRS}") + + # Backend-specific preprocessor definitions + add_definitions(${THIS_BACKEND_DEPENDS_DEFS}) + + # Backend installable headers and sources + if (NOT THIS_BACKEND_HEADERS) + file(GLOB THIS_BACKEND_HEADERS *.h) + endif() + file(GLOB THIS_BACKEND_SOURCES *.cpp) + set(THIS_BACKEND_HEADERS_VAR SOCI_${NAMEU}_HEADERS) + set(${THIS_BACKEND_HEADERS_VAR} ${THIS_BACKEND_HEADERS}) + + # Group source files for IDE source explorers (e.g. Visual Studio) + source_group("Header Files" FILES ${THIS_BACKEND_HEADERS}) + source_group("Source Files" FILES ${THIS_BACKEND_SOURCES}) + source_group("CMake Files" FILES CMakeLists.txt) + + # Backend target + set(THIS_BACKEND_TARGET ${PROJECTNAMEL}_${NAMEL}) + set(THIS_BACKEND_TARGET_VAR SOCI_${NAMEU}_TARGET) + set(${THIS_BACKEND_TARGET_VAR} ${THIS_BACKEND_TARGET}) + + soci_target_output_name(${THIS_BACKEND_TARGET} ${THIS_BACKEND_TARGET_VAR}_OUTPUT_NAME) + + set(THIS_BACKEND_TARGET_OUTPUT_NAME ${${THIS_BACKEND_TARGET_VAR}_OUTPUT_NAME}) + set(THIS_BACKEND_TARGET_OUTPUT_NAME_VAR ${THIS_BACKEND_TARGET_VAR}_OUTPUT_NAME) + + # TODO: Extract as macros: soci_shared_lib_target and soci_static_lib_target --mloskot + + # Shared library target + add_library(${THIS_BACKEND_TARGET} + SHARED + ${THIS_BACKEND_SOURCES} + ${THIS_BACKEND_HEADERS}) + + target_link_libraries(${THIS_BACKEND_TARGET} + ${SOCI_CORE_TARGET} + ${THIS_BACKEND_DEPENDS_LIBRARIES}) + + if(WIN32) + set_target_properties(${THIS_BACKEND_TARGET} + PROPERTIES + OUTPUT_NAME ${THIS_BACKEND_TARGET_OUTPUT_NAME} + DEFINE_SYMBOL SOCI_DLL) + else() + set_target_properties(${THIS_BACKEND_TARGET} + PROPERTIES + SOVERSION ${${PROJECT_NAME}_SOVERSION}) + endif() + + set_target_properties(${THIS_BACKEND_TARGET} + PROPERTIES + VERSION ${${PROJECT_NAME}_VERSION} + CLEAN_DIRECT_OUTPUT 1) + + # Static library target + add_library(${THIS_BACKEND_TARGET}-static + STATIC + ${THIS_BACKEND_SOURCES} + ${THIS_BACKEND_HEADERS}) + + set_target_properties(${THIS_BACKEND_TARGET}-static + PROPERTIES + OUTPUT_NAME ${THIS_BACKEND_TARGET_OUTPUT_NAME} + PREFIX "lib" + CLEAN_DIRECT_OUTPUT 1) + + # Backend installation + install(FILES ${THIS_BACKEND_HEADERS} + DESTINATION + ${INCLUDEDIR}/${PROJECTNAMEL}/${NAMEL}) + + install(TARGETS ${THIS_BACKEND_TARGET} ${THIS_BACKEND_TARGET}-static + RUNTIME DESTINATION ${BINDIR} + LIBRARY DESTINATION ${LIBDIR} + ARCHIVE DESTINATION ${LIBDIR}) + + else() + colormsg(HIRED "${NAME}" RED "backend disabled, since") + endif() + + endif(NOT_FOUND_COUNT GREATER 0) + + boost_report_value(${THIS_BACKEND_OPTION}) + + if(${THIS_BACKEND_OPTION}) + boost_report_value(${THIS_BACKEND_TARGET_VAR}) + boost_report_value(${THIS_BACKEND_TARGET_OUTPUT_NAME_VAR}) + boost_report_value(${THIS_BACKEND_HEADERS_VAR}) + + soci_report_directory_property(COMPILE_DEFINITIONS) + endif() + + # LOG + #message("soci_backend:") + #message("NAME: ${NAME}") + #message("${THIS_BACKEND_OPTION} = ${SOCI_BACKEND_SQLITE3}") + #message("DEPENDS: ${THIS_BACKEND_DEPENDS}") + #message("DESCRIPTION: ${THIS_BACKEND_DESCRIPTION}") + #message("AUTHORS: ${THIS_BACKEND_AUTHORS}") + #message("MAINTAINERS: ${THIS_BACKEND_MAINTAINERS}") + #message("HEADERS: ${THIS_BACKEND_HEADERS}") + #message("SOURCES: ${THIS_BACKEND_SOURCES}") + #message("DEPENDS_LIBRARIES: ${THIS_BACKEND_DEPENDS_LIBRARIES}") + #message("DEPENDS_INCLUDE_DIRS: ${THIS_BACKEND_DEPENDS_INCLUDE_DIRS}") +endmacro() + +# Generates .vcxproj.user for target of each test. +# +# soci_backend_test_create_vcxproj_user( +# PostgreSQLTest +# "host=localhost dbname=soci_test user=mloskot") +# +function(soci_backend_test_create_vcxproj_user TARGET_NAME TEST_CMD_ARGS) + if(MSVC) + set(SYSTEM_NAME $ENV{USERDOMAIN}) + set(USER_NAME $ENV{USERNAME}) + set(SOCI_TEST_CMD_ARGS ${TEST_CMD_ARGS}) + + if(MSVC_VERSION EQUAL 1600) + configure_file( + ${SOCI_SOURCE_DIR}/cmake/resources/vs2010-test-cmd-args.vcxproj.user.in + ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.vcxproj.user + @ONLY) + endif() + endif() +endfunction(soci_backend_test_create_vcxproj_user) + +# Defines test project of a database backend for SOCI library +# +# soci_backend_test(BACKEND mybackend SOURCE mytest1.cpp +# NAME mytest1 +# CONNSTR "my test connection" +# DEPENDS library1 library2) +# +macro(soci_backend_test) + parse_arguments(THIS_TEST + "BACKEND;SOURCE;CONNSTR;NAME;DEPENDS;" + "" + ${ARGN}) + + # Test backend name + string(TOUPPER "${THIS_TEST_BACKEND}" BACKENDU) + string(TOLOWER "${THIS_TEST_BACKEND}" BACKENDL) + + if(SOCI_TESTS AND SOCI_${BACKENDU} AND NOT SOCI_${BACKENDU}_DO_NOT_TEST) + + # Test name + if(THIS_TEST_NAME) + string(TOUPPER "${THIS_TEST_NAME}" NAMEU) + set(TEST_FULL_NAME SOCI_${BACKENDU}_TEST_${NAMEU}) + else() + set(TEST_FULL_NAME SOCI_${BACKENDU}_TEST) + endif() + + set(TEST_CONNSTR_VAR ${TEST_FULL_NAME}_CONNSTR) + set(${TEST_CONNSTR_VAR} "" + CACHE STRING "Connection string for ${BACKENDU} test") + + if(NOT ${TEST_CONNSTR_VAR} AND THIS_TEST_CONNSTR) + set(${TEST_CONNSTR_VAR} ${THIS_TEST_CONNSTR}) + endif() + boost_report_value(${TEST_CONNSTR_VAR}) + + include_directories(${SOCI_SOURCE_DIR}/core/test) + include_directories(${SOCI_SOURCE_DIR}/backends/${BACKENDL}) + + # TODO: Find more generic way of adding Boost to core and backend tests only. + # Ideally, from within Boost.cmake. + set(SOCI_TEST_DEPENDENCIES) + if(Boost_FOUND) + include_directories(${Boost_INCLUDE_DIRS}) + if(Boost_DATE_TIME_FOUND) + set(SOCI_TEST_DEPENDENCIES ${Boost_DATE_TIME_LIBRARY}) + add_definitions(-DHAVE_BOOST_DATE_TIME=1) + endif() + endif() + + string(TOLOWER "${TEST_FULL_NAME}" TEST_TARGET) + + set(TEST_HEADERS ${PROJECT_SOURCE_DIR}/core/test/common-tests.h) + + add_executable(${TEST_TARGET} ${TEST_HEADERS} ${THIS_TEST_SOURCE}) + add_executable(${TEST_TARGET}_static ${TEST_HEADERS} ${THIS_TEST_SOURCE}) + + target_link_libraries(${TEST_TARGET} + ${SOCI_CORE_TARGET} + ${SOCI_${BACKENDU}_TARGET} + ${${BACKENDU}_LIBRARIES} + ${SOCI_TEST_DEPENDENCIES}) + + target_link_libraries(${TEST_TARGET}_static + ${SOCI_CORE_TARGET}-static + ${SOCI_${BACKENDU}_TARGET}-static + ${${BACKENDU}_LIBRARIES} + ${SOCI_CORE_STATIC_DEPENDENCIES} + ${SOCI_TEST_DEPENDENCIES}) + + add_test(${TEST_TARGET} + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_TARGET} + ${${TEST_CONNSTR_VAR}}) + + add_test(${TEST_TARGET}_static + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_TARGET}_static + ${${TEST_CONNSTR_VAR}}) + + # Convenient .vcxproj.user making tests ready to run and debug from within IDE + soci_backend_test_create_vcxproj_user(${TEST_TARGET} "\"${${TEST_CONNSTR_VAR}}\"") + soci_backend_test_create_vcxproj_user(${TEST_TARGET}_static "\"${${TEST_CONNSTR_VAR}}\"") + + # Ask make check to try to build tests first before executing them + add_dependencies(check ${TEST_TARGET} ${TEST_TARGET}_static) + + # Group source files for IDE source explorers (e.g. Visual Studio) + source_group("Header Files" FILES ${TEST_HEADERS}) + source_group("Source Files" FILES ${THIS_TEST_SOURCE}) + source_group("CMake Files" FILES CMakeLists.txt) + + endif() + + # LOG + #message("NAME=${NAME}") + #message("THIS_TEST_NAME=${THIS_TEST_NAME}") + #message("THIS_TEST_BACKEND=${THIS_TEST_BACKEND}") + #message("THIS_TEST_CONNSTR=${THIS_TEST_CONNSTR}") + #message("THIS_TEST_SOURCE=${THIS_TEST_SOURCE}") + #message("THIS_TEST_OPTION=${THIS_TEST_OPTION}") + +endmacro() From 357b802ca3d90075f3318b9b9caff0cc7a758487 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Thu, 14 Jul 2011 14:19:50 +0200 Subject: [PATCH 18/19] Latest changes from the master branch. --- cmake/dependencies/Boost.cmake | 14 ++++++++++++++ cmake/dependencies/MySQL.cmake | 10 ++++++++++ cmake/dependencies/ODBC.cmake | 10 ++++++++++ cmake/dependencies/Oracle.cmake | 5 +++++ cmake/dependencies/PostgreSQL.cmake | 5 +++++ cmake/dependencies/SQLite3.cmake | 5 +++++ cmake/dependencies/Threads.cmake | 5 +++++ 7 files changed, 54 insertions(+) create mode 100644 cmake/dependencies/Boost.cmake create mode 100644 cmake/dependencies/MySQL.cmake create mode 100644 cmake/dependencies/ODBC.cmake create mode 100644 cmake/dependencies/Oracle.cmake create mode 100644 cmake/dependencies/PostgreSQL.cmake create mode 100644 cmake/dependencies/SQLite3.cmake create mode 100644 cmake/dependencies/Threads.cmake diff --git a/cmake/dependencies/Boost.cmake b/cmake/dependencies/Boost.cmake new file mode 100644 index 00000000..c64af9ee --- /dev/null +++ b/cmake/dependencies/Boost.cmake @@ -0,0 +1,14 @@ +set(Boost_FIND_QUIETLY TRUE) + +set(Boost_USE_STATIC_LIBS ON) +set(Boost_USE_MULTITHREADED ON) +find_package(Boost 1.33.1 COMPONENTS date_time) + +if (NOT Boost_date_time_FOUND) + find_package(Boost 1.33.1) +endif() + +set(Boost_RELEASE_VERSION + "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") + +boost_external_report(Boost RELEASE_VERSION INCLUDE_DIR LIBRARIES) diff --git a/cmake/dependencies/MySQL.cmake b/cmake/dependencies/MySQL.cmake new file mode 100644 index 00000000..3b1dbdad --- /dev/null +++ b/cmake/dependencies/MySQL.cmake @@ -0,0 +1,10 @@ +set(MySQL_FIND_QUIETLY TRUE) + +find_package(MySQL) + +boost_external_report(MySQL INCLUDE_DIR LIBRARIES) + +#if(MYSQL_FOUND) +# include_directories(${MYSQL_INCLUDE_DIR}) +# add_definitions(-DHAVE_MYSQL) +#endif() diff --git a/cmake/dependencies/ODBC.cmake b/cmake/dependencies/ODBC.cmake new file mode 100644 index 00000000..93aa9410 --- /dev/null +++ b/cmake/dependencies/ODBC.cmake @@ -0,0 +1,10 @@ +set(ODBC_FIND_QUIETLY TRUE) + +find_package(ODBC) + +boost_external_report(ODBC INCLUDE_DIRECTORIES LIBRARIES) + +#if(MYSQL_FOUND) +# include_directories(${MYSQL_INCLUDE_DIR}) +# add_definitions(-DHAVE_MYSQL) +#endif() \ No newline at end of file diff --git a/cmake/dependencies/Oracle.cmake b/cmake/dependencies/Oracle.cmake new file mode 100644 index 00000000..c6645204 --- /dev/null +++ b/cmake/dependencies/Oracle.cmake @@ -0,0 +1,5 @@ +set(ORACLE_FIND_QUIETLY TRUE) + +find_package(Oracle) + +boost_external_report(Oracle INCLUDE_DIR LIBRARIES) diff --git a/cmake/dependencies/PostgreSQL.cmake b/cmake/dependencies/PostgreSQL.cmake new file mode 100644 index 00000000..4a4feeec --- /dev/null +++ b/cmake/dependencies/PostgreSQL.cmake @@ -0,0 +1,5 @@ +set(PostgreSQL_FIND_QUIETLY TRUE) + +find_package(PostgreSQL) + +boost_external_report(PostgreSQL INCLUDE_DIR LIBRARIES VERSION) \ No newline at end of file diff --git a/cmake/dependencies/SQLite3.cmake b/cmake/dependencies/SQLite3.cmake new file mode 100644 index 00000000..0daa9a59 --- /dev/null +++ b/cmake/dependencies/SQLite3.cmake @@ -0,0 +1,5 @@ +set(SQLITE3_FIND_QUIETLY TRUE) + +find_package(SQLite3) + +boost_external_report(SQLite3 INCLUDE_DIR LIBRARIES) diff --git a/cmake/dependencies/Threads.cmake b/cmake/dependencies/Threads.cmake new file mode 100644 index 00000000..953bb975 --- /dev/null +++ b/cmake/dependencies/Threads.cmake @@ -0,0 +1,5 @@ +set(Threads_FIND_QUIETLY TRUE) + +find_package(Threads) +message(STATUS "X: ${Threads_FOUND}") +boost_external_report(Threads LIBRARIES) From 089d0126e7aeb5b5323281ba32a08420f8f366d5 Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Mon, 24 Oct 2011 18:45:49 +0200 Subject: [PATCH 19/19] [Dev] Integrated upstream changes on SQLite3 back-end. --- AUTHORS | 4 ++++ CHANGES | 4 ++-- backends/sqlite3/session.cpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index f13a9cfe..78a6303b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -118,3 +118,7 @@ soci_backend_test_create_vcxproj_user ==== Mario Valesco ==== Mario tested building SOCI using MinGW toolset. + +==== Gevorg Voskanyan ==== + +Gevorg submitted new exception type postgresql_soci_error to PostgreSQL backend. diff --git a/CHANGES b/CHANGES index 901fc822..88c81e3a 100644 --- a/CHANGES +++ b/CHANGES @@ -3,8 +3,6 @@ This file contains the history of changes in the SOCI library. --- Version 3.1.0 differs from 3.0.0 in the following ways: - TODO - to be reviewed - - Added Ada language binding - Migraded build system from GNU Autotools and Visual Studio projects to CMake @@ -65,6 +63,8 @@ Version 3.1.0 differs from 3.0.0 in the following ways: - Changed naming convensions and style across all the source code +- Firebird backend removed from official release as not actively maintained. Available in the Git repository. + --- Version 3.0.0 differs from 2.2.0 in the following ways: diff --git a/backends/sqlite3/session.cpp b/backends/sqlite3/session.cpp index 9b03c4df..0fdc4be9 100644 --- a/backends/sqlite3/session.cpp +++ b/backends/sqlite3/session.cpp @@ -46,7 +46,7 @@ sqlite3_session_backend::sqlite3_session_backend( std::string synchronous; std::string dbname(connectString); std::stringstream ssconn(connectString); - while (!ssconn.eof() && ssconn.str().find('=') >= 0) + while (!ssconn.eof() && ssconn.str().find('=') != std::string::npos) { std::string key, val; std::getline(ssconn, key, '=');