aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sqlitepp/sqlitepp.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/sqlitepp/sqlitepp.h b/include/sqlitepp/sqlitepp.h
index 7ef3726..8e5bc0c 100644
--- a/include/sqlitepp/sqlitepp.h
+++ b/include/sqlitepp/sqlitepp.h
@@ -387,6 +387,17 @@ class Database : private Uncopyable, public Openable {
/// \throws DatabaseError if an error occurred during the execution
void execute(const std::string& sql);
+ /// \brief Returns the row ID of the last element that was inserted.
+ ///
+ /// If no entry has been inserted into the database, this method returns
+ /// zero.
+ ///
+ /// \returns the index of the last element inserted into the database or
+ /// zero
+ /// \throws std::logic_error if the database is not open
+ /// \throws DatabaseError if an error occurred during the execution
+ int lastInsertRowId() const;
+
/// \brief Opens the given database file.
///
/// The given file must either be a valid SQLite3 database file or may not