Copying code from proxysql