observablehq / feedback

Customer submitted bugs and feature requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug in BigQuery named parameters, doc example request if it works, or request to fix the bug

tx0c opened this issue · comments

Is your feature request related to a problem? Please describe.
https://observablehq.com/documentation/misc/standard-library#clientQuery says

BigQuery can use named (@age, @name, …) or ordered (repeating ?) parameters

but it's not true,

tried both dbq.query('SELECT ... @name', [ name ]) which ends up Error: Named parameters are not supported at [33:25];
or dbq.query('SELECT ... @name', { name }) got Error: Bad request,

have to change to the ordered form dbq.query(' SELECT ... ? ', [ name ]) which is the only way can work for now;

Describe the solution you'd like
should support BigQuery named parameters, either dbq.query(' SELECT ... @name ', { name }) or whatever, how can you pass in the named parameters?

many other DB servers also have similar named parameters features, it saves when large chunk of SQL have reference same parameter many times,

the doc page have mentioned Oracle can use named parameters, not sure if all are FALSE for named parameters support?

Oracle can use named (:age, :name, …) or ordered (repeating ?) parameters
SQL Server can use named (@age, @name, …) parameters