query builder progress

This commit is contained in:
Sascha Kühl
2025-12-02 16:19:13 +01:00
parent c156ab5e74
commit bfbbd4c589
31 changed files with 348 additions and 164 deletions
+4 -4
View File
@@ -88,7 +88,7 @@ public:
template <class Pointer>
void on_foreign_key(const char *id, Pointer &/*x*/) {
const auto type = pk_type_determinator::determine<typename Pointer::value_type>();
auto &ref = object_->attributes_.emplace_back(id, type, utils::constraints::ForeignKey, null_option_type::NOT_NULL);
auto &ref = object_->attributes_.emplace_back(id, type, utils::constraints::ForeignKey, null_option_type::NotNull);
ref.owner_ = object_.get();
}
template<class ContainerType>
@@ -121,19 +121,19 @@ private:
template<typename ValueType>
void object_generator::on_primary_key(const char *id, ValueType &x, const utils::primary_key_attribute& attr) {
auto &ref = emplace_attribute<ValueType>(id, { attr.size(), utils::constraints::PrimaryKey }, null_option_type::NOT_NULL);
auto &ref = emplace_attribute<ValueType>(id, { attr.size(), utils::constraints::PrimaryKey }, null_option_type::NotNull);
prepare_primary_key(ref, utils::identifier(x));
create_pk_constraint(id);
}
template<typename Type>
void object_generator::on_attribute(const char *id, Type &/*x*/, const utils::field_attributes &attr) {
std::ignore = emplace_attribute<Type>(id, attr, null_option_type::NOT_NULL);
std::ignore = emplace_attribute<Type>(id, attr, null_option_type::NotNull);
}
template<typename Type>
void object_generator::on_attribute(const char *id, std::optional<Type> & /*x*/, const utils::field_attributes &attr) {
std::ignore = emplace_attribute<Type>(id, attr, null_option_type::NULLABLE);
std::ignore = emplace_attribute<Type>(id, attr, null_option_type::Nullable);
}
}