Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
c79a34b2
Commit
c79a34b2
authored
Mar 12, 2013
by
Davis King
Browse files
Added database::last_insert_rowid()
parent
12907906
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
dlib/sqlite/sqlite.h
dlib/sqlite/sqlite.h
+6
-0
dlib/sqlite/sqlite_abstract.h
dlib/sqlite/sqlite_abstract.h
+14
-0
No files found.
dlib/sqlite/sqlite.h
View file @
c79a34b2
...
...
@@ -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
;
...
...
dlib/sqlite/sqlite_abstract.h
View file @
c79a34b2
...
...
@@ -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
!*/
};
// ----------------------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment