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

Initial query implementation #32

Merged
merged 4 commits into from
Jul 30, 2019
Merged

Initial query implementation #32

merged 4 commits into from
Jul 30, 2019

Conversation

matprec
Copy link
Collaborator

@matprec matprec commented Jul 26, 2019

Based on #29

Implements a query view + very basic dsl

I've stripped some things out, like span / filter view to get the PR up, we can always add them later on!

It doesn't have nice error messages yet, the buffer will just get cleared and no filter is applied, i will create a follow up issue.

It supports history, via and

Syntax:
event.field.<message> [== | contains | matches | starts_with] "<value>"

Closes #5, #6, #7

@matprec

This comment has been minimized.

@matprec

This comment has been minimized.

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very cool & I'm looking forward to being able to write more complex queries! I left some style feedback.

console/src/filter/mod.rs Outdated Show resolved Hide resolved
console/src/storage/messages.rs Outdated Show resolved Hide resolved
if string.len() < 2 || chars.next() != Some('"') || chars.last() != Some('"') {
None?
}
let inner = &string[1..string.len() - 1];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, you could also use str::trim_matches here, though just slicing the string is probably faster, as it doesn't require a char comparison.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The literal/string handling is questionable at best anyways (e.g. doesn't handle escaping), i plan to follow up with the group_by implementation, as it will implement support for the remaining literals, bool, num, and debug.

console/src/ui/command.rs Outdated Show resolved Hide resolved
console/src/ui/command.rs Outdated Show resolved Hide resolved
console/src/ui/command.rs Outdated Show resolved Hide resolved
console/src/ui/query.rs Outdated Show resolved Hide resolved
console/src/ui/query.rs Outdated Show resolved Hide resolved
@matprec matprec merged commit 5686c64 into master Jul 30, 2019
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.

Initial UI components
2 participants