fixed compilation
This commit is contained in:
@@ -227,7 +227,7 @@ query::fetchable_query session::build_select_query(entity_query_data &&data) {
|
||||
.from(*data.root_table)
|
||||
.join_left(data.joins)
|
||||
.where(std::move(data.where_clause))
|
||||
.order_by({data.root_table, data.pk_column_name})
|
||||
.order_by({data.root_table.get(), data.pk_column_name})
|
||||
.asc();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ std::string session_query_builder::build_alias(const char prefix, const unsigned
|
||||
void session_query_builder::append_join(const query::column &left, const query::column &right) {
|
||||
using namespace matador::query;
|
||||
entity_query_data_.joins.push_back({
|
||||
{right.table()},
|
||||
right.table(),
|
||||
std::make_unique<binary_column_criteria>(left, binary_operator::EQUALS, right)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,11 +26,13 @@ column::column(const char *name, const std::string& as)
|
||||
{}
|
||||
|
||||
column::column(std::string name, std::string as)
|
||||
: name_(std::move(name))
|
||||
: table_(default_table())
|
||||
, name_(std::move(name))
|
||||
, alias_(std::move(as)) {}
|
||||
|
||||
column::column(const sql::sql_function_t func, std::string name)
|
||||
: name_(std::move(name))
|
||||
: table_(default_table())
|
||||
, name_(std::move(name))
|
||||
, function_(func) {}
|
||||
|
||||
column::column(const class table* tab, std::string name, std::string as)
|
||||
@@ -95,4 +97,9 @@ column::operator const std::string&() const {
|
||||
return name_;
|
||||
}
|
||||
|
||||
}
|
||||
query::table* column::default_table() {
|
||||
static query::table default_table;
|
||||
|
||||
return &default_table;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "matador/query/generator.hpp"
|
||||
|
||||
namespace matador::query::generator {
|
||||
column_generator::column_generator( const std::string& table_name, const column_generator_options options)
|
||||
column_generator::column_generator(const std::string& table_name, const column_generator_options options)
|
||||
: options_(options) {
|
||||
table_stack_.push(table_name.empty() ? std::make_shared<table>() : std::make_shared<table>(table_name));
|
||||
}
|
||||
@@ -12,7 +12,7 @@ column_generator::column_generator(const object::repository& repo, const std::st
|
||||
table_stack_.push(table_name.empty() ? std::make_shared<table>() : std::make_shared<table>(table_name));
|
||||
}
|
||||
|
||||
void column_generator::on_revision( const char* id, uint64_t& ) {
|
||||
void column_generator::on_revision(const char* id, uint64_t&) {
|
||||
push(id);
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ void column_generator::push( const std::string& column_name ) {
|
||||
if (is_column_generator_option_set(options_, column_generator_options::GenerateAlias)) {
|
||||
char str[4];
|
||||
snprintf(str, 4, "c%02d", ++column_index);
|
||||
result_.emplace_back(table_stack_.top(), column_name, str);
|
||||
result_.emplace_back(table_stack_.top().get(), column_name, str);
|
||||
} else {
|
||||
result_.emplace_back(table_stack_.top(), column_name);
|
||||
result_.emplace_back(table_stack_.top().get(), column_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -449,7 +449,7 @@ std::string query_compiler::build_add_constraint_string(const class constraint &
|
||||
}
|
||||
|
||||
std::string query_compiler::build_drop_constraint_string(const class constraint &c) {
|
||||
|
||||
return dialect_->drop_constraint() + " " + build_constraint_name(c);
|
||||
}
|
||||
|
||||
std::string query_compiler::build_constraint_name(const class constraint &c) {
|
||||
|
||||
Reference in New Issue
Block a user