session and insert query builder progress
This commit is contained in:
@@ -8,24 +8,39 @@
|
||||
#include <memory>
|
||||
|
||||
namespace matador::object {
|
||||
struct null_object_ptr_t {
|
||||
constexpr null_object_ptr_t() = default;
|
||||
};
|
||||
|
||||
inline constexpr null_object_ptr_t nullobj{};
|
||||
|
||||
template <typename Type>
|
||||
class object_ptr {
|
||||
public:
|
||||
object_ptr()
|
||||
: proxy_(std::make_shared<object_proxy<Type>>()) {}
|
||||
object_ptr(null_object_ptr_t) {}
|
||||
explicit object_ptr(std::shared_ptr<Type> obj)
|
||||
: proxy_(std::make_shared<object_proxy<Type>>(obj)) {}
|
||||
explicit object_ptr(std::shared_ptr<object_proxy<Type>> obj)
|
||||
: proxy_(std::move(obj)) {}
|
||||
object_ptr(const object_ptr &other) = default;
|
||||
object_ptr(object_ptr &&other) noexcept = default;
|
||||
object_ptr &operator=(const object_ptr &other) = default;
|
||||
object_ptr &operator=(object_ptr &&other) = default;
|
||||
object_ptr& operator=(const object_ptr &other) = default;
|
||||
object_ptr& operator=(object_ptr &&other) = default;
|
||||
object_ptr& operator=(null_object_ptr_t) {
|
||||
proxy_.reset();
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const object_ptr &other) const {
|
||||
return get() == other.get();
|
||||
}
|
||||
bool operator==(null_object_ptr_t) const {
|
||||
return empty();
|
||||
}
|
||||
bool operator!=(const object_ptr &other) const { return !operator==(other); }
|
||||
bool operator!=(null_object_ptr_t) const { return !empty(); }
|
||||
|
||||
using value_type = Type;
|
||||
|
||||
|
||||
@@ -169,10 +169,6 @@ public:
|
||||
continue;
|
||||
}
|
||||
|
||||
if (obj.is_persistent()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ensure target exists as dependency (deps first)
|
||||
if (obj.is_transient()) {
|
||||
build_for(obj, relation_steps_);
|
||||
@@ -230,10 +226,6 @@ public:
|
||||
continue;
|
||||
}
|
||||
|
||||
if (obj.is_persistent()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ensure target exists as dependency (deps first)
|
||||
if (obj.is_transient()) {
|
||||
build_for(obj, relation_steps_);
|
||||
|
||||
@@ -48,6 +48,7 @@ private:
|
||||
};
|
||||
|
||||
const primary_key_attribute DefaultPkAttributes {};
|
||||
const primary_key_attribute Identity {generator_type::Identity};
|
||||
const primary_key_attribute ManualVarChar63 {63};
|
||||
const primary_key_attribute ManualVarChar127 {127};
|
||||
const primary_key_attribute ManualVarChar255 {255};
|
||||
|
||||
Reference in New Issue
Block a user