cast tuple to string to work around an error in mysqldb. won't need to do that in the actual implementation.