Class BigQueryConfig

BigQueryConfig

A configuration object for a native BigQuery connector. Return this object from getData() for Data Studio to query BigQuery for the connector.

 var 
  
 cc 
  
 = 
  
 DataStudioApp 
 . 
 createCommunityConnector 
 (); 
 var 
  
 types 
  
 = 
  
 cc 
 . 
 BigQueryParameterType 
 ; 
 var 
  
 bqConfig 
  
 = 
  
 cc 
 . 
 newBigQueryConfig 
 () 
  
 . 
 setBillingProjectId 
 ( 
 'billingProjectId' 
 ) 
  
 . 
 setQuery 
 ( 
 'queryString' 
 ) 
  
 . 
 setUseStandardSql 
 ( 
 true 
 ) 
  
 . 
 setAccessToken 
 ( 
 'accessToken' 
 ) 
  
 . 
 addQueryParameter 
 ( 
 'dob' 
 , 
  
 types 
 . 
 STRING 
 , 
  
 '01011990' 
 ) 
  
 . 
 build 
 (); 

Methods

Method Return type Brief description
BigQueryConfig Adds a query parameter to this BigQueryConfig .
Object Validates this object and returns it in the format needed by Data Studio.
String Prints the JSON representation of this object.
BigQueryConfig Sets the access token of this BigQueryConfig .
BigQueryConfig Sets the billing project ID of this BigQueryConfig .
BigQueryConfig Sets the SQL query of this BigQueryConfig .
BigQueryConfig Determines if the query is interpreted as standard or legacy SQL.

Detailed documentation

addQueryParameter(name, type, value)

Adds a query parameter to this BigQueryConfig .

Parameters

Name Type Description
name
String The parameter name.
type
BigQueryParameterType The parameter type.
value
String The parameter value.

Return

BigQueryConfig — This object, for chaining.


build()

Validates this object and returns it in the format needed by Data Studio.

Return

Object — The validated Config object.


printJson()

Prints the JSON representation of this object. This is for debugging only.

Return

String


setAccessToken(accessToken)

Sets the access token of this BigQueryConfig .

Parameters

Name Type Description
accessToken
String The access token to set.

Return

BigQueryConfig — This object, for chaining.


setBillingProjectId(billingProjectId)

Sets the billing project ID of this BigQueryConfig .

Parameters

Name Type Description
billingProjectId
String The billing project ID to set.

Return

BigQueryConfig — This object, for chaining.


setQuery(query)

Sets the SQL query of this BigQueryConfig .

Parameters

Name Type Description
query
String The query to set.

Return

BigQueryConfig — This object, for chaining.


setUseStandardSql(useStandardSql)

Determines if the query is interpreted as standard or legacy SQL.

Parameters

Name Type Description
useStandardSql
Boolean If true , the query is interpreted as standard SQL. If false , the query is interpreted as legacy SQL.

Return

BigQueryConfig — This object, for chaining.