removed class query and moved their static methods to simple functions
This commit is contained in:
@@ -123,7 +123,7 @@ utils::result<object::object_ptr<Type>, utils::error> session::insert(object::ob
|
||||
// For now, we derive from the schema type used for the root insert: simplistic but works if table name == entity name.
|
||||
const std::string seq_name = it->second.name() + "_seq";
|
||||
|
||||
auto id_res = query::query::select().nextval(seq_name).fetch_value<std::uint64_t>(*this);
|
||||
auto id_res = query::select().nextval(seq_name).fetch_value<std::uint64_t>(*this);
|
||||
if (!id_res.is_ok() || !id_res.value().has_value()) {
|
||||
return utils::failure(make_error(error_code::FailedToBuildQuery, "Failed to obtain next sequence value."));
|
||||
}
|
||||
@@ -227,7 +227,7 @@ utils::result<object::object_ptr<Type>, utils::error> session::update(const obje
|
||||
using namespace matador::query;
|
||||
|
||||
const auto col = table_column(it->second.node().info().primary_key_attribute()->name());
|
||||
auto res = matador::query::query::update(it->second.name())
|
||||
auto res = query::update(it->second.name())
|
||||
.set<Type>()
|
||||
.where(col == _)
|
||||
.prepare(*this);
|
||||
@@ -253,7 +253,7 @@ utils::result<void, utils::error> session::remove(const object::object_ptr<Type>
|
||||
using namespace matador::query;
|
||||
|
||||
const auto col = table_column(it->second.node().info().primary_key_attribute()->name());
|
||||
auto res = matador::query::query::remove()
|
||||
auto res = query::remove()
|
||||
.from(it->second.name())
|
||||
.where(col == _)
|
||||
.prepare(*this);
|
||||
|
||||
Reference in New Issue
Block a user