From 3c1f8f2b741d6419d34e8f65d692f940442a6db4 Mon Sep 17 00:00:00 2001 From: Victor Hiairrassary Date: Tue, 17 Dec 2024 23:54:00 +0100 Subject: [PATCH] wip --- src/http_handler/handler.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/http_handler/handler.cpp b/src/http_handler/handler.cpp index 0dd1c24..4b2ce83 100644 --- a/src/http_handler/handler.cpp +++ b/src/http_handler/handler.cpp @@ -55,9 +55,9 @@ void HttpHandler(const duckdb_httplib_openssl::Request& req, duckdb_httplib_open auto elapsed = std::chrono::duration_cast(end - start); QueryExecStats stats { - .elapsed_sec = static_cast(elapsed.count()) / 1000, - .read_bytes = 0, - .read_rows = 0 + static_cast(elapsed.count()) / 1000, + 0, + 0 }; // Format output @@ -122,8 +122,9 @@ QueryApiParameters ExtractQueryApiParameters(const duckdb_httplib_openssl::Reque } else { return QueryApiParameters { - .sqlQueryOpt = ExtractSqlQuerySimple(req), - .outputFormat = ExtractOutputFormatSimple(req), + ExtractSqlQuerySimple(req), + std::nullopt, + ExtractOutputFormatSimple(req), }; } } @@ -210,9 +211,9 @@ QueryApiParameters ExtractQueryApiParametersComplexImpl(yyjson_doc* bodyDoc) { } return QueryApiParameters { - .sqlQueryOpt = std::string(yyjson_get_str(queryVal)), - .sqlParametersOpt = ExtractQueryParameters(yyjson_obj_get(bodyRoot, "parameters")), - .outputFormat = ParseOutputFormat(std::string(yyjson_get_str(formatVal))), + std::string(yyjson_get_str(queryVal)), + ExtractQueryParameters(yyjson_obj_get(bodyRoot, "parameters")), + ParseOutputFormat(std::string(yyjson_get_str(formatVal))), }; }