dump

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 9 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(outDir string) *Client

New returns a new instance of dumper Client.

func (*Client) CreateTable

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

CreateTable implements interfaces.BigQuery. Nothing to do in dumper.

func (*Client) GetMetadata

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

GetMetadata implements interfaces.BigQuery.

func (*Client) Insert

func (x *Client) Insert(ctx context.Context, datasetID types.BQDatasetID, tableID types.BQTableID, schema bigquery.Schema, data []any) error

Insert implements interfaces.BigQuery. It writes data to a file in JSON format. The file name is "{outDir}/{dataset}.{table}.log". If the file does not exist, it creates a new file. If the file exists, it appends data to the file. The file is not uploaded to BigQuery.

func (*Client) NewStream added in v0.1.2

func (x *Client) NewStream(ctx context.Context, datasetID types.BQDatasetID, tableID types.BQTableID, schema bigquery.Schema) (interfaces.BigQueryStream, error)

func (*Client) Query

func (x *Client) Query(ctx context.Context, query string) (interfaces.BigQueryIterator, error)

Query implements interfaces.BigQuery. It is not implemented and panics if called.

func (*Client) UpdateTable

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

UpdateSchema implements interfaces.BigQuery. It writes schema to a file in JSON format. The file name is "{outDir}/{dataset}.{table}.schema.json". If the file does not exist, it creates a new file. If the file exists, it overwrites the file. The file is not uploaded to BigQuery.

type Stream added in v0.1.2

type Stream struct {
}

TODO: Implement Stream

func (*Stream) Close added in v0.1.2

func (x *Stream) Close() error

func (*Stream) Insert added in v0.1.2

func (x *Stream) Insert(ctx context.Context, data []any) error

Jump to

Keyboard shortcuts

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