insert returns last_id (closes #4)

This commit is contained in:
Gregor Aisch
2013-04-06 03:06:51 +02:00
parent 393a0b887b
commit 875e0508f2
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -66,7 +66,8 @@ class Table(object):
self._check_dropped()
if ensure:
self._ensure_columns(row, types=types)
self.database.engine.execute(self.table.insert(row))
res = self.database.engine.execute(self.table.insert(row))
return res.lastrowid
def insert_many(self, rows, chunk_size=1000, ensure=True, types={}):
"""