refactored result that an overload for void doesn't need to exist

This commit is contained in:
2026-07-30 12:33:24 +02:00
parent 78b30f9742
commit c880728093
7 changed files with 127 additions and 95 deletions
+2 -1
View File
@@ -37,7 +37,8 @@ void QueryFixture::check_table_not_exists(const std::string &table_name) const {
}
void QueryFixture::drop_table_if_exists(const std::string &table_name) const {
const auto result = db.exists(table_name).and_then([&table_name, this](const bool exists) {
const auto result = db.exists(table_name)
.and_then([&table_name, this](const bool exists) -> utils::result<bool, utils::error> {
if (exists) {
auto res = query::drop()
.table(table_name)
+2 -1
View File
@@ -35,7 +35,8 @@ void SequenceFixture::check_sequence_not_exists(const std::string& sequence_name
}
void SequenceFixture::drop_sequence_if_exists(const std::string& sequence_name) const {
const auto result = db.sequence_exists(sequence_name).and_then([&sequence_name, this](const bool exists) {
const auto result = db.sequence_exists(sequence_name).
and_then([&sequence_name, this](const bool exists) -> utils::result<bool, utils::error> {
if (exists) {
auto res = query::drop()
.sequence(sequence_name)