bq

package
v0.0.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

func Query[T any](ctx context.Context, bq *BigQuery, queryString string) ([]*T, error)

Query takes a queryString (assumed to be valid SQL) and executes it against BigQuery using the given client. The results are then mapped to a slice of T, where each row in the result is mapped to a struct of type T.

func Write

func Write[T any](ctx context.Context, bq *BigQuery, tableID string, rows []*T) error

Types

type BigQuery

type BigQuery struct {
	ProjectID string
	DatasetID string
	// contains filtered or unexported fields
}

BigQuery provides a client and dataset identifiers.

func NewBigQuery

func NewBigQuery(ctx context.Context, projectID, datasetID string, opts ...option.ClientOption) (*BigQuery, error)

NewBigQuery creates a new instance of a BigQuery client.

func (*BigQuery) Close

func (bq *BigQuery) Close() error

Close releases any resources held by the BigQuery client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL