メソッド
詳細なドキュメント
build()
このビルダーの設定からデータソース仕様を作成します。作成する前に as...() を使用してデータソースのタイプを指定する必要があります。
次のコードサンプルは、BigQuery DataSource 仕様を作成します。
const bigQueryDataSourceSpec = SpreadsheetApp.newDataSourceSpec().asBigQuery(); // TODO(developer): Replace with the required dataset, project and table IDs. bigQueryDataSourceSpec.setDatasetId('my data set id'); bigQueryDataSourceSpec.setProjectId('my project id'); bigQueryDataSourceSpec.setTableId('my table id'); bigQueryDataSourceSpec.build();
次のコードサンプルは、Looker DataSource 仕様を作成します。
const lookerDataSourceSpecBuilder = SpreadsheetApp.newDataSourceSpec().asLooker(); const lookerSpec = lookerDataSourceSpecBuilder.setExploreName('my explore name') .setInstanceUrl('my instance url') .setModelName('my model name') .build();
戻る
DataSourceSpec \- データソース仕様。
copy()
このデータソースの設定に基づいて DataSourceSpecBuilder を作成します。
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const spec = ss.getDataSources()[0].getSpec(); const newSpec = spec.copy();
戻る
DataSourceSpecBuilder \- ビルダー。
getDatasetId()
BigQuery データセット ID を取得します。
戻る
String \- データセット ID。データソース仕様が生のクエリで定義されている場合は空の文字列。
getParameters()
データソースのパラメータを取得します。
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const spec = ss.getDataSources()[0].getSpec(); const parameters = spec.getParameters();
このメソッドは、BigQuery データソースでのみ使用できます。
戻る
DataSourceParameter[] \- パラメータ リスト。
getProjectId()
課金プロジェクト ID を取得します。
戻る
String \- プロジェクト ID。
getRawQuery()
生のクエリ文字列を取得します。
戻る
String \- 生のクエリ文字列。
getTableId()
BigQuery テーブル ID を取得します。
戻る
String \- テーブル ID。データソース仕様が生のクエリで定義されている場合は空の文字列。
getTableProjectId()
テーブルの BigQuery プロジェクト ID を取得します。
戻る
String \- テーブル プロジェクト ID。データソース仕様が生のク 101} エリで定義されている場合は空の文字列。
getType()
データソースのタイプを取得します。
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const spec = ss.getDataSources()[0].getSpec(); const type = spec.getType();
戻る
DataSourceType \- データソースのタイプ。
removeAllParameters()
すべてのパラメータを削除します。
const specBuilder = SpreadsheetApp.newDataSourceSpec(); specBuilder.removeAllParameters();
戻る
BigQueryDataSourceSpecBuilder \- チェーン用のビルダー。
removeParameter(parameterName)
指定したパラメータを削除します。
const specBuilder = SpreadsheetApp.newDataSourceSpec(); specBuilder.removeParameter('x');
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
parameter | String | 削除するパラメータの名前。 |
戻る
BigQueryDataSourceSpecBuilder \- チェーン用のビルダー。
setDatasetId(datasetId)
BigQuery データセット ID を設定します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
dataset | String | データセットの ID。 |
戻る
BigQueryDataSourceSpecBuilder \- チェーン用のビルダー。
setParameterFromCell(parameterName, sourceCell)
パラメータを追加します。または、名前付きのパラメータが存在する場合は、DataSourceType.BIGQUERY タイプのデータソース仕様ビルダーのソースセルを更新します。
このメソッドは、BigQuery データソースでのみ使用できます。
const specBuilder = SpreadsheetApp.newDataSourceSpec().asBigQuery(); specBuilder.setParameterFromCell('x', 'A1'); const bigQuerySpec = specBuilder.build();
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
parameter | String | パラメータ名。 |
source | String | A1 形式で指定されたソースセル。 |
戻る
BigQueryDataSourceSpecBuilder \- チェーン用のビルダー。
setProjectId(projectId)
課金 BigQuery プロジェクト ID を設定します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
project | String | 課金プロジェクトの ID。 |
戻る
BigQueryDataSourceSpecBuilder \- チェーン用のビルダー。
setRawQuery(rawQuery)
生のクエリ文字列を設定します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
raw | String | 生のクエリ文字列。 |
戻る
BigQueryDataSourceSpecBuilder \- チェーン用のビルダー。
setTableId(tableId)
BigQuery テーブル ID を設定します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
table | String | テーブルの ID。 |
戻る
BigQueryDataSourceSpecBuilder \- チェーン用のビルダー。
setTableProjectId(projectId)
テーブルの BigQuery プロジェクト ID を設定します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
project | String | BigQuery テーブルのプロジェクト ID。 |
戻る
BigQueryDataSourceSpecBuilder \- チェーン用のビルダー。