This repository was archived by the owner on Feb 7, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,14 +98,27 @@ export type Query = JobRequest<bigquery.IJobConfigurationQuery> & {
9898 params ?: any [ ] | { [ param : string ] : any } ;
9999 dryRun ?: boolean ;
100100 labels ?: { [ label : string ] : string } ;
101- types ?: string [ ] | string [ ] [ ] | { [ type : string ] : string | string [ ] } ;
101+ types ?: QueryParamTypes ;
102102 job ?: Job ;
103103 maxResults ?: number ;
104104 jobTimeoutMs ?: number ;
105105 pageToken ?: string ;
106106 wrapIntegers ?: boolean | IntegerTypeCastOptions ;
107107} ;
108108
109+ export type QueryParamTypeStruct = {
110+ [ type : string ] :
111+ | string
112+ | string [ ]
113+ | QueryParamTypeStruct
114+ | QueryParamTypeStruct [ ] ;
115+ } ;
116+ export type QueryParamTypes =
117+ | string [ ]
118+ | string [ ] [ ]
119+ | QueryParamTypeStruct
120+ | QueryParamTypeStruct [ ] ;
121+
109122export type QueryOptions = QueryResultsOptions ;
110123export type QueryStreamOptions = {
111124 wrapIntegers ?: boolean | IntegerTypeCastOptions ;
Original file line number Diff line number Diff line change @@ -1220,6 +1220,17 @@ describe('BigQuery', () => {
12201220 } ,
12211221 } ,
12221222 ] ,
1223+ types : [
1224+ {
1225+ b : 'BOOL' ,
1226+ arr : [ 'INT64' ] ,
1227+ d : 'DATE' ,
1228+ f : 'FLOAT64' ,
1229+ nested : {
1230+ a : 'INT64' ,
1231+ } ,
1232+ } ,
1233+ ] ,
12231234 } ,
12241235 ( err , rows ) => {
12251236 assert . ifError ( err ) ;
@@ -1332,6 +1343,9 @@ describe('BigQuery', () => {
13321343 params : {
13331344 owner : 'google' ,
13341345 } ,
1346+ types : {
1347+ owner : 'STRING' ,
1348+ } ,
13351349 } ,
13361350 ( err , rows ) => {
13371351 assert . ifError ( err ) ;
@@ -1466,6 +1480,17 @@ describe('BigQuery', () => {
14661480 } ,
14671481 } ,
14681482 } ,
1483+ types : {
1484+ obj : {
1485+ b : 'BOOL' ,
1486+ arr : [ 'INT64' ] ,
1487+ d : 'DATE' ,
1488+ f : 'FLOAT64' ,
1489+ nested : {
1490+ a : 'INT64' ,
1491+ } ,
1492+ } ,
1493+ } ,
14691494 } ,
14701495 ( err , rows ) => {
14711496 assert . ifError ( err ) ;
You can’t perform that action at this time.
0 commit comments