grafana / sqlds

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

Return ExecutedQueryString even when an error is returned #117

Closed gabor closed 3 months ago

gabor commented 3 months ago

currently, when there's an error (for example an error in the sql query), we do not get back the executed-query-string into grafana's query inspector:

this PR returns the result, but i'm not sure if this is the best approach. could there be some leak of info with this that we want to avoid? WDYT?

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

scottlepp commented 3 months ago

I think it's just confusion with the sdk that you can return a frame with an error, and an error. And when should a frame be returned with an error vs an error. And if a frame is returned with an error, do we also return an error.

EDIT: I see the explanation here.

gabor commented 3 months ago

to be honest, when i write go, i prefer the pattern that if err == nil, then i ignore the result...but that would complicate the code a bit too much.