Skip to content

Commit

Permalink
[-] static assert fix regarding connection type. Since now pooled_con…
Browse files Browse the repository at this point in the history
…nections are allowed to process postgres-dynamic-queries
  • Loading branch information
Meetrious authored and rbock committed Dec 19, 2024
1 parent 12a30f9 commit 6906a8d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/sqlpp11/postgresql/insert.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ namespace sqlpp
template <typename 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>()};
}

template <typename Database, typename 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)};
}
} // namespace postgresql
Expand Down
4 changes: 2 additions & 2 deletions include/sqlpp11/postgresql/remove.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ namespace sqlpp
template <typename 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>()};
}

template <typename Database, typename Table>
auto dynamic_remove_from(const Database& /*unused*/, Table 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)};
}
} // namespace postgresql
Expand Down
2 changes: 1 addition & 1 deletion include/sqlpp11/postgresql/returning.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ namespace sqlpp
"at least one returnable expression (e.g. a column) is required in returning");
static_assert(decltype(_check_args(columns...))::value,
"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),
typename dynamic_returning_column_list<_database_t>::_data_t{columns...}};
}
Expand Down
2 changes: 1 addition & 1 deletion include/sqlpp11/postgresql/update.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace sqlpp
constexpr auto dynamic_update(const Database&, 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)};
}
}
Expand Down

0 comments on commit 6906a8d

Please sign in to comment.