|
tdslite latest
C++ API reference
|
tdslite main TDS driver More...
#include <tdslite/detail/tdsl_driver.hpp>
Classes | |
| struct | connection_parameters_base |
Public Member Functions | |
| template<typename... Args> | |
| tdsl_driver (Args &&... args) noexcept | |
| Construct a new tdsl driver object. | |
| template<typename T > | |
| auto | connect (const connection_parameters_base< T > &p) noexcept -> e_driver_error_code |
Try to connect to the SQL server with details specified in p. | |
| auto | set_info_callback (info_callback_type callback, void *user_ptr=nullptr) noexcept -> void |
| Set callback function for INFO/ERROR messages. | |
| template<typename T > | |
| auto | execute_query (T command, sql_command_row_callback row_callback=+[](void *, const tds_colmetadata_token &, const tdsl_row &) -> void {}, void *uptr=nullptr) noexcept -> sql_command_query_result |
| Send a query to the server. | |
| template<tdsl::uint32_t N> | |
| auto | execute_query (const char(&command)[N], sql_command_row_callback row_callback=+[](void *, const tds_colmetadata_token &, const tdsl_row &) -> void {}, void *uptr=nullptr) noexcept -> sql_command_query_result |
| Send a query to the server (const char array overload) | |
| template<tdsl::uint32_t N> | |
| auto | execute_query (const char16_t(&command)[N], sql_command_row_callback row_callback=+[](void *, const tds_colmetadata_token &, const tdsl_row &) -> void {}, void *uptr=nullptr) noexcept -> sql_command_query_result |
| Send a query to the server (const char16_t array overload) | |
| template<typename T , traits::enable_when::same_any_of< T, string_view, wstring_view, struct progmem_string_view > = true> | |
| sql_command_rpc_result | execute_rpc (T command, tdsl::span< sql_parameter_binding > params={}, sql_command_rpc_mode mode={sql_command_rpc_mode::executesql}, sql_command_row_callback row_callback=+[](void *, const tds_colmetadata_token &, const tdsl_row &) -> void {}, void *rcb_uptr=nullptr) noexcept |
| Perform a remote procedure call (e.g. | |
| void | option_set_read_column_names (bool value) noexcept |
| Enable/disable column name reading for the result set returned from the commands. | |
| NetImpl & | network () noexcept |
| The network implementation, for its own settings (e.g. | |
tdslite main TDS driver
| NetImpl | The networking implementation |
| using tdsl::detail::tdsl_driver< NetImpl >::tds_context_type = detail::tds_context<NetImpl> |
| using tdsl::detail::tdsl_driver< NetImpl >::info_callback_type = typename tds_context_type::info_callback_type::function_type |
| using tdsl::detail::tdsl_driver< NetImpl >::login_context_type = detail::login_context<NetImpl> |
| using tdsl::detail::tdsl_driver< NetImpl >::login_parameters_type = typename login_context_type::login_parameters |
| using tdsl::detail::tdsl_driver< NetImpl >::pmem_login_parameters_type = typename login_context_type::pmem_login_parameters |
| using tdsl::detail::tdsl_driver< NetImpl >::wlogin_parameters_type = typename login_context_type::wlogin_parameters |
| using tdsl::detail::tdsl_driver< NetImpl >::sql_command_type = detail::command_context<NetImpl> |
| using tdsl::detail::tdsl_driver< NetImpl >::sql_command_options_type = typename sql_command_type::command_options |
| using tdsl::detail::tdsl_driver< NetImpl >::sql_command_rpc_mode = e_rpc_mode |
| using tdsl::detail::tdsl_driver< NetImpl >::sql_command_rpc_result = typename sql_command_type::execute_rpc_result |
| using tdsl::detail::tdsl_driver< NetImpl >::sql_command_row_callback = typename sql_command_type::row_callback_fn_t |
| using tdsl::detail::tdsl_driver< NetImpl >::sql_command_query_result = typename sql_command_type::query_result |
| using tdsl::detail::tdsl_driver< NetImpl >::connection_parameters = connection_parameters_base<login_parameters_type> |
| using tdsl::detail::tdsl_driver< NetImpl >::wconnection_parameters = connection_parameters_base<wlogin_parameters_type> |
| using tdsl::detail::tdsl_driver< NetImpl >::progmem_connection_parameters = connection_parameters_base<pmem_login_parameters_type> |
|
strong |
|
inlinenoexcept |
Construct a new tdsl driver object.
(forwarding constructor)
|
inlinenoexcept |
Try to connect to the SQL server with details specified in p.
| [in] | p | Connection parameters |
|
inlinenoexcept |
Set callback function for INFO/ERROR messages.
This callback function will be called when server sends INFO/ERROR tokens. Useful for diagnostics.
| [in] | callback | Pointer to the function to call whenever an INFO token is received |
| [in] | user_ptr | (optional) User-supplied first argument to pass to the callback function. nullptr by default (unused). |
|
inlinenoexcept |
Send a query to the server.
| [in] | command | SQL command to execute |
| [in] | uptr | User supplied pointer, will be passed to row_callback as first argument on every invocation |
| [in] | row_callback | Callback to invoke for each row received as a result to the query. (optional) |
request_too_large is set. The command must leave 8 bytes of the buffer free, for the packet header. If the driver is not logged in (e.g. connect() failed), nothing is sent and network_error is set.
|
inlinenoexcept |
Send a query to the server (const char array overload)
| [in] | command | SQL command to execute |
| [in] | uptr | User supplied pointer, will be passed to row_callback as first argument on every invocation |
| [in] | row_callback | Callback to invoke for each row received as a result to the query. (optional) |
request_too_large is set. The command must leave 8 bytes of the buffer free, for the packet header. If the driver is not logged in (e.g. connect() failed), nothing is sent and network_error is set.
|
inlinenoexcept |
Send a query to the server (const char16_t array overload)
| [in] | command | SQL command to execute |
| [in] | uptr | User supplied pointer, will be passed to row_callback as first argument on every invocation |
| [in] | row_callback | Callback to invoke for each row received as a result to the query. (optional) |
request_too_large is set. The command must leave 8 bytes of the buffer free, for the packet header. If the driver is not logged in (e.g. connect() failed), nothing is sent and network_error is set.
|
inlinenoexcept |
Perform a remote procedure call (e.g.
execute a stored procedure or a parameterized query)
| T | String view type |
| [in] | command | Command to execute |
| [in] | params | Parameters of the command, if any |
| [in] | mode | RPC execution mode |
| [in] | row_callback | Row callback function (optional) |
| [in] | rcb_uptr | Row callback user pointer (optional) |
The result set returned by query command can be read by providing a row callback function
mode value is invalid command or the parameter declarations are longer than 4000 characters (not executed)
|
inlinenoexcept |
Enable/disable column name reading for the result set returned from the commands.
| [in] | value | The value |
|
inlinenoexcept |
The network implementation, for its own settings (e.g.
timeouts, TLS). Change them before connect().