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 @@ -66,6 +66,7 @@ export type JobRequest<J> = J & {
6666 jobId ?: string ;
6767 jobPrefix ?: string ;
6868 location ?: string ;
69+ projectId ?: string ;
6970} ;
7071
7172export type PagedRequest < P > = P & {
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ export type QueryResultsOptions = {
124124class Job extends Operation {
125125 bigQuery : BigQuery ;
126126 location ?: string ;
127+ projectId ?: string ;
127128 getQueryResultsStream (
128129 options ?: QueryResultsOptions
129130 ) : ResourceStream < RowMetadata > {
@@ -344,6 +345,10 @@ class Job extends Operation {
344345 this . location = options . location ;
345346 }
346347
348+ if ( options ?. projectId ) {
349+ this . projectId = options . projectId ;
350+ }
351+
347352 /**
348353 * Get the results of a job as a readable object stream.
349354 *
Original file line number Diff line number Diff line change @@ -147,6 +147,13 @@ describe('BigQuery/Job', () => {
147147 assert . strictEqual ( job . location , options . location ) ;
148148 } ) ;
149149
150+ it ( 'should accept a projectId option' , ( ) => {
151+ const options = { projectId : 'cool-project' } ;
152+ const job = new Job ( BIGQUERY , JOB_ID , options ) ;
153+
154+ assert . strictEqual ( job . projectId , options . projectId ) ;
155+ } ) ;
156+
150157 it ( 'should send the location via getMetadata' , ( ) => {
151158 const job = new Job ( BIGQUERY , JOB_ID , { location : LOCATION } ) ;
152159 const calledWith = job . calledWith_ [ 0 ] ;
You can’t perform that action at this time.
0 commit comments