observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

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

Open tx0c opened 3 months ago

tx0c commented 3 months ago

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