query compiler progress
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "matador/utils/access.hpp"
|
||||
|
||||
#include "matador/sql/column.hpp"
|
||||
#include "matador/sql/column_definition.hpp"
|
||||
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
@@ -13,8 +13,8 @@ namespace matador::sql {
|
||||
class record
|
||||
{
|
||||
private:
|
||||
using column_by_index = std::vector<column>;
|
||||
using column_index_pair = std::pair<std::reference_wrapper<column>, size_t>;
|
||||
using column_by_index = std::vector<column_definition>;
|
||||
using column_index_pair = std::pair<std::reference_wrapper<column_definition>, size_t>;
|
||||
using column_by_name_map = std::unordered_map<std::string, column_index_pair>;
|
||||
|
||||
public:
|
||||
@@ -22,8 +22,8 @@ public:
|
||||
using const_iterator = column_by_index::const_iterator;
|
||||
|
||||
record() = default;
|
||||
record(std::initializer_list<column> columns);
|
||||
explicit record(const std::vector<column> &columns);
|
||||
record(std::initializer_list<column_definition> columns);
|
||||
explicit record(const std::vector<column_definition> &columns);
|
||||
record(const record &x);
|
||||
record& operator=(const record &x);
|
||||
record(record&&) noexcept = default;
|
||||
@@ -43,15 +43,15 @@ public:
|
||||
append(make_column<Type>(name, size));
|
||||
}
|
||||
|
||||
void append(column col);
|
||||
void append(column_definition col);
|
||||
|
||||
[[nodiscard]] bool has_primary_key() const;
|
||||
[[nodiscard]] const column& primary_key() const;
|
||||
[[nodiscard]] const column_definition& primary_key() const;
|
||||
|
||||
[[nodiscard]] const std::vector<column>& columns() const;
|
||||
[[nodiscard]] const std::vector<column_definition>& columns() const;
|
||||
|
||||
[[nodiscard]] const column& at(const std::string &name) const;
|
||||
[[nodiscard]] const column& at(size_t index) const;
|
||||
[[nodiscard]] const column_definition& at(const std::string &name) const;
|
||||
[[nodiscard]] const column_definition& at(size_t index) const;
|
||||
|
||||
iterator find(const std::string &column_name);
|
||||
[[nodiscard]] const_iterator find(const std::string &column_name) const;
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
private:
|
||||
void init();
|
||||
void add_to_map(column &col, size_t index);
|
||||
void add_to_map(column_definition &col, size_t index);
|
||||
|
||||
private:
|
||||
column_by_index columns_;
|
||||
|
||||
Reference in New Issue
Block a user