0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Renamed run and prepare methods to _run and _prepare

_methods are to be used by vendors
This commit is contained in:
rbock 2014-01-29 13:11:11 +01:00
parent 1c768893d6
commit b90eb7192a
8 changed files with 12 additions and 12 deletions

View File

@ -149,7 +149,7 @@ namespace sqlpp
} }
template<typename Db> template<typename Db>
std::size_t run(Db& db) const std::size_t _run(Db& db) const
{ {
static_assert(not (vendor::is_noop<InsertList>::value and vendor::is_noop<ColumnList>::value) , "calling set() or default_values()"); static_assert(not (vendor::is_noop<InsertList>::value and vendor::is_noop<ColumnList>::value) , "calling set() or default_values()");
static_assert(_get_static_no_of_parameters() == 0, "cannot run insert directly with parameters, use prepare instead"); static_assert(_get_static_no_of_parameters() == 0, "cannot run insert directly with parameters, use prepare instead");
@ -157,7 +157,7 @@ namespace sqlpp
} }
template<typename Db> template<typename Db>
auto prepare(Db& db) const auto _prepare(Db& db) const
-> prepared_insert_t<typename std::decay<Db>::type, insert_t> -> prepared_insert_t<typename std::decay<Db>::type, insert_t>
{ {
constexpr bool calledSet = not vendor::is_noop<InsertList>::value; constexpr bool calledSet = not vendor::is_noop<InsertList>::value;

View File

@ -38,7 +38,7 @@ namespace sqlpp
using _parameter_list_t = typename Insert::_parameter_list_t; using _parameter_list_t = typename Insert::_parameter_list_t;
using _prepared_statement_t = typename Db::_prepared_statement_t; using _prepared_statement_t = typename Db::_prepared_statement_t;
auto run(Db& db) const auto _run(Db& db) const
-> size_t -> size_t
{ {
return db.run_prepared_insert(*this); return db.run_prepared_insert(*this);

View File

@ -38,7 +38,7 @@ namespace sqlpp
using _parameter_list_t = typename Remove::_parameter_list_t; using _parameter_list_t = typename Remove::_parameter_list_t;
using _prepared_statement_t = typename Db::_prepared_statement_t; using _prepared_statement_t = typename Db::_prepared_statement_t;
auto run(Db& db) const auto _run(Db& db) const
-> size_t -> size_t
{ {
return db.run_prepared_insert(*this); return db.run_prepared_insert(*this);

View File

@ -40,7 +40,7 @@ namespace sqlpp
using _dynamic_names_t = typename Select::_dynamic_names_t; using _dynamic_names_t = typename Select::_dynamic_names_t;
using _prepared_statement_t = typename Db::_prepared_statement_t; using _prepared_statement_t = typename Db::_prepared_statement_t;
auto run(Db& db) const auto _run(Db& db) const
-> result_t<decltype(db.run_prepared_select(*this)), _result_row_t> -> result_t<decltype(db.run_prepared_select(*this)), _result_row_t>
{ {
return {db.run_prepared_select(*this), _dynamic_names}; return {db.run_prepared_select(*this), _dynamic_names};

View File

@ -38,7 +38,7 @@ namespace sqlpp
using _parameter_list_t = typename Update::_parameter_list_t; using _parameter_list_t = typename Update::_parameter_list_t;
using _prepared_statement_t = typename Db::_prepared_statement_t; using _prepared_statement_t = typename Db::_prepared_statement_t;
auto run(Db& db) const auto _run(Db& db) const
-> size_t -> size_t
{ {
return db.run_prepared_insert(*this); return db.run_prepared_insert(*this);

View File

@ -144,7 +144,7 @@ namespace sqlpp
} }
template<typename Db> template<typename Db>
std::size_t run(Db& db) const std::size_t _run(Db& db) const
{ {
static_assert(_get_static_no_of_parameters() == 0, "cannot run remove directly with parameters, use prepare instead"); static_assert(_get_static_no_of_parameters() == 0, "cannot run remove directly with parameters, use prepare instead");
static_assert(is_where_t<Where>::value, "cannot run update without having a where condition, use .where(true) to remove all rows"); static_assert(is_where_t<Where>::value, "cannot run update without having a where condition, use .where(true) to remove all rows");
@ -152,7 +152,7 @@ namespace sqlpp
} }
template<typename Db> template<typename Db>
auto prepare(Db& db) const auto _prepare(Db& db) const
-> prepared_remove_t<typename std::decay<Db>::type, remove_t> -> prepared_remove_t<typename std::decay<Db>::type, remove_t>
{ {
return {{}, db.prepare_remove(*this)}; return {{}, db.prepare_remove(*this)};

View File

@ -615,7 +615,7 @@ namespace sqlpp
// Execute // Execute
template<typename Db> template<typename Db>
auto run(Db& db) const auto _run(Db& db) const
-> result_t<decltype(db.select(*this)), _result_row_t> -> result_t<decltype(db.select(*this)), _result_row_t>
{ {
static_assert(not vendor::is_noop<ColumnList>::value, "cannot run select without having selected anything"); static_assert(not vendor::is_noop<ColumnList>::value, "cannot run select without having selected anything");
@ -630,7 +630,7 @@ namespace sqlpp
// Prepare // Prepare
template<typename Db> template<typename Db>
auto prepare(Db& db) const auto _prepare(Db& db) const
-> prepared_select_t<typename std::decay<Db>::type, select_t> -> prepared_select_t<typename std::decay<Db>::type, select_t>
{ {
static_assert(not vendor::is_noop<ColumnList>::value, "cannot run select without having selected anything"); static_assert(not vendor::is_noop<ColumnList>::value, "cannot run select without having selected anything");

View File

@ -145,7 +145,7 @@ namespace sqlpp
} }
template<typename Db> template<typename Db>
std::size_t run(Db& db) const std::size_t _run(Db& db) const
{ {
static_assert(not vendor::is_noop<Assignments>::value, "calling set() required before running update"); static_assert(not vendor::is_noop<Assignments>::value, "calling set() required before running update");
static_assert(is_where_t<Where>::value, "cannot run update without having a where condition, use .where(true) to update all rows"); static_assert(is_where_t<Where>::value, "cannot run update without having a where condition, use .where(true) to update all rows");
@ -154,7 +154,7 @@ namespace sqlpp
} }
template<typename Db> template<typename Db>
auto prepare(Db& db) const auto _prepare(Db& db) const
-> prepared_update_t<typename std::decay<Db>::type, update_t> -> prepared_update_t<typename std::decay<Db>::type, update_t>
{ {
static_assert(not vendor::is_noop<Assignments>::value, "calling set() required before running update"); static_assert(not vendor::is_noop<Assignments>::value, "calling set() required before running update");