3#include <mutable/mutable-config.hpp>
46bool M_EXPORT
init(
void);
55std::unique_ptr<DatabaseCommand> M_EXPORT
command_from_string(Diagnostic &diag,
const std::string &str);
58void M_EXPORT
execute_statement(Diagnostic &diag,
const ast::Stmt &stmt,
bool is_stdin =
false);
61void M_EXPORT
process_stream(std::istream &in,
const char *filename, Diagnostic diag);
68 std::unique_ptr<Consumer> consumer);
73 const Backend &backend);
78void M_EXPORT
execute_physical_plan(Diagnostic &diag,
const MatchBase &physical_plan,
const Backend &backend);
82[[deprecated(
"Use command_from_string() instead.")]]
83void M_EXPORT
execute_query(Diagnostic &diag,
const ast::SelectStmt &stmt, std::unique_ptr<Consumer> consumer);
85[[deprecated(
"Use command_from_string() instead.")]]
86void M_EXPORT
execute_query(Diagnostic &diag,
const ast::SelectStmt &stmt, std::unique_ptr<Consumer> consumer,
87 const Backend &backend);
101 const std::filesystem::path &path,
102 std::size_t num_rows = std::numeric_limits<std::size_t>::max(),
103 bool has_header =
false,
104 bool skip_header =
false);
112void M_EXPORT
execute_file(Diagnostic &diag,
const std::filesystem::path &path);
120 mutable std::unique_ptr<m::StackMachine>
writer_;
131 void append(
const Tuple &tup)
const;
void M_EXPORT load_from_CSV(Diagnostic &diag, Table &table, const std::filesystem::path &path, std::size_t num_rows=std::numeric_limits< std::size_t >::max(), bool has_header=false, bool skip_header=false)
Loads a CSV file into a Table.
std::unique_ptr< Consumer > M_EXPORT logical_plan_from_statement(Diagnostic &diag, const ast::SelectStmt &stmt, std::unique_ptr< Consumer > consumer)
Optimizes the given SelectStmt.
void M_EXPORT process_stream(std::istream &in, const char *filename, Diagnostic diag)
Extracts and executes statements from given stream.
std::unique_ptr< DatabaseCommand > M_EXPORT command_from_string(Diagnostic &diag, const std::string &str)
Create a DatabaseCommand from str.
void M_EXPORT execute_statement(Diagnostic &diag, const ast::Stmt &stmt, bool is_stdin=false)
Optimizes and executes the given Stmt.
std::unique_ptr< ast::Instruction > M_EXPORT instruction_from_string(Diagnostic &diag, const std::string &str)
Use lexer and parser to create an Instruction from str.
void M_EXPORT execute_instruction(Diagnostic &diag, const ast::Instruction &instruction)
Executes the given Instruction.
void M_EXPORT execute_physical_plan(Diagnostic &diag, const MatchBase &physical_plan)
Executes the given physical plan.
void M_EXPORT execute_file(Diagnostic &diag, const std::filesystem::path &path)
Execute the SQL file at path.
std::unique_ptr< ast::Stmt > M_EXPORT statement_from_string(Diagnostic &diag, const std::string &str)
Use lexer, parser, and semantic analysis to create a Stmt from str.
void M_EXPORT execute_query(Diagnostic &diag, const ast::SelectStmt &stmt, std::unique_ptr< Consumer > consumer)
Optimizes and executes the given SelectStmt.
bool M_EXPORT init(void)
Initializes the mu*t*able library.
std::unique_ptr< MatchBase > M_EXPORT physical_plan_from_logical_plan(Diagnostic &diag, const Consumer &logical_plan)
Computes a physical plan from the given logical plan.
A Schema represents a sequence of identifiers, optionally with a prefix, and their associated types.
This class provides direct write access to the contents of a Store.
Schema S
the schema of the tuples to read/write
std::unique_ptr< m::StackMachine > writer_
the writing StackMachine
Store & store_
the store to access
const Schema & schema() const
Returns the Schema of Tuples to write.
Defines a generic store interface.
Models how data is laid out in a linear address space.