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

[Feature Request] support reading SQL/InfluxQL from a file and stdin #25772

Closed
jdstrand opened this issue Jan 9, 2025 · 0 comments · Fixed by #25907
Closed

[Feature Request] support reading SQL/InfluxQL from a file and stdin #25772

jdstrand opened this issue Jan 9, 2025 · 0 comments · Fixed by #25907
Assignees
Labels

Comments

@jdstrand
Copy link
Contributor

jdstrand commented Jan 9, 2025

Currently influxdb3 query supports queries via the command line. Eg:

$ influxdb3 query ... "SELECT * FROM cpu LIMIT 3"

This works great for simple queries. It is cumbersome for long queries or queries that require quotes since the user's shell can interfere with the quoting. It would be great if we could support both of these styles (modeled after https://github.com/influxdata/influx-cli):

# stdin
$ cat ./some.sql | influxdb3 query -

# file
$ influxdb3 query -f|--file /path/to/file
@jdstrand jdstrand added the v3 label Jan 9, 2025
mgattozzi added a commit that referenced this issue Jan 23, 2025
This change allows *both* the write and query commands to accept input
via stdin or by a file. With this change larger queries are more
feasible to write as they can now be written in a file and smaller
writes via a string are now possible. This also makes the program work
more like people would expect it to, especially on unix based systems.

This commit also contains two tests to make sure the functionality works
as expected.

Closes #25772
Closes #25892
mgattozzi added a commit that referenced this issue Jan 23, 2025
This change allows *both* the write and query commands to accept input
via stdin or by a file. With this change larger queries are more
feasible to write as they can now be written in a file and smaller
writes via a string are now possible. This also makes the program work
more like people would expect it to, especially on unix based systems.

This commit also contains three tests to make sure the functionality works
as expected.

Closes #25772
Closes #25892
@mgattozzi mgattozzi self-assigned this Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants