Analogy.LogViewer icon indicating copy to clipboard operation
Analogy.LogViewer copied to clipboard

Add support for specifying a custom SQL filter

Open hugener opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe. While analogy has some support for filtering log files with the predefined inputs like, Source, Text etc. and the UI controls also allows build more complex queries with the query builder. For me clicking a query together is more work that just writing a SQL query. Being able to write the query by hand also has the advantage of creating a collection of query for analysis. The predefined queries as I understand it are limited to certain fields like: Source, Text, Date etc.

Describe the solution you'd like It would be nice to have the possibility to write a custom SQL statement for filtering. I imagine an additional text input in the filtering section that just passes the statement to underlying query.

Describe alternatives you've considered I was trying to save a query created by the query builder

hugener avatar Aug 12 '22 08:08 hugener

Hi @hugener . I can see the benefits for this. do you think it may be better to add this feature under "advanced" mode since i average user won't use it?

Also I think we will also need validation and correctness of the SQL query since now it will be free text as input.

LiorBanai avatar Aug 12 '22 08:08 LiorBanai

Hi @LiorBanai Advanced mode sounds like a good idea. Of course, validation and stuff like "intellisense" would be nice to have, but still secondary. I think you are using DataView.RowFilter, but the documentation does not specify what the behavior is when invalid SQL is passed. Maybe there is an exception and it can simply be caught to show an error on the text input, informing the user that the SQL is invalid. For me that would suffice, since it is an advanced feature

hugener avatar Aug 12 '22 09:08 hugener

yeah the simple way is to catch the exception but I'll look for more elegant way.

LiorBanai avatar Aug 12 '22 13:08 LiorBanai

I have a working version that enables raw sql: image

this is without auto complete for now but seems to work. it also show the last used filter so it can be modified further

LiorBanai avatar Aug 26 '22 06:08 LiorBanai

I gave it a try with the 4.9.0 release. It works well. Thanks!

hugener avatar Aug 30 '22 10:08 hugener

good. there more improvements to made (store last X queries for example, auto complete... etc) but for initial option it can be use. Feel free to suggest improvements/changes :)

LiorBanai avatar Aug 30 '22 11:08 LiorBanai

I'll close this one. Please reopen/submit new issue if there are problems :)

LiorBanai avatar Oct 06 '22 07:10 LiorBanai