Add get_last_insert_id for sqlite3 and mysql backends