bigquery

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigqueryJob

type BigqueryJob interface {
	ID() string
	Location() string
	ProjectID() string
	Read(context.Context) (*bigquery.RowIterator, error)
	LastStatus() *bigquery.JobStatus
	Config() (bigquery.JobConfig, error)
	URL() string
}

type Client

type Client interface {
	Close() error

	// GetDefaultProject returns the default project of the current user.
	GetDefaultProject() string

	// ListProjects lists all projects the current user has access to.
	ListProjects(ctx context.Context) ([]*cloudresourcemanager.Project, error)

	// ListDatasets lists all datasets in the specified project.
	ListDatasets(ctx context.Context, projectID string) ([]*bigquery.Dataset, error)

	// ListTables lists all tables in the specified dataset.
	ListTables(ctx context.Context, projectID, datasetID string) ([]*bigquery.Table, error)

	// GetDatasetMetadata returns the metadata of the specified dataset.
	GetDatasetMetadata(ctx context.Context, projectID, datasetID string) (*bigquery.DatasetMetadata, error)

	// GetTableMetadata returns the metadata of the specified table.
	GetTableMetadata(ctx context.Context, projectID, datasetID, tableID string) (*bigquery.TableMetadata, error)

	// GetTableRecord returns the row of the specified table.
	GetTableRecord(ctx context.Context, projectID, datasetID, tableID string) (*bigquery.RowIterator, error)

	// Run runs the specified query.
	Run(ctx context.Context, q string, dryrun bool) (BigqueryJob, error)

	// JobFromID returns the job with the specified ID.
	JobFromProject(ctx context.Context, projectID, jobID, location string) (BigqueryJob, error)

	// Jobs returns the iterator of all jobs.
	Jobs(ctx context.Context) *bigquery.JobIterator
}

func New

func New(ctx context.Context, projectID, location string, withCache bool, looger *logrus.Logger) (Client, error)

Directories

Path Synopsis
Package mock_bigquery is a generated GoMock package.
Package mock_bigquery is a generated GoMock package.

Jump to

Keyboard shortcuts

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