Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-22200

mysqldump client: --tab export with column names header row

Details

    Description

      I think

      --tab

      export would be improved if there was an option to export a row of column headers. This is a very standard CSV format.

      Ex. rather than just the .sql file, you could have an output like:

      "City","State","Zip"
      "New York","New York","10001"
      "Washington","District of Columbia","20002"

      Perhaps

      --prefix-data-by-column-names

      , which can only be used together with

      --tab

      , would match the style of other options.

      Attachments

        Issue Links

          Activity

            rmfalves Rui Alves added a comment -

            I have submitted the PR #1937 on this issue, which provides a new option --header.
            Invoking mysqldump database --tab <path> --header adds a header row with column names to the text files generated by --tab. The options --fields-terminated-by, --fields-enclosed-by, --fields-optionally-enclosed-by and --lines-terminated-by also apply to the header row. If the --header option is used without a leading --tab option, an error occurs

            rmfalves Rui Alves added a comment - I have submitted the PR #1937 on this issue, which provides a new option --header. Invoking mysqldump database --tab <path> --header adds a header row with column names to the text files generated by --tab. The options --fields-terminated-by, --fields-enclosed-by, --fields-optionally-enclosed-by and --lines-terminated-by also apply to the header row. If the --header option is used without a leading --tab option, an error occurs
            danblack Daniel Black added a comment -

            Thank you very much rmfalves for writing this.

            danblack Daniel Black added a comment - Thank you very much rmfalves for writing this.
            serg Sergei Golubchik added a comment - Quoting fixed in https://github.com/MariaDB/server/commit/768a10d02a
            za3k Zachary Vance added a comment -

            Thanks! I think this will make CSV export better

            za3k Zachary Vance added a comment - Thanks! I think this will make CSV export better
            danblack Daniel Black added a comment - > Quoting fixed in https://github.com/MariaDB/server/commit/768a10d02a Thanks serg .

            People

              danblack Daniel Black
              za3k Zachary Vance
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.