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

Improve query inteface #1447

Merged
merged 3 commits into from
Jul 12, 2023
Merged

Improve query inteface #1447

merged 3 commits into from
Jul 12, 2023

Conversation

yannham
Copy link
Member

@yannham yannham commented Jul 11, 2023

Closes #1446.

Previously, the query command of the REPL would accept a first argument that could be a record access chain, followed by a second one which could also be a field path. This means that, for querying a given path foo.bar.baz.blo, there are 3 different but equivalent query invocations:

  • :query foo bar.baz.blo
  • :query foo.bar baz.blo
  • :query foo.bar.baz blo

Moreover, :query foo.bar.baz.blo without a second argument wouldn't fail but pretend that there are no metadata, even if there are.

This PR simplifies the overall interface of the query command by just accepting one argument which is a field path.

Previously, the query command of the REPL would accept a first argument
that could be a record access chain, followed by a second one which
could also be a field path. This means that, for querying a given path
`foo.bar.baz.blo`, there are 3 different but equivalent query
invocations:

- :query foo bar.baz.blo
- :query foo.bar baz.blo
- :query foo.bar.baz blo

Moreover, `:query foo.bar.baz.blo` without a second argument wouldn't
fail but pretend that there are no metadata, even if there are.

This commit simplify the overall interfaceo of the query command by just
accepting one argument which is a field path.
@github-actions github-actions bot temporarily deployed to pull request July 11, 2023 11:48 Inactive
core/src/program.rs Outdated Show resolved Hide resolved
core/src/repl/mod.rs Outdated Show resolved Hide resolved
yannham and others added 2 commits July 11, 2023 16:03
Co-authored-by: Viktor Kleen <viktor.kleen@tweag.io>
Co-authored-by: Viktor Kleen <viktor.kleen@tweag.io>
@github-actions github-actions bot temporarily deployed to pull request July 11, 2023 14:07 Inactive
@yannham yannham added this pull request to the merge queue Jul 12, 2023
Merged via the queue into master with commit 081fc92 Jul 12, 2023
@yannham yannham deleted the cli/query-interface branch July 12, 2023 07:13
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

Successfully merging this pull request may close these issues.

Unintuitive multiple ways to query a value in the repl
2 participants