very basic version of usql

This commit is contained in:
2021-07-14 12:01:44 +02:00
parent f594437b61
commit 577370caef
21 changed files with 3189 additions and 1072 deletions

30
usql/table.h Normal file
View File

@@ -0,0 +1,30 @@
#pragma once
#include "parser.h"
#include "row.h"
#include <vector>
namespace usql {
struct Table {
Table(const Table &other);
Table(const std::string name, const std::vector<ColDefNode> columns);
ColDefNode get_column_def(const std::string &col_name);
int columns_count() const { return m_col_defs.size(); };
Row createEmptyRow(); // TODO this means unnecessary copying
void addRow(const Row &row);
void print();
std::string m_name;
std::vector<ColDefNode> m_col_defs;
std::vector<Row> m_rows;
};
}