slightly better print, column alias supported

This commit is contained in:
2021-08-14 20:01:15 +02:00
parent 5201f32023
commit fb5098cf1d
9 changed files with 61 additions and 29 deletions

6
row.h
View File

@@ -61,7 +61,7 @@ namespace usql {
ColumnType getColType() override { return ColumnType::float_type; };
long getIntValue() override { return (long) m_double; };
double getDoubleValue() override { return m_double; };
std::string getStringValue() override { return std::to_string(m_double); };
std::string getStringValue() override { return Settings::double_to_string(m_double); };
long getDateValue() override { return (long) m_double; };
bool getBoolValue() override { throw Exception("Not supported on ColDoubleValue"); };
@@ -144,8 +144,8 @@ namespace usql {
ColValue * ith_column(int i) const { return m_columns[i].get(); }
int compare(const Row &other) const;
void print(const std::vector<int> & col_char_sizes);
void print(const std::vector<ColDefNode> &col_defs);
static int print_get_column_size(const ColDefNode &col_def);
private:
std::vector<std::unique_ptr<ColValue>> m_columns;
};