diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-03-27 23:16:53 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-03-27 23:16:53 -0400 |
commit | 7cb13590b2aab04fc7590dbf86f28b4c4b60449d (patch) | |
tree | fe089c3e869e1189c022d14f46b04b543cd2bfeb | |
parent | 41f2eb087900d4f2ea95c3e11087cf2c71395bae (diff) | |
download | hkutil-7cb13590b2aab04fc7590dbf86f28b4c4b60449d.tar.gz hkutil-7cb13590b2aab04fc7590dbf86f28b4c4b60449d.tar.bz2 hkutil-7cb13590b2aab04fc7590dbf86f28b4c4b60449d.zip |
Database insert now returns new rowid
-rw-r--r-- | hkutil/database.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hkutil/database.h b/hkutil/database.h index 5820728..67dd9c5 100644 --- a/hkutil/database.h +++ b/hkutil/database.h | |||
@@ -131,7 +131,7 @@ namespace hatkirby { | |||
131 | } | 131 | } |
132 | } | 132 | } |
133 | 133 | ||
134 | void insertIntoTable( | 134 | uint64_t insertIntoTable( |
135 | std::string table, | 135 | std::string table, |
136 | std::list<column> columns) | 136 | std::list<column> columns) |
137 | { | 137 | { |
@@ -181,6 +181,8 @@ namespace hatkirby { | |||
181 | { | 181 | { |
182 | throw sqlite3_error("Error writing to database", ppdb_.get()); | 182 | throw sqlite3_error("Error writing to database", ppdb_.get()); |
183 | } | 183 | } |
184 | |||
185 | return sqlite3_last_insert_rowid(ppdb_.get()); | ||
184 | } | 186 | } |
185 | 187 | ||
186 | std::vector<row> queryAll( | 188 | std::vector<row> queryAll( |