myTinySQL v0.2.0-2-g5000098
A tiny SQL interpreter over fixed-width text files
Loading...
Searching...
No Matches
Output.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <string>
7#include <string_view>
8#include <vector>
9
10#include "Catalog.hpp"
11#include "Session.hpp"
12
13namespace tinysql {
14
19std::string renderText(const StatementResult& result);
20
28std::string renderJson(const std::vector<StatementResult>& results);
29
36std::string renderTablesJson(const std::vector<TableSchema>& tables);
37
38} // namespace tinysql
The table definitions read from SYSTEM_TABLE: tables, their columns and positions.
std::string renderText(const StatementResult &result)
Formats one result for the console.
Definition Output.cpp:67
std::string renderTablesJson(const std::vector< TableSchema > &tables)
Builds the JSON answer of GET /api/tables: every table with its columns.
Definition Output.cpp:131
std::string renderJson(const std::vector< StatementResult > &results)
Builds the JSON answer of POST /api/sql: one object per statement that has something to show.
Definition Output.cpp:95
Running statements, and the results they produce.