mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Added database::last_insert_rowid()
This commit is contained in:
parent
1290790682
commit
c79a34b230
@ -92,6 +92,12 @@ namespace dlib
|
||||
const std::string& sql_statement
|
||||
);
|
||||
|
||||
int64 last_insert_rowid (
|
||||
) const
|
||||
{
|
||||
return sqlite3_last_insert_rowid(db.get());
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
friend class statement;
|
||||
|
@ -117,6 +117,20 @@ namespace dlib
|
||||
- executes the supplied SQL statement against this database
|
||||
!*/
|
||||
|
||||
int64 last_insert_rowid (
|
||||
) const;
|
||||
/*!
|
||||
requires
|
||||
- is_open() == true
|
||||
ensures
|
||||
- Each element in a database table has a rowid which uniquely identifies
|
||||
it. Therefore, this routine returns the rowid of the most recent
|
||||
successful INSERT into the database via this database instance.
|
||||
- If an INSERT has not been performed on the current database instance then
|
||||
the return value is 0. This is true even if the database is not empty.
|
||||
- See the sqlite documention for the full details on how this function
|
||||
behaves: http://www.sqlite.org/c3ref/last_insert_rowid.html
|
||||
!*/
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user