LibSQL+SQLServer+SQLStudio+sql: Send result rows over IPC as SQL::Value

We've been sending the values converted to a string, but now that the
Value type is transferrable over IPC, send the values themselves. Any
client that wants the value as a string may do so easily, whereas this
will allow less trivial clients to avoid string parsing.
This commit is contained in:
Timothy Flynn 2022-12-03 11:34:30 -05:00 committed by Andreas Kling
parent 27ce88864f
commit b9d8c25b0b
Notes: sideshowbarker 2024-07-19 01:59:31 +09:00
8 changed files with 17 additions and 18 deletions

View file

@ -24,6 +24,7 @@
#include <LibSQL/AST/Lexer.h>
#include <LibSQL/AST/Token.h>
#include <LibSQL/SQLClient.h>
#include <LibSQL/Value.h>
#include "MainWidget.h"
#include "ScriptEditor.h"
@ -224,8 +225,12 @@ MainWidget::MainWidget()
m_sql_client->on_execution_success = [this](auto, auto, auto, auto, auto, auto) {
read_next_sql_statement_of_editor();
};
m_sql_client->on_next_result = [this](auto, auto, auto const& row) {
m_results.append(row);
m_sql_client->on_next_result = [this](auto, auto, auto row) {
m_results.append({});
m_results.last().ensure_capacity(row.size());
for (auto const& value : row)
m_results.last().unchecked_append(value.to_deprecated_string());
};
m_sql_client->on_results_exhausted = [this](auto, auto, auto) {
if (m_results.size() == 0)