dc373e4b2b
- playground/tables/CMakeLists.txt - playground/tables/data_table.cpp - playground/tables/self_test.cpp - playground/tables/tql_duckdb.cpp - playground/tables/tql_duckdb.h Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
30 lines
855 B
C++
30 lines
855 B
C++
// tql_duckdb: ejecuta SQL DuckDB sobre TableInputs in-memory.
|
|
// Solo se compila si FN_TQL_DUCKDB esta definido. Adapter opcional para
|
|
// tql_to_sql emit -> execute. Ver issue 0080.
|
|
#pragma once
|
|
|
|
#ifdef FN_TQL_DUCKDB
|
|
|
|
#include "data_table_logic.h"
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace tql_duckdb {
|
|
|
|
struct Result {
|
|
data_table::StageOutput out;
|
|
std::string error; // non-empty si fallo
|
|
int row_count = 0;
|
|
double duration_ms = 0.0;
|
|
};
|
|
|
|
// Impure: abre DuckDB in-memory, registra tablas como CREATE TABLE + INSERT,
|
|
// prepara sql con `?` placeholders bound a `params`, materializa resultado.
|
|
Result execute(const std::string& sql,
|
|
const std::vector<std::string>& params,
|
|
const std::vector<data_table::TableInput>& tables);
|
|
|
|
} // namespace tql_duckdb
|
|
|
|
#endif // FN_TQL_DUCKDB
|