Im currently unable to use parameterized queries to Google BigQuery using the V2 API in GOLANG. Typically without the paramters the code to process the query would be:
database_query := client.Query(report.Query)
database_query.QueryConfig.Dst = table_result
job, err := database_query.Run(ctx)
assume that we dont use the named paramters. lets mock 2 parameters and append this to the request as expected from the API(https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/bigquery/query.go) :
var params [2]string
params[0] = "currency"
params[1] = "price"
ParametersL := make([]bigquery.QueryParameter, 0)
for _,element := range params {
temp := bigquery.QueryParameter{}
temp.Value=element
ParametersL = append(ParametersL,temp)
}
database_query := client.Query(report.Query)
database_query.QueryConfig.Dst = table_result
database_query.QueryConfig.Parameters= ParametersL
provided you manage to squeeze the '?' into the appropriate place into the query you either get a error prompting missing , after FROM or the other ? is not recognized. The same goes for named paramters using @. Am I missing something cruzial or is the paramters not supported for GOLANG API?