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

[8.x] [ES|QL] More AST mutation APIs (#196240) #196355

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

## Summary

Partially addresses elastic#191812

Implements the following high-level ES|QL AST manipulation methods:

- `.generic`
- `.appendCommandArgument()` — Add a new main command argument to
a command.
- `.removeCommandArgument()` — Remove a command argument from the
AST.
- `.commands`
  - `.from`
    - `.sources`
      - `.list()` — List all `FROM` sources.
      - `.find()` — Find a source by name.
      - `.remove()` — Remove a source by name.
      - `.insert()` — Insert a source.
      - `.upsert()` — Insert a source, if it does not exist.
  - `.limit`
    - `.list()` — List all `LIMIT` commands.
    - `.byIndex()` — Find a `LIMIT` command by index.
    - `.find()` — Find a `LIMIT` command by a predicate function.
    - `.remove()` — Remove a `LIMIT` command by index.
- `.set()` — Set the limit value of a specific `LIMIT` command.
- `.upsert()` — Insert a `LIMIT` command, or update the limit
value if it already exists.

### Checklist

Delete any items that are not applicable to this PR.

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)

(cherry picked from commit 10364fb)
@kibanamachine kibanamachine merged commit 79f9d05 into elastic:8.x Oct 15, 2024
32 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 3.4MB 3.4MB +2.5KB

cc @vadimkibana

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 this pull request may close these issues.

3 participants