From 412b4b0c95ff424bf41d0b0959f76b78db46288b Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Sun, 6 Oct 2024 10:01:15 +0200 Subject: [PATCH] Reduce remove_from to the generally supported set USING is supported by postgresql JOIN is supported by mysql --- include/sqlpp11/core/clause/remove.h | 11 +++++------ include/sqlpp11/postgresql/remove.h | 1 + include/sqlpp11/{core/clause => postgresql}/using.h | 0 3 files changed, 6 insertions(+), 6 deletions(-) rename include/sqlpp11/{core/clause => postgresql}/using.h (100%) diff --git a/include/sqlpp11/core/clause/remove.h b/include/sqlpp11/core/clause/remove.h index 446b9a32..ba89272a 100644 --- a/include/sqlpp11/core/clause/remove.h +++ b/include/sqlpp11/core/clause/remove.h @@ -31,8 +31,7 @@ #include #include #include -#include -#include +#include #include namespace sqlpp @@ -91,10 +90,10 @@ namespace sqlpp template auto to_sql_string(Context& , const remove_name_t&) -> std::string { - return "DELETE"; + return "DELETE FROM "; } - using blank_remove_t = statement_t>; + using blank_remove_t = statement_t>; inline auto remove() -> blank_remove_t { @@ -102,9 +101,9 @@ namespace sqlpp } template - auto remove_from(Table table) -> decltype(blank_remove_t().from(table)) + auto remove_from(Table table) -> decltype(blank_remove_t().single_table(table)) { - return {blank_remove_t().from(table)}; + return {blank_remove_t().single_table(table)}; } } // namespace sqlpp diff --git a/include/sqlpp11/postgresql/remove.h b/include/sqlpp11/postgresql/remove.h index 9948603b..409133a8 100644 --- a/include/sqlpp11/postgresql/remove.h +++ b/include/sqlpp11/postgresql/remove.h @@ -27,6 +27,7 @@ */ #include +#include #include namespace sqlpp diff --git a/include/sqlpp11/core/clause/using.h b/include/sqlpp11/postgresql/using.h similarity index 100% rename from include/sqlpp11/core/clause/using.h rename to include/sqlpp11/postgresql/using.h