introduced table repository
This commit is contained in:
@@ -23,6 +23,7 @@ public:
|
||||
|
||||
record() = default;
|
||||
record(std::initializer_list<column> columns);
|
||||
explicit record(const std::vector<column> &columns);
|
||||
record(const record&) = default;
|
||||
record& operator=(const record&) = default;
|
||||
record(record&&) noexcept = default;
|
||||
@@ -44,8 +45,13 @@ public:
|
||||
|
||||
void append(column col);
|
||||
|
||||
bool has_primary_key() const;
|
||||
const column& primary_key() const;
|
||||
|
||||
[[nodiscard]] const std::vector<column>& columns() const;
|
||||
|
||||
[[nodiscard]] const column& at(const std::string &name) const;
|
||||
const column& at(size_t index) const;
|
||||
[[nodiscard]] const column& at(size_t index) const;
|
||||
|
||||
iterator find(const std::string &column_name);
|
||||
[[nodiscard]] const_iterator find(const std::string &column_name) const;
|
||||
@@ -62,9 +68,15 @@ public:
|
||||
[[nodiscard]] bool empty() const;
|
||||
void clear();
|
||||
|
||||
private:
|
||||
void init();
|
||||
void add_to_map(column &col, size_t index);
|
||||
|
||||
private:
|
||||
column_by_index columns_;
|
||||
column_by_name_map columns_by_name_;
|
||||
|
||||
int pk_index_{-1};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user