Is there a better way to build query? #620
Codebreaker101
started this conversation in
General
Replies: 2 comments 1 reply
-
I'd say it is as pretty as it can be. I would only replace You can also check query generation at https://github.com/uptrace/uptrace/blob/master/pkg/tracing/span_filter.go#L196-L255 |
Beta Was this translation helpful? Give feedback.
0 replies
-
q = where("? ? ?", bun.Ident(translateFieldToOperator(filter.Key, true)), bun.Safe("="), filter.Value) SELECT * FROM "state" WHERE (("value->>'Age'" = '6') OR ((("value->>'Age'" = '7') AND ("value->>'Year'" = '2001')) OR (("value->>'Age'" = '7') AND ("value->>'Year'" = '2000')))) ORDER BY value->'Age' ASC, value->'Name' DESC |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently I'm making a query by using this function.
It's not pretty but it works. I'm wondering is there a better way to construct the query that I am missing?
Beta Was this translation helpful? Give feedback.
All reactions