-
Notifications
You must be signed in to change notification settings - Fork 12
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
Let driver implement CallResourceHandler #19
Comments
summarizing my thoughts for @andresmgot and @yesoreyeram : I think you were spot on in this issue: grafana/grafana#36061
I would like something a little less manual for this. An interface or set of functions that are basically 1 level up from the resource handlers, that way we wouldn't have to create a new query editor for each SQL data source. FWIW the next part of this project is to create a query editor that applies to any data source using Something like, type Completable interface {
Tables(ctx context.Context, db string) ([]string, error)
Schemas(ctx context.Context, db string) ([]string, error)
Columns(ctx context.Context, table string) ([]stirng, error)
} Though after our discussion, I understand that Quoting what I said in slack:
|
Completely agree.
Yeah true. Let's add support for |
My +1 for the |
Many SQL data sources have the need to load additional data from some api to populate the query editor with meta data. In some cases, the meta data can be retrieved using a normal sql query, i.e by using the QueryData handler which in turn is using the go sql query method. But retrieving meta data using sql queries is not always feasible. Both redshift and athena for example, needs to be able to load meta data that cannot be fetched using a sql statement. Since sqlds acts as the main entry point for the grpc server, there's currently no way for redshift or athena to load meta data, making it hard to use sqlds.
To solve this problem, it should be possible for the driver to implement it's own CallResourceHandler. The resource handler should be optional, and registered upon creation of the sqlds datasource.
The signature in sqlds could be something like this:
And the consumer would create the resource handler doing something like this:
To make this optional and not introduce breaking changes, it should probably not be a part of the driver interface. Maybe we should use type assertions instead.
Thoughts @kminehart @andresmgot @yesoreyeram ?
The text was updated successfully, but these errors were encountered: