print column size fix
This commit is contained in:
@@ -75,7 +75,6 @@ int Table::load_csv_string(const std::string &content) {
|
||||
auto csv = csvparser.parseCSV(content);
|
||||
|
||||
std::vector<ColDefNode> &colDefs = m_col_defs;
|
||||
|
||||
for (auto it = csv.begin() + 1; it != csv.end(); ++it) {
|
||||
std::vector<std::string> csv_line = *it;
|
||||
|
||||
@@ -133,7 +132,8 @@ void Table::print() {
|
||||
std::vector<int> col_char_sizes{};
|
||||
|
||||
for(const auto& col_def : m_col_defs) {
|
||||
int col_size = col_def.type == ColumnType::varchar_type ? col_def.length : 10;
|
||||
int col_size = col_def.type == ColumnType::varchar_type ? col_def.length :
|
||||
col_def.type == ColumnType::float_type ? 20 : 10;
|
||||
col_char_sizes.push_back(col_size);
|
||||
|
||||
out.append(string_padd(col_def.name, col_size, ' ', true) + " | ");
|
||||
|
||||
Reference in New Issue
Block a user