private void exportSingleInsert(Connection connection, String querySql, Boolean containsHeader,
                                    SqlBuilder sqlBuilder, ValueProcessor valueProcessor,
                                    String databaseName, String schemaName, String tableName, PrintWriter writer) {
        List<String> sqlList = new ArrayList<>(BATCH_SIZE);
        SQLExecutor.getInstance().execute(connection, querySql, BATCH_SIZE, resultSet -> {
            List<String> header = containsHeader ? ResultSetUtils.getRsHeader(resultSet) : null;
            while (resultSet.next()) {
                List<String> rowData = extractRowData(resultSet, valueProcessor);
                String sql = sqlBuilder.buildSingleInsertSql(databaseName, schemaName, tableName, header, rowData);
                sqlList.add(sql+";");
                if (sqlList.size() >= BATCH_SIZE) {
                    writeSqlList(writer, sqlList);
                }
            }
            if(CollectionUtils.isNotEmpty(sqlList)){
                writeSqlList(writer, sqlList);
            }
        });
        TaskManager.increaseCurrent();
    }
@param connection
@param databaseExportDataParam
@param file
chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/data/sql/SqlDataExporter.java