Export Sql data to .csv and generate separate .csv files per table based on query

前端 未结 1 1075
悲&欢浪女
悲&欢浪女 2021-01-25 14:08

Currently, I am using Go to access my database. Ideally, I\'d like to generate .csv based on the table\'s name and export data to those files based on the query.

For ex

1条回答
  •  暖寄归人
    2021-01-25 14:46

    1. Iterate the rows with a loop to fetch each row

    2. Use package encoding/csv to write a CSV file.

    0 讨论(0)
提交回复
热议问题