79e222e3c [Travis] Switch to latest Oracle downloader v2.0.3 3992cd8f6 [Travis] Try travis-oracle downloader hotfix 958f1b010 [Travis] Use only ORACLE_LOGIN_userid and ORACLE_LOGIN_pass f03569ffe [Travis] Oracle has changed login form 682486db9 Merge pull request #607 from rocksolidwebdesign/master e8ed51c37 use fully qualified soci::session to fix build on macosx sierra c98c877bc [doc] Add note on factory objects not exported from DLLs d0552e64a Catch unhandled exception in PostgreSQL ODBC unit test 643853322 Add missing -DWITH_POSTGRESQL=ON to scripts\build.bat 82867ced7 [docs] Clarify name of MySQL package with client library a35851478 Complete scripts\built.bat with basic CMake options. 225d5a3a4 [CMake] Simplify warning messages d90a7acfc [docs] Fix CMake options for SQLite 3 3d32f5253 Merge pull request #596 from mloskot/ml/macro-soci-override 5d980ee98 Merge pull request #600 from mloskot/ml/cmake-update-FindDB2 05ab0bcf6 Add SOCI_OVERRIDE macro as conditional C++11 override specifier aa9744e0a [DB2] Add additional install paths to search for DB2 client 3069f242b Merge pull request #594 from mloskot/ml/cmake-postgresql-nosinglerow a5bb763ab Merge pull request #599 from mloskot/ml/cmake-drop-cdash 466fdf32c [docs] Update name DB2 driver/client library name a7f5240a1 [CMake] Add SOCI_POSTGRESQL_NOSINLGEROWMODE option (default OFF) 601a89227 [CMake] Remove CDash remains fffe6d9c8 [CMake] Tidy up FindOracle.cmake formatting 6157f8d97 [CMake] Add /usr/lib/oracle/*/client${LIB_SUFFIX} to searched paths bbc18d73d [firebird] Add Ubuntu firebird-dev package as dependency example fd18f5c6c [CMake] Determine LIB_SUFFIX from SOCI_TARGET_ARCH_X64 c5f59c9d3 [Travis] Revert remove of any notifications to soci-devel mailing list f7f2a6123 [Travis] Remove any notifications to soci-devel mailing list 6df733826 [docs] Add pages for Ada language bindings 41f288bf3 Merge pull request #595 from mloskot/ml/db2-null-dereference 62f4bf5c4 [db2] Fix null pointer dereference 340a72eda [CMake] FindPostgreSQL.cmake update lost POSTGRESQL_VERSION return 5da552537 [docs] Remove Ada pages from TOC due to building failure 5e0e70c95 [docs] Add copyright footer ea0f6c11e [docs] Add languages/ada pages to TOC 2ab0fb901 Add CHANGELOG.md generated from GitHub 961368043 Add changelog.sh utility to generate CHANGELOG.md from GitHub 0621bd610 [Circle] Fix missing checkout in workflow 2c45f2bc5 [docs] Fix issues reported by markdownlint 46071f5f6 [docs] Replace HTML tables with Markdown tables 80a86c0eb Format compact table in README 14b693e64 [docs] Avoid markdownlint warnings about line length 13031a831 [docs] Fix README.md linting issues 2d575b8d7 [docs] Add link to master branch docs on docs.html 8427054b7 [Circle] Fix markdownlint invocation cc75d6e09 [Circle] Fix global installation of markdownlint-cli 522c7bbb6 [docs] Add .markdownlint.json configuration file 498381595 [AppVeyor] Add build job with Visual Studio 2017 (#588) fd37e3b80 [AppVeyor] Update badge after switch to organizational account 51d058f04 Repair VC8 compile of test applications (#593) c2310cf54 [Circle] Add markdownlint and define lint-build-deploy workflow for docs b9f4007e4 Fix __GNUC__ condition ignoring -Wmaybe-uninitialized 08fe54076 Ignored -Wmaybe-uninitialized in GCC all versions following 4.7 29be6f860 Merge pull request #592 from mloskot/ml/replace-alternative-tokens a161e24c1 Replace C alternative boolean operator representations with primary tokens 07a23d8a2 [CircleCI] Disable gem. Requires separate docker w/ Ruby df87eb1eb [CircleCI] Install markdownlint gem 92de7a387 [Vagrant] Fix bach if. Silence wget. Add logging. 6b9531179 [Vagrant] Update setup with primary VM and optionals. 4cb3b636f [Travis] Disable clang jobs to save on built times 4e98cd2cf [docs] Add MySQL 8.0.1 on Windows to tested versions 275965736 Add CMake options to disable/enable individual backends. cba05c702 Add build.bat for convenience of Visual Studio users 67c479ed9 Merge pull request #590 from mloskot/ml/cmake-update-FindPostgreSQL 35d2df6f4 [cmake] Update FindPostgreSQL.cmake from CMake 3.9 4fdfbf817 [cmake] Improve testing of Abc_FOUND and ABC_FOUND variables 3f006d3ae Fix copy-paste typo error in README bd3ee7a48 [CI] Fix webhook specs and events d31d17be3 [CI] Fix webhook URLs and use default events 34ced08e3 Fix URLs for badges in README 1653bd0b7 Update badges in README 7a4704be3 [Travis] Update webhook for notifications on gitter.im/SOCI/soci 17167fd97 [AppVeyor] Update webhook for notifications on gitter.im/SOCI/soci 95e55689e [Circle] Update webhook for notifications on gitter.im/SOCI/soci 68b914b19 Add footer: BSL © Maciej Sobczak and contributors. 8bf913e9c [Circle] Add webhook to receive notification on Gitter chat 25b2ab9af Actually link the generated docs 4aa8d5ab9 Link docs generated for master as (development) a40420e4c [Circle] Use API token for the badge fc59a621c [Circle] Fix status badge 15eba50e8 Add CircleCI setup to build docs and deploy to SF.net 3fa0a58cb [EditorConfig] Add settings for YAML and CMake scripts b36f437bc Merge branch 'more-xml' b85ec90c6 Check that inserting malformed XML values fails 2b89a134a Enable XML/CLOB tests for PostgreSQL via ODBC 6e4732102 Add very simple XML and CLOB support to ODBC backend fabb8f0f0 Make XML comparison in the test work for SQL Server too 11a8982d5 Add a helper function for copying strings in ODBC backend too 556f5d336 Add exchange_type_traits<> specializations for XML and CLOB f1243acdf Add helper function for copying string to PostgreSQL backend 5e6f37e35 Document types used for XML and CLOB support in Firebird backend bd236c8c8 Merge branch 'xml-firebird' e6e1ad305 Merge pull request #585 from mloskot/ml/enable-oracle-for-pulls 0cadedaf5 Enable Oracle builds for pull requests 93e844d02 [Travis] Update Oracle installation setup 3a82540aa Also throw if unsupported type is used for vector "into" in DB2 0f1756c55 Throw if unsupported type is used for vector "into" parameter 3a7677425 Merge branch 'odbc-vec-into-null' ff2464925 Merge branch 'oracle-fix-null-str' 023f4df03 Skip running Oracle tests for PR builds on Travis CI df4039923 Fix bug with null strings in bull selections in ODBC and DB2 6ca9cd64a Add REQUIRE_NOTHROW() around SQL statements in the string test 63bcc8944 Add workaround for empty strings being null in Oracle 2d74f9aaa Merge pull request #579 from mloskot/ml/travis-oracle-restore c3b943c87 Restore Oracle build job on Travis CI 9943459f4 Add support for XML type to Firebird backend too 059faf5d9 Add CLOB support to Firebird backend 85159db6f Refactor: move XML and CLOB tests to common code 4744c1705 Fix the build after the previous commit 201c89f0e Fixed wrong handling of errors in single-row mode for PostgreSQL. e26d134b4 Merge pull request #577 from mloskot/ml/bin-to-scripts 6363537e6 Add Windows shell scripts with CRLF to .editorconfig d38b21ca6 Move directory /bin to /scripts 316885a37 Merge pull request #576 from alexott/editorconfig 461a44585 Update .editorconfig with comments from review 2c7c312d7 Add support for EditorConfig 09c26314d Allow defining SOCI_POSTGRESQL_NOSINLGEROWMODE for PostgreSQL < 9 4b451971a Avoid using overloaded virtual methods in vector type backends f6980d2ce Merge pull request #572 from alexott/coverity-fixes 23d2f2593 fix some of warnings from fresh Coverity report 25eb5bdb3 Initialize indISCHolder_ member in firebird_into/use_type_backend classes 042dc0fd9 Merge pull request #570 from mcencora/master 9d82ee8e7 Remove unnecessary namespace qualification 3db8f4371 cmake: export SOCI public include directories e4ab099df Fix undefined sanitizer warnings 8fdb2e7ea Merge pull request #566 from mloskot/ml/mkdocs 80941a9d9 Update structure of SOCI 4.0.0 documentation 9c8191903 Fixed Makefile build for PostgreSQL (broken by other modifications). e7db59c74 Merge pull request #557 from msobczak/master f6d08a75f Merge pull request #564 from Arenoros/master 43229ecfe Fix types for SQLite3 backend ed25eea2c Fix session::get_table_names() for sqlite backend 7a6559c18 Merge branch 'odbc-string-len' c6aef12b1 Add test checking string length when using bulk insert 51c4c1e1a Fix the length of strings in DB2 vector operations be4f26fea Fix the length of strings in ODBC vector operations 521a84085 Improve get_affected_rows() documentation e7e7fb78a Return -1 from get_affected_rows() in ODBC backend if unknown 97a4728cb Remove loop that could be never executed from ODBC code 1a0eeb186 Fix harmless variable shadowing warnings e7cdd4754 Fix loss of error message in ODBC backend when using vectors 06915e483 Add check for absence of unneeded truncation too 82038018c Merge branch 'refactor-parse-std-tm' 56bc9f9c5 Return int, not long, from parse10() helper 281f54f51 Check for negative date components in parse10() f2e84c4bf Don't pass exception message to parse10() helper a1e07e389 Avoid duplicate code for parsing dates in different backends e2f1ca530 Fix libraries link order when linking tests statically a3685fd09 Fix unused parameter warnings in Oracle backend code 488825079 Explicitly use Ubuntu Precise for Travis builds 638b89d1f Merge remote-tracking branch 'upstream/master' 138b29e43 Lazy initialization of the temporary LOB objects for Oracle. a9ab0db16 Merge pull request #541 from ckaminski/master f938c0133 Get rid of allowed failures in Travis CI configuration 52539f8ab Merge branch 'odbc-mysql-bug' 2aeb32872 Fix reading from unallocated memory in ODBC with MySQL dc05c8e82 Use switch over exchange type in ODBC vector backend code 7bd491cf2 Fix check for clang in CMake configuration 702c214a9 Remove dummy stream insertion overload for boost::optional 1b416275d Remove Travis CI builds using Postgression d7c986c6b Disable MySQL unit test currently always resulting in a crash 2f65f02e8 Define SOCI_SQLITE3_SOURCE in all SQLite3 backend sources 4f1fbfcd4 Suppress memory leak report in glibc NSS under Ubuntu d91c2228c Add get_dummy_from_{table,clause}() methods 78bedc931 Consistently check for connection in the session object methods cf9cfa90c Fix DB2 backend build after x_xmltype and x_longstring additions 4b642ac5c Fixed handling of BINARY_DOUBLE in dynamic row. 2d621e8f3 Fixed memleak when reusing into and use elements. 9bb0f70b6 Revert "Fix inserting strings longer than 8000 bytes with ODBC/MS SQL" 7c28bd6c3 Fix inserting strings longer than 8000 bytes with ODBC/MS SQL b510e1a63 moved to latest Catch UT Framework (#544) 33ae81a71 Merge pull request #545 from snikulov/odbc_handle_defaults 92afc1f91 Use defaults for unsupported types in ODBC 7fba06984 disable autosetting of SOCI_CXX_C11 to OFF fa0e5b5a2 Merge pull request #536 from ddowling/master 723230fcc Support the OCI_SUCCESS_WITH_INFO return code in get_error_details f21578e2a Fix an uninitialised variable access when using the Oracle backend with a database type not in the standard accepted set. a912148f9 Fix uninitialized procedure::gotData_ 646efa070 Merge pull request #534 from mutcher/master 87509d52d Corrections in README.md 34c534722 Export struct sqlite3_soci_error from DLL on Windows. 840100102 Update .gitignore patterns for Visual Studio (Code) dc87a2c58 Docs markdown cleanup. e719c44bb Merge pull request #524 from ravselj/firebird_blob_bug 2edb58395 Firebird backend blob write bug fix. 0a88814c2 Added Firebird specific test indicating BLOB write bug. 6eb1a3e97 Fixed handling of empty long strings. e7194837e Added empty_blob() and nvl() to portable utilities. adae5ade8 Merge pull request #509 from msobczak/xml_clob 45eaff9e9 Added handling of big string in DDL. 9b2d48f3b Merge pull request #510 from mloskot/ml/add-missing-decl 8ae0f3962 Add missing declspec to properly export exception classes. f7b11ca71 Fixed handling of dt_xml in sqlite3. 1655a195e Added bigstring (XML and CLOB) support. 81a48efaf Fixed missing space in DDL. d68170494 Fixed handling of DDL alter column syntax. 1eb4c2935 Merge pull request #508 from msobczak/blob_offset 4b0dbab3e Added uniform offset for BLOB read/write operations. c5e37d273 Merge pull request #503 from wisk/cmake-package-export e082831ce export cmake package ba9963779 travis-ci: Allows to fail for odbc and mysql 92c430669 Merge pull request #454 from snikulov/enable_asan ec746bd1d Merge pull request #375 from ravselj/sqlite_load_one 88b331507 Merge pull request #487 from msobczak/bulkiterators 780a5c5d2 Corrected handling of vectors with user-defined types. 9e83a50c3 Merge pull request #494 from snikulov/fix_travis da09c7c6b Fix travis-ci build 307d94caf Merge pull request #492 from snikulov/av_odbc_driver_name 12708b190 Merge pull request #491 from snikulov/av_mingw_fix 4a0ac2ba3 Fixed driver name and passwd for PostgreSQL ODBC driver on AppVeyor 783e8b089 Fixed MinGW build with proper URL 0142d057f Merge pull request #489 from snikulov/fix_383 0723512f3 fixed #383 8d2901675 Added unit tests and docs for bulk iterators. 2f8a7a05e Added bulk iterators for Oracle and PostgreSQL. 2fcad8b24 Merge pull request #486 from msobczak/failover 002f6a9a7 Added docs for failover. 3daef94c7 Added failover callback for Oracle and PostgreSQL. a0b29bc94 Merge pull request #484 from msobczak/portable-DDL c959c3812 Added Oracle unit tests for DDL and metadata. 2a8e8965e Added PostgreSQL unit tests for DDL and metadata. cbee6429a Typo fixes and improved docs. 4244fae07 Merge pull request #482 from msobczak/PostgreSQL-singlerows 8d2a75baa Added support for portable DDL statements. a0917b7c8 Fixed multiple definitions bug with column_info. 596c6762b Merge pull request #480 from msobczak/metadata b70a4e8b2 Added singlerows mode for PostgreSQL. 816839514 Merge remote-tracking branch 'upstream/master' into metadata 30aca6230 Added docs for error categories. f2b2f4bc0 Added more error codes for error categories in Oracle. a05b61f1f Added docs and removed impractical function for metadata queries. 3c3fec623 Portable metadata queries. cd26169ef Added (partial) handling of OCI_SUCCESS_WITH_INFO in Oracle. 21a062023 Merge pull request #479 from snikulov/fix_478 bb8aaca05 fixed #478 376362493 Merge pull request #474 from wdavilaneto/master 23967e281 Merge pull request #475 from snikulov/cov_fixes ec65da5a5 Fixed uninited local std::tm structs 8cb99538c adding oracle remote connection exemple without tnsnames.ora 56379eb81 Merge pull request #471 from snikulov/fix_travis 25ac65fc5 Travis-CI: allowed failure for DB2 backend 8d8002b7b Merge pull request #470 from snikulov/fix_appvr 2895c7d06 Appveyour now using MySQL 5.7 d419e945a Update AppVeyor badge URL 5c14d49cc Remove info on binding char[] support. 57db62210 Added basic support for error categories. a1d45503b Documented Oracle wallet authentication option. cae51eec9 Added Oracle wallet authentication. 8c6b47977 Added NLS support for connection parameters in Oracle. 912649c2c Merge pull request #459 from shelomentsevd/master 8b70e0983 Documentation. exchange.md cleaned from typos c80646c0d Merge pull request #455 from snikulov/msvc2012_fix 3470079d1 compilation fix for msvc2012 d27fba19a Merge pull request #453 from snikulov/catch_updates 36e8fc91b updated catch.hpp version to 1.3.3 56b0b02b8 added Address Sanitizer to expose memory errors f26138913 Merge pull request #452 from vadz/cxx11 c07a42da0 Merge pull request #451 from vadz/config-vs-platform ec7d2dfc3 Define cxx_details::auto_ptr<> to get rid of preprocessor checks e06bfe96e Include soci/soci-platform.h instead of soci-config.h 6fbd8481e Avoid recursive inclusion between soci-{config,platform}.h 6caeb0b50 Merge pull request #449 from snikulov/appvr_up 78ea85ca1 fixed #447 ffc564b70 Use noexcept(false) for once_temp_type dtor with MSVS 2015 too 5e3813f50 Use C++11 deleted members for SOCI_NOT_{ASSIGNABLE,COPYABLE} 449e743b9 Merge pull request #446 from ArnaudD-FR/version 46513d877 CMake read version from version.h a8ab4c88b Revert "CMake generates soci/version.h" 6f68a7f00 Clean up already implemented features from TODO. 38d405935 Vagrant: update usage and development workflow. c2a387b2f Vagrant: correct DB2 database lookup for existing soci test db. f856f7730 Vagrant: fix accidental syntax error fb545a9b8 Vagrant: update usage documentation bd4d11d34 Add #define SOCI_HAVE_CXX_C11 mapped from with CMake SOCI_CXX_C11 option. e476b9d93 Vagrant: build with SOCI_CXX_C11=ON c6deb5d7e Vagrant: script formatting [ci skip] f4a47bfcb Vagrant: correct connection strings for tests 9b10e0ba2 Vagrant: set DB2 connection string for the backend tests. a84dade10 CMake: add boost_message_value as counterpart of boost_report_value. 540d33272 Vagrant: add SOCI_HOST variables for VMs networking d9e6d687a Merge pull request #438 from mloskot/db2-sqldriverconnect da61b6379 DB2: document option db2_option_driver_complete 838b99b62 DB2: Add sample SQLDriverConnect connection string 5d1ab2c77 DB2: Switch session from SQLConnect ot SQLDriverConnect ba8b1aa24 DB2: SQLExecute return code was not tested for SQL_NO_DATA. 837e88dec Vagrant: reorder booting to load DBs before dev env 8afea2f90 Vagrant: add SOCI_DB2_USER and SOCI_DB2_PASS variables 4a576a0c2 Vagrant: switch back to building from /vagrant share cd167df2e Vagrant: enable host to db2 networking on port 50000 7903d8e1a Vagrant: document networking support 04a59095d Vagrant: increase vm memory to 1024M 98ae7b206 Vagrant: try to avoid re-creation of soci DB if it exists 48a9c9797 Vagrant: do not run tests during provision 29c429ce9 Merge branch 'master' of https://github.com/SOCI/soci d6182bd9b Vagrant: add Avahi/MDNS to support resolving .local hostnames c22bfbcc1 Merge pull request #436 from ArnaudD-FR/test_version 094e19c68 CMake generates soci/version.h 2104cc9a6 Merge pull request #435 from ArnaudD-FR/test_definition 6908e473f Specify definitions in soci-config.h 634b2bf84 Vagrant: update DB2 CLI download steps 137efc496 Vagrant: add DB2 CLI client to soci.vm 435547064 Vagrant: define SOCI_* env variables via /etc/profile.d 569e8ecea CMake: add DB2 CLI driver locations 521f83cc0 Vagrant: correct comment [ci skip] e50025ea9 Vagrant: install zip [ci skip] a3e3f9671 Merge branch 'master' of https://github.com/SOCI/soci 6043cdf54 Vagrant: Add VM provisioned with DB2 instance and sample database 3a5066d9b Travis: remove sourcing of common.sh as unnecessary baad25922 Spell-check and formatting 111f5644d Preserve LF or CRLF for certain file types. 016687f03 Vagrant: explain debconf issue while installing Firebird 8a04c61c4 Merge pull request #434 from mloskot/master 01b9b48a3 Add Vagrant configuration 0ba242f51 Merge pull request #430 from ArnaudD-FR/sqlite3_reset d219a5790 [SQLITE3] Add reset API to reset sqlite3 statement fa708ad9f Merge pull request #428 from MonsieurNicolas/affectedRowFixSqlite 8cd3cf584 added test that reuses prepared statement 6af865fce reset count of affected rows (sqlite3) 149c53a43 Merge pull request #427 from snikulov/pr_coverity_init 0cc5c50ab - Fixed Coverity issues for SQLite3: 12644, 12645, 12646 - Fixed gcc/clang warns produced with -Wextra switch for SQLite3 9476a7a53 Merge pull request #426 from snikulov/pr_odbc_enable 86890bd2b Enabled mysql/postgresql - fixed #407 0232debc8 Merge pull request #425 from snikulov/cmake_win_cxx11 c2b37f0d2 moved SOCI_CXX_C11 define to common section 91fb559f0 Merge pull request #422 from snikulov/pr_374_fix 2af6c5efc Initialize rowid_backend-derived classes members in ctor 10e3c768a Avoid harmless Coverity dead code warning in MySQL code 4fd5c965a If prepare, execute, fetch... scenario is used and fetch() is called after gotData=false was already returned it begins another loop instead of returning false again indicating that all the data was already read. The following backend fix resolves this issue. e07f634a7 Added additional basic functionality test from prepare, execute, fetch scenario. 5b96f8c69 Clang: fixed #374 4576731e6 Disable email notifications to soci-devel 35bde9728 Merge pull request #420 from jeking3/feature/postgresql-uuid-unit-test ddde1f4c8 Merge pull request #421 from jeking3/bugfix/test-access-dsn-file-ignore 315b2cb5b add ignore of cmake generated dsn file for access 60abeb88c add a unit test for the postgresql uuid data type b1f730cd8 Merge pull request #419 from snikulov/pr_valgrind 8f51034cf Travis-CI: added valgrind check 185593f91 Merge pull request #418 from hw-dwalter/master b63e850cc fixed get_affected_rows() to pass test and fixed formatting 1ebc2661c Update .travis.yml to change coverity invokation branch ae3c4d2d8 Merge pull request #414 from hw-dwalter/master 90097ec73 added test to demonstrate bug #221 and make it valid with all backends b86a7b8ca Update README.md 6fe0a64bd Merge pull request #417 from snikulov/coverity_part_2 dff81b73e coverity: updated .travis.yml 8c0f35e21 Merge pull request #415 from snikulov/pr_413_rework 59d2cf016 Merge pull request #416 from snikulov/pr_travis_upd 1fa1a9413 Travis-CI: try add Coverity tool 63ef39126 AppVeyor: enable MSSQL ODBC connection 7aab87e8d Merge pull request #410 from snikulov/pr_appvr_mysql d36b06e26 Appveyor: added build for MySQL backend 8a67dbc63 Merge pull request #409 from snikulov/pr_appvr_postgres c0de792ae Appveyor: added PosgreSQL 9.4 backend 58975c6aa Merge pull request #408 from snikulov/pr_appvr_sqlite d0f6dec5f Appveyor: Added SQLite to build 4d2e19533 Merge pull request #406 from snikulov/appvr_db_services f7278ce54 Merge pull request #405 from snikulov/pr_odbc_test_reorg 629e64231 appvr: added db services to build workers 9d06e47a7 ODBC: test updates 14dfe5195 Appveyor: run ctest in test_script step 0530f6fec Avoid use of POSIX strptime function 68a335707 Add some variations for tests for use with indicators. 0d84fef30 Add std::tm checks to the use with indicators tests 985571234 Add tests for some variants with char* query 0b2837def Add test for query string as char* 3a49359bd Request CATCH to disable all the C++11 features. 24cbf26cd Merge pull request #403 from DraconPern/minorcmakefix 4fab0bb33 fixed typo 0e8223f89 Notify Gitter on every build 474c44443 Fix Gitter invalid token error 1eac4da5d Merge pull request #401 from snikulov/pr_appvr_boost da59e623d Merge pull request #400 from snikulov/pr_boost_opt c02d65340 Merge pull request #402 from ArnaudD-FR/master 09d6f9c81 Name struct to avoid clang error/warning (issue #374) 87e1c8384 Appveyor: added Boost libraries to build 063e75374 fix for #370 1fd43ebf6 Fix accidentally broken YAML syntax 87492930c Add Gitter integration webhooks for Travis CI and Appveyor 21ba1ddc8 Merge pull request #398 from snikulov/mingw_final 2060fa062 Merge pull request #399 from SOCI/snikulov-patch-1 c683042f6 Update README.md 59c49ed50 mingw: not use ms extension for MinGW G++ compilation 492d04249 Merge pull request #397 from snikulov/make_verbose e3e093b2e cmake: generate verbose build 903590290 Merge pull request #395 from snikulov/av_warn_fix d1fd85b45 connection-pool: moved common part out of #ifdef 6c8b6cd42 Switch Appveyor URL from snikulov/soci to mloskot/soci. b6443a4a2 Restore using -pedantic but use -Wno-pedantic-ms-format too 8fe5d2a1d Initialise in/out pos variable 96783407e Update connection-pool.cpp 21357eda7 Merge pull request #391 from snikulov/pr_appveyor_init 443beaa0b Don't add "-fPIC" explicitly, CMake does it automatically e607b1c73 Don't use "-pedantic" option when building with g++ 56207063b initial integration with AppVeyor-CI 8fda2bb37 boost: disable autolink, because soci controls required libs itself 7747cab51 updated to latest Catch UT framework to work with MinGW with PR #496 bb79b6074 cmake: updated FindODBC.cmake to search right sqlext.h on Windows 64dfb79f7 Merge pull request #381 from ravselj/sqlite_bug 23d398994 sqlite3_close moved after sqlite3_errmsg is called. d0f718350 Merge pull request #380 from dgrafe/subproject_integration_fixed f2261c40a Build system: Replacing CMAKE_SOURCE_DIR with CMAKE_CURRENT_SOURCE_DIR git-subtree-dir: src/soci git-subtree-split: 79e222e3c2278e6108137a2d26d3689418b37544
15 KiB
Backends reference
This part of the documentation is provided for those who want towrite (and contribute!) their own backends. It is anyway recommendedthat authors of new backend see the code of some existing backend forhints on how things are really done.
The backend interface is a set of base classes that the actual backendsare supposed to specialize. The main SOCI interface uses only theinterface and respecting the protocol (for example, the order of function calls) described here. Note that both the interface and theprotocol 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 otherbackends, where things are done differently and therefore have to beadjusted, 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_long_long, dt_unsigned_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_stdstring,
x_short,
x_integer,
x_long_long,
x_unsigned_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:
standard_into_type_backend() {}
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 theintoelement is bound, once and before the statement is executed. Thedatapointer points to the variable used forintoelement (or to thecstring_descriptorobject, which is artificially created when the plaincharbuffer is used for data exchange). Thepositionparameter 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. ThegotDataparameter istrueif the fetch operation really retrievedsome data andfalseotherwise;calledFromFetchistruewhen the call is from the fetch operation andfalseif 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.indpoints to the indicator provided by the user, or isNULL, 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 foreach value retrieved from the database.
If the given server supportsbinary data transmission and the data format for the given type agreeswith what is used on the client machine, then these two functions neednot do anything; otherwise buffer management and data conversionsshould go there.
class vector_into_type_backend
{
public:
vector_into_type_backend() {}
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.
bind_by_pos- Called for eachuseelement, once and before the statement is executed - for thoseuseelements that do not provide explicit names for parameter binding. The meaning of parameters is same as in previous classes.bind_by_name- Called for thoseuseelements 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).indpoints to the indicator provided by the user (or isNULL).post_use- Called after statement execution.gotDataandindhave the same meaning as instandard_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:
statement_backend() {}
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 long long get_affected_rows() = 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 (intoanduseelements); 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_affected_rows- Called to determine the actual number of rows affected by data modifying statement.get_number_of_rows- Called to determine the actual number of rows retrieved by the previous call toexecuteorfetch.rewrite_for_procedure_call- Used when theprocedureis used instead ofstatement, 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 theintoelement is used with therowtype, 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 eachintooruseelement, to create the objects of appropriate classes (described above).
Notes:
- Whether the query is executed using the simple one-time syntax or is prepared, the
alloc,prepareandexecutefunctions are always called, in this order. - All
intoanduseelements are bound (theirdefine_by_posorbind_by_pos/bind_by_namefunctions are called) between statement preparation and execution.
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 bool get_next_sequence_value(session&, std::string const&, long&);
virtual bool get_last_insert_id(session&, std::string const&, long&);
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 ofsessionare called by user.get_next_sequence_value,get_last_insert_id- Called to retrieve sequences or auto-generated values and every backend should define at least one of them to allow the code using auto-generated values to work.make_statement_backend,make_rowid_backend,make_blob_backend- Called to create respective implementations for thestatement,rowidandblobclasses.
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.