diff --git a/dataset/persistence/table.py b/dataset/persistence/table.py index b6d4635..c39c795 100644 --- a/dataset/persistence/table.py +++ b/dataset/persistence/table.py @@ -68,7 +68,7 @@ class Table(object): if ensure: self._ensure_columns(row, types=types) res = self.database.executable.execute(self.table.insert(row)) - return res.lastrowid + return res.inserted_primary_key[0] def insert_many(self, rows, chunk_size=1000, ensure=True, types={}): """