0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00
Commit Graph

17 Commits

Author SHA1 Message Date
margaretselzer
e99f50d803 SQLite3: Add test for execute() running a prepared_statement 2024-09-18 06:16:56 +00:00
Roland Bock
46cffc8398 Ignore trailing spaces in sqlite3 statements, #585 2024-07-26 14:13:11 +02:00
Roland Bock
93ab3fef86 Throw exception for multi-statements in sqlite3 execute #558
Before this change, sqlite3::connection::execute silently
ignores statements after the first one (separated by semicolon).

After this change, trailing statements are detected and an
sqlpp::exception is thrown.

This change also adds documentation to other connectors indicating
that execute is supposed to be used with single statements only,
even though it is possible to do otherwise.
2024-03-09 10:54:16 +01:00
MeanSquaredError
9b49afa306
Add is_transaction_active() to all connectors (#550)
* Document the connector API method is_transaction_active()
* Move mysql::connection_base::is_transaction_active() to the other transaction-handling methods.
* Add more tests for mysql::connection::is_transaction_active()
* Add postgresql::connection_base::is_transaction_active()
* Add tests for postgresql::connection_base::is_transaction_active()
* Change the type of the SQLite3 transaction status from transaction_status_type to a boolean flag.
* Add sqlite3::connection_base::is_transaction_active()
* Add tests for sqlite3::connection_base::is_transaction_active()
* When closing a transaction do it in the following order: report (if any), execute SQL command, set transaction active flag to false.
2024-01-05 08:59:42 +01:00
MeanSquaredError
623b5154d0
Add connection methods is_connected() and ping_server() (#528)
* Replace connection handle method check_connection() with is_connected() and ping_server()

* When a connections is fetched from a pool perform a validity check which can be one of none, passive or ping.

* Add the methods is_connected() and ping_server() to the connection template class.

* Remove unused #include and add mising #include.

* Add tests for the connection methods is_connected() and ping_server().
2023-09-20 06:38:16 +02:00
MeanSquaredError
c550dca89e
Cleanup SQLite3 connector code (#514)
* Move the code for sqlpp::sqlite3::detail::prepared_statement_handle_t to include/sqlpp11/sqlite3/detail/prepared_statement_handle.h

* Whitespace

* Move the code for sqlpp::sqlite3::detail::connection_handle to include/sqlpp11/sqlite3/detail/connection_handle.h

* Rename sqlpp::sqlite3::serializer_t -> sqlpp::sqlite3::context_t

* Add const qualifiers to sqlpp::mysql::context_t::escape() and its parameter.

* Change method argument types "const std::string" -> "const std::string&"

* Remove a superfluous function that forwards the call to sqlite3_close().

* Move initialization of sqlpp::sqlite3::detail::prepared_statement_handle_t data members from the constructor into the member initialization list.

* Rename method parameter from CamelCase to snake_case.
2023-08-17 07:26:54 +02:00
MeanSquaredError
a085d730c9
Replace include guards with "#pragma once" in all header files and in the database model generator scripts. (#506) 2023-07-25 07:00:05 +02:00
MeanSquaredError
dff8c23b22
Connection pools (#499)
Add support for connection pooling

* Add support for connection pooling to the core code.
* Add support for PostgreSQL connection pooling with tests.
* Add support for SQLite3 connection pooling with tests.
* Add support for MySQL connection pooling with tests.
2023-07-17 06:14:23 +02:00
Bernd Lörwald
9412851408
#471 serializers: ensure float precision (#472)
* value: add missing includes
* mysql, sqlite3: use explicitly *out* stringstreams for serialization
* postgresql: fix: use max_digits10 instead of digits10
* detail: add float_safe_ostringstream, ensuring floats are serialized with enough precision
* mysql, postgresql, sqlite3, tests: fix: set float-precision for all streams
* run clang-format on changed files
* inline remove_cvref.h
* replace unspecific "wrapper" with concrete type name
* tests: split connector specific tests out of serialize/Float
2023-02-18 08:10:50 +01:00
hwhsu1231
2aa9797117 style: Align CMake files with 4 spaces indent 2022-11-26 08:32:46 +01:00
Roland Bock
256429730a Fix CMake warnings (CMP0115) 2022-06-06 10:14:01 +02:00
Roland Bock
d6aef0fa9b Remove obsolete pointer indirection, fix warnings and a leak
Leak: The sqlite3 connection handle destructor was
accidentally turned into a default constructor during the
migration of repositories.

Replaced the sqlite3 raw pointer with a unique_ptr to prevent
this kind of accident.
2022-01-11 07:35:20 +01:00
Leon De Andrade
d17bce9644
Add Connector CMake Logic (#394)
Add Connector Cmake logic

* Also install date when used with fetch content
* Install everything always
* Update documentation
* Add option to control dependency searching
* Adjust travis
2021-12-02 07:45:38 +01:00
Roland Bock
8572c821aa Streamline test names and locations 2021-10-11 10:31:25 +02:00
Roland Bock
caee00e849 Fix missing inline attributes for sqlite3 connector
Changed sqlite3 usage tests to be linked into one executable.
This provokes multiple definition errors for non-inlined free
functions.
Also ran clang-format on the changed headers.
2021-10-11 08:37:14 +02:00
Roland Bock
64aba48cb9 Make sqlite3 connector header-only 2021-08-22 12:44:34 +02:00
Roland Bock
2e683a4b69 Moved sqlite3 over here. 2021-08-01 20:37:36 +02:00