bigquery

package
v0.12.5 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectBigQueryStats added in v0.9.0

func CollectBigQueryStats(ctx context.Context, job *bigquery.Job)

CollectBigQueryStats populates the DriverStats with BigQuery job statistics if a stats callback is registered in the context.

Types

type BigQueryConf

type BigQueryConf struct {
	ProjectId       string
	Region          string
	CredentialsJson string
	CredentialsFile string
	// AccessToken is an OAuth access token for user-level authentication.
	// When set, it takes precedence over CredentialsJson and CredentialsFile.
	AccessToken string
}

type BigQueryExecutor

type BigQueryExecutor struct {
	// contains filtered or unexported fields
}

func NewBigqueryExecutor

func NewBigqueryExecutor(ctx context.Context, conf *BigQueryConf) (*BigQueryExecutor, error)

func (*BigQueryExecutor) Close

func (e *BigQueryExecutor) Close() error

func (*BigQueryExecutor) Exec

func (e *BigQueryExecutor) Exec(ctx context.Context, sql string) error

func (*BigQueryExecutor) GetBigQueryClient

func (e *BigQueryExecutor) GetBigQueryClient() *bigquery.Client

func (*BigQueryExecutor) QueryRowsIterator

func (e *BigQueryExecutor) QueryRowsIterator(
	ctx context.Context,
	sql string,
	args ...interface{},
) (*bigquery.RowIterator, error)

type Executor

type Executor interface {
	QueryRowsIterator(ctx context.Context, q string, args ...interface{}) (*bigquery.RowIterator, error)
}

type Querier

type Querier[T any] struct {
	// contains filtered or unexported fields
}

func NewQuerier

func NewQuerier[T any](conn *BigQueryExecutor) *Querier[T]

func (*Querier[T]) Close

func (q *Querier[T]) Close() error

func (*Querier[T]) Exec

func (q *Querier[T]) Exec(ctx context.Context, sql string) error

func (*Querier[T]) QueryAndProcessMany

func (q *Querier[T]) QueryAndProcessMany(
	ctx context.Context,
	sql string,
	handler func(ctx context.Context, batch []*T) error,
	opts ...exec.QueryManyOpt[T],
) error

func (*Querier[T]) QueryMany

func (q *Querier[T]) QueryMany(
	ctx context.Context,
	sql string,
	opts ...exec.QueryManyOpt[T],
) ([]*T, error)

func (*Querier[T]) QueryMaps

func (q *Querier[T]) QueryMaps(ctx context.Context, sql string) ([]exec.QueryMapResult, error)

Jump to

Keyboard shortcuts

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