query builder progress
This commit is contained in:
@@ -245,7 +245,7 @@ utils::result<object::object_ptr<Type>, utils::error> session::update( const obj
|
||||
using namespace matador::utils;
|
||||
using namespace matador::query;
|
||||
|
||||
const auto col = column(info.value().get().reference_column()->name());
|
||||
const auto col = column(info.value().get().primary_key_attribute()->name());
|
||||
auto res = matador::query::query::update(info->get().name())
|
||||
.set(generator::column_value_pairs<Type>())
|
||||
.where(col == _)
|
||||
@@ -271,7 +271,7 @@ utils::result<void, utils::error> session::remove( const object::object_ptr<Type
|
||||
using namespace matador::utils;
|
||||
using namespace matador::query;
|
||||
|
||||
const auto col = column(info.value().get().reference_column()->name());
|
||||
const auto col = column(info.value().get().primary_key_attribute()->name());
|
||||
auto res = matador::query::query::remove()
|
||||
.from( info->get().name() )
|
||||
.where(col == _)
|
||||
@@ -300,7 +300,7 @@ utils::result<object::object_ptr<Type>, utils::error> session::find(const Primar
|
||||
const auto& type_info = info.value().get();
|
||||
|
||||
session_query_builder eqb(*schema_, *this);
|
||||
const query::column col(query::table{type_info.reference_column()->table_name()}, type_info.reference_column()->name());
|
||||
const query::column col(query::table{type_info.name()}, type_info.primary_key_attribute()->name());
|
||||
using namespace matador::query;
|
||||
auto data = eqb.build<Type>(col == utils::_);
|
||||
if (!data.is_ok()) {
|
||||
|
||||
@@ -51,14 +51,18 @@ public:
|
||||
: data_type(utils::data_type_traits<Type>::type(size), size) {}
|
||||
};
|
||||
|
||||
using TinyInt = typed_data_type<int8_t>;
|
||||
using SmallInt = typed_data_type<int16_t>;
|
||||
using Integer = typed_data_type<int32_t>;
|
||||
using BigInt = typed_data_type<int64_t>;
|
||||
using Integer = typed_data_type<int64_t>;
|
||||
|
||||
using Real = typed_data_type<float>;
|
||||
using Double_ = typed_data_type<double>;
|
||||
using String = typed_data_type<std::string>;
|
||||
using Double = typed_data_type<double>;
|
||||
|
||||
using Text = typed_data_type<std::string>;
|
||||
using Boolean = typed_data_type<bool>;
|
||||
using Varchar = sized_typed_data_type<std::string>;
|
||||
|
||||
using Blob = sized_typed_data_type<std::vector<std::byte>>;
|
||||
|
||||
class constraint {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user