1#include "duckdb/function/table/sqlite_functions.hpp"
2#include "duckdb/parser/parsed_data/create_view_info.hpp"
3#include "duckdb/parser/query_node/select_node.hpp"
4#include "duckdb/parser/expression/star_expression.hpp"
5#include "duckdb/parser/tableref/table_function_ref.hpp"
6#include "duckdb/parser/expression/function_expression.hpp"
7#include "duckdb/catalog/catalog.hpp"
8
9using namespace std;
10
11namespace duckdb {
12
13void BuiltinFunctions::RegisterSQLiteFunctions() {
14 PragmaCollations::RegisterFunction(*this);
15 PragmaTableInfo::RegisterFunction(*this);
16 SQLiteMaster::RegisterFunction(*this);
17
18 CreateViewInfo info;
19 info.schema = DEFAULT_SCHEMA;
20 info.view_name = "sqlite_master";
21 info.on_conflict = OnCreateConflict::REPLACE;
22
23 auto select = make_unique<SelectNode>();
24 select->select_list.push_back(make_unique<StarExpression>());
25 vector<unique_ptr<ParsedExpression>> children;
26
27 auto function = make_unique<FunctionExpression>(DEFAULT_SCHEMA, "sqlite_master", children);
28 auto function_expr = make_unique<TableFunctionRef>();
29 function_expr->function = move(function);
30 select->from_table = move(function_expr);
31 info.query = move(select);
32 // catalog.CreateView(transaction, &info);
33}
34
35} // namespace duckdb
36