extract not null constraint into enum
This commit is contained in:
@@ -158,12 +158,12 @@ sql::record sqlite_connection::describe(const std::string& table)
|
||||
|
||||
auto type = (string2type(reader.column(2)));
|
||||
end = nullptr;
|
||||
utils::constraints options{};
|
||||
sql::null_option null_opt{sql::null_option::NULLABLE};
|
||||
if (strtoul(reader.column(3), &end, 10) == 0) {
|
||||
options = utils::constraints::NOT_NULL;
|
||||
null_opt = sql::null_option::NOT_NULL;
|
||||
}
|
||||
// f.default_value(res->column(4));
|
||||
prototype.append({name, type, {options}});
|
||||
prototype.append({name, type, utils::null_attributes, null_opt});
|
||||
}
|
||||
|
||||
return std::move(prototype);
|
||||
|
||||
Reference in New Issue
Block a user