Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added skip_headers argument to the csv formatter #73

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gfrlv
Copy link
Member

@gfrlv gfrlv commented Feb 23, 2021

Description

A new argument is needed to implement \T csv --skip-headers in mycli, see dbcli/mycli#872

Checklist

  • I've added this contribution to the CHANGELOG.
  • I've added my name to the AUTHORS file (or it's already there).
  • I installed pre-commit hooks (pip install pre-commit && pre-commit install), and ran black on my code.
  • Please squash merge this pull request (uncheck if you'd like us to merge as multiple commits)

@j-bennet
Copy link
Contributor

@pasenor Is this still relevant, or not anymore (superseded by #74)?

@Lidoca
Copy link

Lidoca commented Apr 3, 2024

I've been working with SQL queries and shell commands to process the output, specifically aiming to retrieve results without headers. Consider the following example:

SELECT
    5 >= 0
    AND 5 <= 10;

To eliminate the header from the output, I used sed with the mycli command:

mycli --csv --no-warn -e '\n; \. script.sql' mariadb://mysql@localhost/test | sed '1d'

The resulting data output is as follows:

        AND 5 <= 10"
"1"

From this, it's clear that while we can manipulate the output to exclude the header, the process isn't as straightforward or clean as it could be. I believe implementing a feature that allows for direct output without headers would greatly enhance usability and efficiency. What are your thoughts on exploring this feature further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants