implemented lazy loading for object_ptr and belongs_to
This commit is contained in:
@@ -5,12 +5,11 @@
|
||||
|
||||
namespace matador::sql::detail {
|
||||
|
||||
template<>
|
||||
record *create_prototype<record>(const std::vector<object::attribute> &prototype) {
|
||||
auto result = std::make_unique<record>();
|
||||
record create_prototype(const std::vector<object::attribute> &prototype) {
|
||||
record rec;
|
||||
int index{0};
|
||||
for (const auto &col: prototype) {
|
||||
result->append({
|
||||
rec.append({
|
||||
col.name(),
|
||||
col.type(),
|
||||
col.attributes().options(),
|
||||
@@ -18,7 +17,7 @@ record *create_prototype<record>(const std::vector<object::attribute> &prototype
|
||||
index++
|
||||
});
|
||||
}
|
||||
return result.release();
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user