null needs to be mapped too
This commit is contained in:
@@ -21,7 +21,9 @@ MlValue uSQL::ivaluize(const usql::Table *table) {
|
|||||||
for (int i = 0; i < table->columns_count(); i++) {
|
for (int i = 0; i < table->columns_count(); i++) {
|
||||||
auto & c = row[i];
|
auto & c = row[i];
|
||||||
auto type = table->m_col_defs[i].type;
|
auto type = table->m_col_defs[i].type;
|
||||||
if (type == ColumnType::integer_type || type == ColumnType::date_type) {
|
if (c.isNull()) {
|
||||||
|
columns.push_back(MlValue::nil());
|
||||||
|
} else if (type == ColumnType::integer_type || type == ColumnType::date_type) {
|
||||||
columns.push_back(MlValue(c.getIntValue()));
|
columns.push_back(MlValue(c.getIntValue()));
|
||||||
} else if (type == ColumnType::bool_type) {
|
} else if (type == ColumnType::bool_type) {
|
||||||
columns.push_back(c.getBoolValue() ? MlValue(c.getIntValue()) : MlValue::nil());
|
columns.push_back(c.getBoolValue() ? MlValue(c.getIntValue()) : MlValue::nil());
|
||||||
|
|||||||
Reference in New Issue
Block a user