Permalink
Browse files

Last row id of insert property added in mysql connection.

  • Loading branch information...
1 parent b972b50 commit 0484699dce1eece99d73e51821c9dbe894a00864 @kasun committed Feb 20, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 beesql/backends/mysql.py
View
@@ -248,6 +248,11 @@ def drop(self, db, if_exists=False):
except pymysql.err.DatabaseError, de:
raise BeeSQLDatabaseError(str(de))
+ @property
+ def lastrowid(self):
+ ''' Return row ID of last insert. '''
+ return self.cursor.lastrowid
+
def close(self):
''' Close connection to Databaes. '''
self.db_connection.close()

0 comments on commit 0484699

Please sign in to comment.