diff --git a/include/mysql.hpp b/include/mysql.hpp index 19105845..8ee85fb7 100644 --- a/include/mysql.hpp +++ b/include/mysql.hpp @@ -130,18 +130,18 @@ class mysql { template uint64_t get_insert_id_after_insert(const T &t, Args &&...args) { - std::optional insert_id = {0}; + uint64_t insert_id = {0}; insert_or_update_impl(t, generate_insert_sql(true), OptType::insert, std::move(insert_id)); - return insert_id.value(); + return insert_id; } template uint64_t get_insert_id_after_insert(const std::vector &v, Args &&...args) { - std::optional insert_id = {0}; + uint64_t insert_id = {0}; insert_or_update_impl(v, generate_insert_sql(true), OptType::insert, std::move(insert_id)); - return insert_id.value(); + return insert_id; } template diff --git a/include/postgresql.hpp b/include/postgresql.hpp index e06c6543..181712ef 100644 --- a/include/postgresql.hpp +++ b/include/postgresql.hpp @@ -105,18 +105,18 @@ class postgresql { template uint64_t get_insert_id_after_insert(const T &t, Args &&...args) { - std::optional insert_id = {0}; + uint64_t insert_id = {0}; insert_or_update_impl(t, generate_insert_sql(true), OptType::insert, std::move(insert_id)); - return insert_id.value(); + return insert_id; } template uint64_t get_insert_id_after_insert(const std::vector &v, Args &&...args) { - std::optional insert_id = {0}; + uint64_t insert_id = {0}; insert_or_update_impl(v, generate_insert_sql(true), OptType::insert, std::move(insert_id)); - return insert_id.value(); + return insert_id; } template diff --git a/include/sqlite.hpp b/include/sqlite.hpp index e177de3d..ac6fdb8c 100644 --- a/include/sqlite.hpp +++ b/include/sqlite.hpp @@ -103,18 +103,18 @@ class sqlite { template uint64_t get_insert_id_after_insert(const T &t, Args &&...args) { - std::optional insert_id = {0}; + uint64_t insert_id = {0}; insert_or_update_impl(t, generate_insert_sql(true), OptType::insert, std::move(insert_id)); - return insert_id.value(); + return insert_id; } template uint64_t get_insert_id_after_insert(const std::vector &v, Args &&...args) { - std::optional insert_id = {0}; + uint64_t insert_id = {0}; insert_or_update_impl(v, generate_insert_sql(true), OptType::insert, std::move(insert_id)); - return insert_id.value(); + return insert_id; } template