17 lines
505 B
C++
17 lines
505 B
C++
#include "matador/query/query_object_resolver.hpp"
|
|
|
|
#include "matador/query/criteria.hpp"
|
|
#include "matador/query/query.hpp"
|
|
|
|
namespace matador::query {
|
|
utils::result<sql::statement, utils::error> prepare_statement(sql::executor &exec, entity_query_data &&data) {
|
|
return query::query::select(data.columns)
|
|
.from(*data.root_table)
|
|
.join_left(data.joins)
|
|
.where(std::move(data.where_clause))
|
|
.order_by({data.root_table, data.pk_column_name})
|
|
.asc()
|
|
.prepare(exec);
|
|
}
|
|
}
|