format sql safely