grafana / sqlds

A package that assists writing SQL-driven datasources
Apache License 2.0
17 stars 12 forks source link

Fix parsing macros in complex queries #78

Closed sasklacz closed 1 year ago

sasklacz commented 1 year ago

This fixes the case, where user would have a query like select * from foo default where ( date >= $__fromTime ) and ( date <= $__toTime ) limit 100 and parser would incorrectly only properly recognize the first macro (originally reported in clickhouse https://github.com/grafana/clickhouse-datasource/issues/236) . Added additional test cases to cover that.