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

would be nice to provide a query directly when running the program #1

Closed
sanga opened this issue Sep 1, 2014 · 8 comments
Closed

Comments

@sanga
Copy link

sanga commented Sep 1, 2014

i.e.

influx-cli -db=timeseries -q=[query]

or perhaps the query could just be a positional argument (that's how postgres does that as I recall). My particular reason for this is to pipe to less but there's many other reasons too.

@Dieterbe
Copy link
Owner

Dieterbe commented Sep 1, 2014

yep. i also want this and i can easily implement this.

note, you can already write one or more queries to stdin and that'll work too
example

echo -e "list series\nselect foo from bar" | influx-cli

OR

influx-cli  <<< "list series"  # bash built-in to write to stdin

@Dieterbe
Copy link
Owner

Dieterbe commented Sep 3, 2014

done!

@sanga
Copy link
Author

sanga commented Sep 3, 2014

cheers!

@sanga
Copy link
Author

sanga commented Sep 3, 2014

oh and thank you for publishing this excellent tool. Much more convenient than curl ;)

@sanga
Copy link
Author

sanga commented Sep 5, 2014

Still one complaint about this actually. When executing with a query it would seem more natural to me, to have influx-cli to exit once the query is complete, not drop into the shell.

@Dieterbe
Copy link
Owner

Dieterbe commented Sep 5, 2014

But then you could just as well do influx-cli <<< "your queries"? providing queries as args or on stdin would be equivalent (because the latter already runs influx-cli in non-interactive mode and exits the program when it's done).
I do agree that your suggestion is probably what most people will expect. (probably... not really sure, would have to try it with mysql/pgsql/vsql/...).
If we do it your way, then there's no easy way to do "i want to run an interactive session, but also execute a few queries first".
but to address the latter I actually want to implement reading from an inputfile, so you could type < filename or something in an interactive session and it would all queries in the file. I'm thinking once we support that, I can change the behavior as you suggested.
thoughts?

@sanga
Copy link
Author

sanga commented Sep 8, 2014

Exiting after running a query as a cmdline param is just what I expected coming from psql. From my perspective it's OK as it is now (I hadn't realised that <<< would achieve what I wanted). If more people complain about this, then I guess you should review whether to better document or change that behaviour

@Dieterbe
Copy link
Owner

fwiw that issue is now being discussed in #5

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

2 participants