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
@@ -150,12 +150,12 @@ sql::record postgres_connection::describe(const std::string &table)
// Todo: extract size
auto type = (string2type(reader.column(2)));
end = nullptr;
utils::constraints options{};
sql::null_option null_opt{sql::null_option::NULLABLE};
if (strtoul(reader.column(4), &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);