diff --git a/include/questdb/ingress/line_sender.hpp b/include/questdb/ingress/line_sender.hpp index b4c8f7d3..2ae58e62 100644 --- a/include/questdb/ingress/line_sender.hpp +++ b/include/questdb/ingress/line_sender.hpp @@ -1247,6 +1247,42 @@ namespace questdb::ingress } } + /** + * Send the batch of rows in the buffer to the QuestDB server, and, if the parameter + * `transactional` is true, ensure the flush will be transactional. + * See docs on the ::line_sender_flush_and_keep_with_flags() function for more details. + */ + bool flush_and_keep_with_flags(const line_sender_buffer& buffer, bool transactional) + { + try + { + if (buffer._impl) + { + ensure_impl(); + line_sender_error::wrapped_call( + ::line_sender_flush_and_keep_with_flags, + _impl, + buffer._impl, + transactional); + } + else + { + line_sender_buffer buffer2{0}; + buffer2.may_init(); + line_sender_error::wrapped_call( + ::line_sender_flush_and_keep_with_flags, + _impl, + buffer2._impl, + transactional); + } + } + catch (...) + { + return false; + } + return true; + } + /** * Check if an error occurred previously and the sender must be closed. * This happens when there was an earlier failure.