logger = logging.getLogger(__name__)

@event.listens_for(Pool, 'connect')
def set_unicode(dbapi_conn, conn_record):
    cursor = dbapi_conn.cursor()
try:
    cursor.execute("SET NAMES 'utf8mb4' COLLATE 'utf8mb4_unicode_ci'")
except Exception as e:
    logger.debug(e)
How do I configure sqlalchemy to correctly store emoji?