Documentation
¶
Overview ¶
Package bqutil includes generally useful abstractions for simplifying interactions with bigquery. Production utilities should go here, but test facilities should go in a separate bqtest package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TableExt ¶ added in v0.0.4
TableExt provides extensions to the bigquery Dataset and Table objects to streamline common actions. It encapsulates the Client and Dataset to simplify methods. TODO(gfr) Should this be called DatasetUtil ? TODO(gfr) Rename this to TableExt (extensions)
func NewTableExt ¶ added in v0.0.4
func NewTableExt(project, dataset string, clientOpts ...option.ClientOption) (TableExt, error)
NewTableExt creates a TableExt 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 (*TableExt) QueryAndParse ¶ added in v0.0.4
QueryAndParse executes a query that should return a single row, with all struct fields that match query columns filled in. The caller must pass in the *address* of an appropriate struct. TODO - extend this to also handle multirow results, by passing slice of structs.