bq

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(ctx context.Context, projectID types.GoogleProjectID, datasetID types.BQDatasetID, options ...option.ClientOption) (*Client, error)

func (*Client) CreateTable

func (x *Client) CreateTable(ctx context.Context, table types.BQTableID, md *bigquery.TableMetadata) error

CreateTable implements interfaces.BigQuery.

func (*Client) GetMetadata

func (x *Client) GetMetadata(ctx context.Context, table types.BQTableID) (*bigquery.TableMetadata, error)

GetMetadata implements interfaces.BigQuery. If the table does not exist, it returns nil.

func (*Client) Insert

func (x *Client) Insert(ctx context.Context, table types.BQTableID, schema bigquery.Schema, data any) error

Insert implements interfaces.BigQuery.

func (*Client) UpdateTable

func (x *Client) UpdateTable(ctx context.Context, table types.BQTableID, md bigquery.TableMetadataToUpdate, eTag string) error

UpdateTable implements interfaces.BigQuery.

type Mock

type Mock struct {
	FnCreateTable func(ctx context.Context, table types.BQTableID, md *bigquery.TableMetadata) error
	FnGetMetadata func(ctx context.Context, table types.BQTableID) (*bigquery.TableMetadata, error)
	FnInsert      func(ctx context.Context, tableID types.BQTableID, schema bigquery.Schema, data any) error
	FnUpdateTable func(ctx context.Context, table types.BQTableID, md bigquery.TableMetadataToUpdate, eTag string) error
}

func (*Mock) CreateTable

func (m *Mock) CreateTable(ctx context.Context, table types.BQTableID, md *bigquery.TableMetadata) error

CreateTable implements interfaces.BigQuery.

func (*Mock) GetMetadata

func (m *Mock) GetMetadata(ctx context.Context, table types.BQTableID) (*bigquery.TableMetadata, error)

GetMetadata implements interfaces.BigQuery.

func (*Mock) Insert

func (m *Mock) Insert(ctx context.Context, tableID types.BQTableID, schema bigquery.Schema, data any) error

Insert implements interfaces.BigQuery.

func (*Mock) UpdateTable

func (m *Mock) UpdateTable(ctx context.Context, table types.BQTableID, md bigquery.TableMetadataToUpdate, eTag string) error

UpdateTable implements interfaces.BigQuery.

Jump to

Keyboard shortcuts

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