Skip to content

Make it possible to pass args to driver query method #20

Closed
@sunker

Description

@sunker

Some data sources plugin, such as the one for Athena, will need to be able to switch database inside the query editor without having to change the connection in the config editor. The query method in the go sql package takes a variadic function parameter for args, so we should be able to use that to pass additional arguments to the driver.

Unfortunately, the args might differ from plugin to plugin, making it hard to provide proper typings for this. For that reason, I think the Query type needs to take the args as json. Something like this:

type Query struct {
	RawSQL string            `json:"rawSql"`
	Format FormatQueryOption `json:"format"`
	Args   json.RawMessage 	 `json:args`
...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions