added sqlite connection class (progress)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef QUERY_CONNECTION_HPP
|
||||
#define QUERY_CONNECTION_HPP
|
||||
|
||||
#include "matador/sql/connection_intermediates.hpp"
|
||||
#include "matador/sql/query_intermediates.hpp"
|
||||
#include "matador/sql/dialect.hpp"
|
||||
#include "matador/sql/query_builder.hpp"
|
||||
|
||||
@@ -12,20 +12,21 @@ namespace matador::sql {
|
||||
class connection
|
||||
{
|
||||
public:
|
||||
connection();
|
||||
query_create_intermediate create();
|
||||
query_drop_intermediate drop();
|
||||
query_select_intermediate select(std::initializer_list<std::string> column_names);
|
||||
query_insert_intermediate insert();
|
||||
query_update_intermediate update(const std::string &table);
|
||||
query_delete_intermediate remove();
|
||||
connection() = default;
|
||||
explicit connection(std::string dns);
|
||||
|
||||
void open();
|
||||
void close();
|
||||
[[nodiscard]] bool is_open() const;
|
||||
|
||||
[[nodiscard]] const std::string& dns() const;
|
||||
|
||||
query_result<record> fetch(const std::string &sql);
|
||||
std::pair<size_t, std::string> execute(const std::string &sql);
|
||||
|
||||
private:
|
||||
dialect dialect_;
|
||||
query_builder query_;
|
||||
std::string dns_;
|
||||
bool is_open_{false};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user