0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-12-26 07:53:21 +08:00

[-] static assert fix regarding connection type. Since now pooled_connections are allowed to process postgres-dynamic-queries

This commit is contained in:
Nikolay 2024-12-18 14:36:27 +07:00 committed by Roland Bock
parent 12a30f9112
commit 6906a8d2d2
4 changed files with 6 additions and 6 deletions

View File

@ -52,14 +52,14 @@ namespace sqlpp
template <typename Database> template <typename Database>
constexpr auto dynamic_insert(const Database&) -> decltype(blank_insert_t<Database>()) constexpr auto dynamic_insert(const Database&) -> decltype(blank_insert_t<Database>())
{ {
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter"); static_assert(std::is_base_of<connection_base, Database>::value, "Invalid database parameter");
return {blank_insert_t<Database>()}; return {blank_insert_t<Database>()};
} }
template <typename Database, typename Table> template <typename Database, typename Table>
constexpr auto dynamic_insert_into(const Database&, Table table) -> decltype(blank_insert_t<Database>().into(table)) constexpr auto dynamic_insert_into(const Database&, Table table) -> decltype(blank_insert_t<Database>().into(table))
{ {
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter"); static_assert(std::is_base_of<connection_base, Database>::value, "Invalid database parameter");
return {blank_insert_t<Database>().into(table)}; return {blank_insert_t<Database>().into(table)};
} }
} // namespace postgresql } // namespace postgresql

View File

@ -50,7 +50,7 @@ namespace sqlpp
template <typename Database> template <typename Database>
auto dynamic_remove(const Database& /*unused*/) -> decltype(blank_remove_t<Database>()) auto dynamic_remove(const Database& /*unused*/) -> decltype(blank_remove_t<Database>())
{ {
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter"); static_assert(std::is_base_of<connection_base, Database>::value, "Invalid database parameter");
return {blank_remove_t<Database>()}; return {blank_remove_t<Database>()};
} }
@ -58,7 +58,7 @@ namespace sqlpp
auto dynamic_remove_from(const Database& /*unused*/, Table table) auto dynamic_remove_from(const Database& /*unused*/, Table table)
-> decltype(blank_remove_t<Database>().from(table)) -> decltype(blank_remove_t<Database>().from(table))
{ {
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter"); static_assert(std::is_base_of<connection_base, Database>::value, "Invalid database parameter");
return {blank_remove_t<Database>().from(table)}; return {blank_remove_t<Database>().from(table)};
} }
} // namespace postgresql } // namespace postgresql

View File

@ -163,7 +163,7 @@ namespace sqlpp
"at least one returnable expression (e.g. a column) is required in returning"); "at least one returnable expression (e.g. a column) is required in returning");
static_assert(decltype(_check_args(columns...))::value, static_assert(decltype(_check_args(columns...))::value,
"at least one argument is not a returnable expression in returning()"); "at least one argument is not a returnable expression in returning()");
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter"); static_assert(std::is_base_of<connection_base, Database>::value, "Invalid database parameter");
return {static_cast<const derived_statement_t<Policies>&>(*this), return {static_cast<const derived_statement_t<Policies>&>(*this),
typename dynamic_returning_column_list<_database_t>::_data_t{columns...}}; typename dynamic_returning_column_list<_database_t>::_data_t{columns...}};
} }

View File

@ -47,7 +47,7 @@ namespace sqlpp
constexpr auto dynamic_update(const Database&, Table table) constexpr auto dynamic_update(const Database&, Table table)
-> decltype(blank_update_t<Database>().single_table(table)) -> decltype(blank_update_t<Database>().single_table(table))
{ {
static_assert(std::is_base_of<connection, Database>::value, "Invalid database parameter"); static_assert(std::is_base_of<connection_base, Database>::value, "Invalid database parameter");
return {blank_update_t<Database>().single_table(table)}; return {blank_update_t<Database>().single_table(table)};
} }
} }