report last insert id for mysql and sqlite3

Feel free to take what I've done and change it to your liking before merging.

Thanks!

Miguel