mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-02 16:33:13 +00:00
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:
parent
27ce88864f
commit
b9d8c25b0b
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/trflynn89
Commit: b9d8c25b0b
Pull-request: https://github.com/SerenityOS/serenity/pull/16324
8 changed files with 17 additions and 18 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue