GQL icon indicating copy to clipboard operation
GQL copied to clipboard

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

Open jhheider opened this issue 1 year ago • 7 comments

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.

jhheider avatar Nov 27 '23 18:11 jhheider

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

AmrDeveloper avatar Nov 28 '23 19:11 AmrDeveloper

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

jhheider avatar Nov 28 '23 19:11 jhheider

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

AmrDeveloper avatar Nov 28 '23 19:11 AmrDeveloper

Hello @jhheider, I have implemented two feature request

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

TODO

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

AmrDeveloper avatar Dec 01 '23 12:12 AmrDeveloper

These changes look amazing. Thanks for diving into them!

jhheider avatar Dec 08 '23 15:12 jhheider

Thanks for suggestions, enjoy more is coming :D

AmrDeveloper avatar Dec 09 '23 17:12 AmrDeveloper

  • [x] Output as JSON or CSV

AmrDeveloper avatar Jan 19 '24 11:01 AmrDeveloper