extract not null constraint into enum

This commit is contained in:
2024-01-19 07:58:37 +01:00
parent ed6366fef6
commit 9355f7ea27
13 changed files with 90 additions and 87 deletions
+3 -3
View File
@@ -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);