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

Support for jq functions (eg keys) #33

Open
DanielHeath opened this issue Dec 6, 2016 · 6 comments
Open

Support for jq functions (eg keys) #33

DanielHeath opened this issue Dec 6, 2016 · 6 comments

Comments

@DanielHeath
Copy link

Thanks for releasing this - I'm a big fan :)

Is there interest in covering off more of the jq builtins?

For instance:

echo '{"abc": 1, "abcd": 2, "Foo": 3}' | jq 'keys'
["Foo", "abc", "abcd"]

jid prevents me typing keys at all at the moment.

@mateusduboli
Copy link

mateusduboli commented Dec 8, 2016

This could maybe include jq as a submodule or something, to not reinvent the well

@fiatjaf
Copy link

fiatjaf commented Dec 8, 2016

You can use Ctrl+L to view a list of keys available at time when you're digging a query.


Shameless self-promotion: jiq, my fork of jid uses jq and supports all the fancy queries, operators and functions it offers.

@nicowilliams
Copy link

nicowilliams commented Apr 26, 2019

So, jid doesn't actually use jq, so this can't quite be done... :( However, @fiatjaf's jiq fork of jid does, which is pretty cool. It might be nice to have golang bindings for libjq to avoid having to create a new process every time... Oh wait! There is at least one: https://github.com/threatgrid/jq-go !

@fiatjaf
Copy link

fiatjaf commented Apr 26, 2019

That's awesome. I should use that in jiq but maybe it would be better if it got used on jid instead.

@nicowilliams
Copy link

@fiatjaf yeah.

I've got a branch in my jq clone that adds FFIs, I/O, co-routines, eval. After it gets integrated we'll be able to build a REPL out of eval. jid shows me that a REPL shell should really use curses so as to leave the program in the same part of the terminal screen, and show/page results in another.

@FranklinYu
Copy link

Besides the jq-go mentioned in #33 (comment) above, there is also https://github.com/itchyny/gojq as a Go library for jq query.

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

No branches or pull requests

5 participants