Compare commits

..

2 Commits

Author SHA1 Message Date
Sascha Kuehl be9f66c427 start to implement session::find() 2024-03-27 07:39:06 +01:00
Sascha Kuehl 5d06a13775 added a bool operator to entity class 2024-03-27 07:38:42 +01:00
2 changed files with 7 additions and 0 deletions

View File

@ -33,6 +33,8 @@ public:
pointer get() { return obj_.get(); }
const value_type* get() const { return obj_.get(); }
operator bool() const { return obj_.get() != nullptr; } // NOLINT(*-explicit-constructor)
private:
std::shared_ptr<value_type> obj_;
};

View File

@ -39,7 +39,12 @@ public:
}
// collect all columns
// - evaluate fetch::Eager flag for relations
auto info = schema_->info<Type>();
if (!info) {
return {};
}
c->query(*schema_).select({}).from(info->name);
// build pk where condition
// - check if type has pk
// - check type