![]() |
Home | Libraries | People | FAQ | More |
(Deprecated) Executes a SQL text query.
template< class CompletionToken> auto async_query( string_view query_string, results& result, diagnostics& diag, CompletionToken&& token);
Sends query_string
to
the server for execution and reads the response into result
.
query_string should be encoded using the connection's character set.
After this operation completes successfully, result.has_value() == true
.
Metadata in result
will
be populated according to this->meta_mode()
.
If you compose query_string
by concatenating strings manually, your code is
vulnerable to SQL injection attacks. If your query contains
patameters unknown at compile time, use prepared statements instead of
this function.
This function is only provided for backwards-compatibility. For new code,
please use execute
or async_execute
instead.
If CompletionToken
is
a deferred completion token (e.g. use_awaitable
),
the string pointed to by query_string
must be kept alive by the caller until the operation is initiated.
The handler signature for this operation is void(boost::mysql::error_code)
.