Skip to content

Commit

Permalink
add get insert id after insert
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacyking committed Dec 14, 2023
1 parent 332dec0 commit ec30788
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/mysql.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ class mysql {

auto guard = guard_statment(stmt_);

if (!begin()) {
if (!get_insert_id && !begin()) {
return std::nullopt;
}

Expand All @@ -771,7 +771,7 @@ class mysql {
}
}

if (!commit()) {
if (!get_insert_id && !commit()) {
return std::nullopt;
}

Expand Down

0 comments on commit ec30788

Please sign in to comment.