Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TableUtil ¶
TableUtil provides utility functions on tables in a dataset. It encapsulates the Client and Dataset to simplify methods. TODO(gfr) Should this be called DatasetUtil ?
func NewTableUtil ¶
func NewTableUtil(project, dataset string, httpClient *http.Client, clientOpts ...option.ClientOption) (TableUtil, error)
NewTableUtil creates a TableUtil for a project. httpClient is used to inject mocks for the bigquery client. if httpClient is nil, a suitable default client is used. Additional bigquery ClientOptions may be optionally passed as final
clientOpts argument. This is useful for testing credentials.
func (*TableUtil) GetTableStats ¶
func (util *TableUtil) GetTableStats(table string) bigquery.TableMetadata
GetTableStats fetches the Metadata for a table. TODO(gfr) Is this worth having, or is it too small and non-idiomatic?
func (*TableUtil) QueryAndParse ¶
QueryAndParse executes a query that should return a single row, with column labels matching the qfields tags in the provided model struct.