Files
rippled/docs/api/client.md
Brad Chase 855681a40b Squashed 'src/soci/' changes from b2855dce5..79e222e3c
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
2017-12-02 13:44:06 -05:00

32 KiB

API 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.

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_long_long, dt_unsigned_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();
    explicit session(connection_parameters const & parameters);
    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;

    bool get_next_sequence_value(std::string const & sequence, long & value);
    bool get_last_insert_id(std::string const & table, long & value);

    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);

    std::string get_dummy_from_table() const;
    std::string get_dummy_from_clause() const;

    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 or the special parameters object containing both the backend and the connection string as well as possibly other connection options. 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_next_sequence_value returns true if the next value of the sequence with the specified name was generated and returned in its second argument. Unless you can be sure that your program will use only databases that support sequences, consider using this method in conjunction with get_last_insert_id() as explained in "Working with sequences" section.
  • get_last_insert_id returns true if it could retrieve the last value automatically generated by the database for an auto-incremented field. Notice that although this method takes the table name, for some databases, such as Microsoft SQL Server and SQLite, this value is actually global, so you should attempt to retrieve it immediately after performing an insertion.
  • 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_dummy_from_table and get_dummy_from_clause(): helpers for writing portable DML statements, see DML helpers for more details.
  • 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_parameters

The connection_parameters class is a simple container for the backend pointer, connection string and any other connection options. It is used together with session constructor and open() method.

class connection_parameters
{
public:
    connection_parameters();
    connection_parameters(backend_factory const & factory, std::string const & connectString);
    connection_parameters(std::string const & backendName, std::string const & connectString);
    explicit connection_parameters(std::string const & fullConnectString);

    void set_option(const char * name, std::string const & value);
    bool get_option(const char * name, std::string & value) const
};

The methods of this class are:

  • Default constructor is rarely used as it creates an uninitialized object and the only way to initialize it later is to assign another, valid, connection_parameters object to this one.
  • The other constructors correspond to the similar constructors of the session class and specify both the backend, either as a pointer to it or by name, and the connection string.
  • set_option can be used to set the value of an option with the given name. Currently all option values are strings, so if you need to set a numeric option you need to convert it to a string first. If an option with the given name had been already set before, its old value is overwritten.

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 entryin 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.

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 dat 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 bind_clean_up();

    void prepare(std::string const & query);
    void define_and_bind();

    bool execute(bool withDataExchange = false);
    long long get_affected_rows();
    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.
  • bind_clean_up function for cleaning up any bound references. It allows to keep statement in cache and reuse it later with new references by calling exchange for each new bind variable.
  • 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.
  • get_affected_rows function returns the number of rows affected by the last statement. Returns -1 if it's not implemented by the backend being used.
  • 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 *blob_handle;
blob_handle soci_create_blob(session_handle s);
void soci_destroy_blob(blob_handle b);

int soci_blob_get_len(blob_handle b);
int soci_blob_read(blob_handle b, int offset, char *buf, int toRead);
int soci_blob_write(blob_handle b, int offset, char const *buf, int toWrite);
int soci_blob_append(blob_handle b, char const *buf, int toWrite);
int soci_blob_trim(blob_handle b, int newLen);

int soci_blob_state(blob_handle b);
char const * soci_blob_error_message(blob_handle b);

The functions above provide the blob abstraction with the help of opaque handle. The soci_blob_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.

For easy error testing, functions soci_blob_read, soci_blob_write, soci_blob_append, and soci_blob_trim return -1 in case of error and 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_blob, which returns NULL if it was not possible to create an internal object representing the blob.

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_blob     (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.

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);
blob_handle  soci_get_into_blob     (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_blob     (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_blob     (statement_handle st, char const * name, blob_handle blob);

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);
blob_handle  soci_get_use_blob     (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.