Documentation ¶
Index ¶
- Variables
- type BigQuery
- func (b *BigQuery) CancelJob(jobID string) (*SDK.JobCancelResponse, error)
- func (b *BigQuery) CreateDataset(dataset *SDK.Dataset) (*Dataset, error)
- func (b *BigQuery) CreateTable(datasetID string, tbl *SDK.Table) (*Table, error)
- func (b *BigQuery) DatasetAPI(datasetID string) *DatasetAPI
- func (b *BigQuery) DeleteDataset(datasetID string) error
- func (b *BigQuery) DropTable(datasetID string, tableID string) error
- func (b *BigQuery) Errorf(format string, v ...interface{})
- func (b *BigQuery) GetDataset(datasetID string) (*Dataset, error)
- func (b *BigQuery) GetJob(jobID string) (*SDK.Job, error)
- func (b *BigQuery) GetQueryResults(jobID string) (*SDK.GetQueryResultsResponse, error)
- func (b *BigQuery) GetTable(datasetID string, tableID string) (*Table, error)
- func (b *BigQuery) GetTableData(datasetID string, tableID string) (*SDK.TableDataList, error)
- func (b *BigQuery) InsertAll(datasetID string, tableID string, rows *SDK.TableDataInsertAllRequest) (*SDK.TableDataInsertAllResponse, error)
- func (b *BigQuery) ListDatasets() (*SDK.DatasetList, error)
- func (b *BigQuery) ListJobs() (*SDK.JobList, error)
- func (b *BigQuery) ListTables(datasetID string, tableID string) (*SDK.TableList, error)
- func (b *BigQuery) PatchDataset(datasetID string, dataset *SDK.Dataset) (*Dataset, error)
- func (b *BigQuery) PatchTable(datasetID string, tableID string, tbl *SDK.Table) (*Table, error)
- func (b *BigQuery) Query(opt QueryOption) (*QueryResponse, error)
- func (b *BigQuery) RunJob(job *SDK.Job) (*SDK.Job, error)
- func (b *BigQuery) RunQuery(query *SDK.QueryRequest) (*SDK.QueryResponse, error)
- func (b *BigQuery) SetLogger(logger log.Logger)
- func (b *BigQuery) UpdateDataset(datasetID string, dataset *SDK.Dataset) (*Dataset, error)
- func (b *BigQuery) UpdateTable(datasetID string, tableID string, tbl *SDK.Table) (*Table, error)
- type Dataset
- type DatasetAPI
- type QueryOption
- type QueryResponse
- type Table
- type TableAPI
Constants ¶
This section is empty.
Variables ¶
var (
// TagName is used for struct tag which defining table column name
TagName = "bigquery"
)
Functions ¶
This section is empty.
Types ¶
type BigQuery ¶ added in v0.6.0
type BigQuery struct {
// contains filtered or unexported fields
}
BigQuery is BigQuery API client..
func (*BigQuery) CancelJob ¶ added in v0.6.0
func (b *BigQuery) CancelJob(jobID string) (*SDK.JobCancelResponse, error)
CancelJob performes Jobs.Cancel operation. Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs. For more information, see pricing.
func (*BigQuery) CreateDataset ¶ added in v0.6.0
CreateDataset performes Datasets.Insert operation. Creates a new empty dataset.
func (*BigQuery) CreateTable ¶ added in v0.6.0
CreateTable performes Table.Insert operation. Creates a new, empty table in the dataset.
func (*BigQuery) DatasetAPI ¶ added in v0.6.0
func (b *BigQuery) DatasetAPI(datasetID string) *DatasetAPI
DatasetAPI returns initialized DatasetAPI.
func (*BigQuery) DeleteDataset ¶ added in v0.6.0
DeleteDataset performes Datasets.Delete operation. Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.
func (*BigQuery) DropTable ¶ added in v0.6.0
DropTable performes Tables.Delete operation. Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.
func (*BigQuery) GetDataset ¶ added in v0.6.0
GetDataset performes Datasets.Get operation. Returns the dataset specified by datasetID.
func (*BigQuery) GetJob ¶ added in v0.6.0
GetJob performes Jobs.Get operation. Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.
func (*BigQuery) GetQueryResults ¶ added in v0.6.0
func (b *BigQuery) GetQueryResults(jobID string) (*SDK.GetQueryResultsResponse, error)
GetQueryResults performes Jobs.GetQueryResults operation. Retrieves the results of a query job.
func (*BigQuery) GetTable ¶ added in v0.6.0
GetTable performes Tables.Get operation. Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
func (*BigQuery) GetTableData ¶ added in v0.6.0
GetTableData performes Tabledata.List operation. Retrieves table data from a specified set of rows. Requires the READER dataset role.
func (*BigQuery) InsertAll ¶ added in v0.6.0
func (b *BigQuery) InsertAll(datasetID string, tableID string, rows *SDK.TableDataInsertAllRequest) (*SDK.TableDataInsertAllResponse, error)
InsertAll performes Tabledata.InsertAll operation. Streams data into BigQuery one record at a time without needing to run a load job. For more information, see streaming data into BigQuery.
func (*BigQuery) ListDatasets ¶ added in v0.6.0
func (b *BigQuery) ListDatasets() (*SDK.DatasetList, error)
ListDatasets performes Datasets.List operation. Lists all datasets in the specified project to which you have been granted the READER dataset role.
func (*BigQuery) ListJobs ¶ added in v0.6.0
ListJobs performes Jobs.List operation. Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
func (*BigQuery) ListTables ¶ added in v0.6.0
ListTables performes Tables.List operation. Lists all tables in the specified dataset. Requires the READER dataset role.
func (*BigQuery) PatchDataset ¶ added in v0.6.0
PatchDataset performes Datasets.Patch operation. Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics.
func (*BigQuery) PatchTable ¶ added in v0.6.0
PatchTable performes Tables.Patch operation. Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.
func (*BigQuery) Query ¶ added in v0.8.1
func (b *BigQuery) Query(opt QueryOption) (*QueryResponse, error)
func (*BigQuery) RunJob ¶ added in v0.6.0
RunJob performes Jobs.Insert operation. Starts a new asynchronous job. Requires the Can View project role.
func (*BigQuery) RunQuery ¶ added in v0.6.0
func (b *BigQuery) RunQuery(query *SDK.QueryRequest) (*SDK.QueryResponse, error)
RunQuery performes Jobs.Query operation. Runs a BigQuery SQL query and returns results if the query completes within a specified timeout.
func (*BigQuery) UpdateDataset ¶ added in v0.6.0
UpdateDataset performes Datasets.Update operation. Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource.
func (*BigQuery) UpdateTable ¶ added in v0.6.0
UpdateTable performes Tables.Update operation. Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.
type DatasetAPI ¶ added in v0.6.0
type DatasetAPI struct {
// contains filtered or unexported fields
}
DatasetAPI is bigquery dataset client.
func NewDatasetAPI ¶ added in v0.6.0
func NewDatasetAPI(conf config.Config, projectID, datasetID string) (*DatasetAPI, error)
NewDatasetAPI returns initialized DatasetAPI
func (*DatasetAPI) CreateTable ¶ added in v0.6.0
func (ds *DatasetAPI) CreateTable(tableID string, schemaStruct interface{}) error
CreateTable creates the table with schema defined from given struct (*Deprecated)
func (*DatasetAPI) Delete ¶ added in v0.6.0
func (ds *DatasetAPI) Delete() error
Delete deletes the dataset.
func (*DatasetAPI) Get ¶ added in v0.6.0
func (ds *DatasetAPI) Get() (*Dataset, error)
Get gets the dataset.
func (*DatasetAPI) InsertAll ¶ added in v0.6.0
func (ds *DatasetAPI) InsertAll(tableID string, data interface{}) error
InsertAll appends all of map data by using InsertAll api (*Deprecated)
func (*DatasetAPI) TableAPI ¶ added in v0.6.0
func (ds *DatasetAPI) TableAPI(tableID string) *TableAPI
TableAPI returns initialized TableAPI.
type QueryOption ¶ added in v0.8.1
type QueryOption struct { // required SQL string // optional ProjectID string DatasetID string DryRun bool Location string MaxResults int64 ParameterMode string TimeoutMs int64 UseLegacySql bool NoQueryCache bool }
func (QueryOption) ToRequest ¶ added in v0.8.1
func (o QueryOption) ToRequest() *SDK.QueryRequest
type QueryResponse ¶ added in v0.8.1
type QueryResponse struct {
*SDK.QueryResponse
}
func (*QueryResponse) ToMap ¶ added in v0.8.1
func (r *QueryResponse) ToMap() ([]map[string]interface{}, error)
type TableAPI ¶ added in v0.6.0
type TableAPI struct {
// contains filtered or unexported fields
}
TableAPI is bigquery table client.
func NewTableAPI ¶ added in v0.6.0
NewTableAPI returns initialized TableAPI
func (*TableAPI) Create ¶ added in v0.6.0
Create creates the table with schema defined from given struct.