Fix empty array in DatabaseStatements to_sql method