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

EOF/script input, default repo, and plain-text output #44

Open
jhheider opened this issue Nov 27, 2023 · 7 comments
Open

EOF/script input, default repo, and plain-text output #44

jhheider opened this issue Nov 27, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@jhheider
Copy link

Very cool project. Three features I could see being immediately useful:

  • EOF support for piped input; currently echo SELECT 1 | gitql -r . goes into a loop redisplaying its prompt forever. echo 'SELECT 1\nexit' | gitql -r . works
  • script file support; echo SELECT 1 >foo.sql; gitql -r . foo.sql would be useful.
  • default repo: echo SELECT 1\\nexit | gitql should probably look for the repo in . (and possibly walk up .. until it finds a .git or hits /).
  • plain-text, csv, or json output: gitql -r . foo.sql --csv would be very useful in pipelines to work with the resultant data without the ascii tables.

I may work on some PRs for some of these as time permits (assuming they're not against some philosophy of the project). This is a very cool idea, and these would address a wider range of use cases.

@AmrDeveloper AmrDeveloper added the enhancement New feature or request label Nov 28, 2023
@AmrDeveloper
Copy link
Owner

Hello @jhheider,

Thank you for your suggestion all of them are very good for the project, we just need to order them and check requirements for example we need to revamp the CLI args parser and remove clap so we can easy add git files for current path as default value.

I will do small research and found requirements then create feature request issue for each point so you, me or anyone else can pick one and work on it

Thank you,
Amr Hesham

@jhheider
Copy link
Author

No problem! I know people like to ask for stuff, so hopefully you find these suggestions useful as customer-discovery, if nothing else. :)

@AmrDeveloper
Copy link
Owner

They are very useful, i will mention you once i created issues with full description

@AmrDeveloper
Copy link
Owner

AmrDeveloper commented Dec 1, 2023

Hello @jhheider, I have implemented two feature request

  • EOF support for piped input;
echo 'SELECT CURRENT_DATE()' | ./gitql.exe -r ../..
  • gitql should probably look for the repo in .
echo 'SELECT 1' | gitql

TODO

  • Script file support
  • Plain-text, csv, or json output

@jhheider
Copy link
Author

jhheider commented Dec 8, 2023

These changes look amazing. Thanks for diving into them!

@AmrDeveloper
Copy link
Owner

Thanks for suggestions, enjoy more is coming :D

@AmrDeveloper
Copy link
Owner

  • Output as JSON or CSV

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

No branches or pull requests

2 participants