table

package
v0.0.0-...-3cb0839 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidArgument failure.StringCode = "InvalidArgument"
)

Variables

This section is empty.

Functions

func IsYYYYMMDD

func IsYYYYMMDD(tableName string, start string, end string) (bool, error)

IsYYYYMMDD is tableで指定したテーブル名がstart, endで指定したYYYYMMDDの範囲にあるかを返す Ex: table=hoge20190101 start=20180101 end=20190102

Types

type Dataset

type Dataset struct {
	Project   string
	DatasetID string
}

type SearchOption

type SearchOption struct {
	TablePrefix string
	Start       string // YYYYMMDD
	End         string // YYYYMMDD
}

func (*SearchOption) Check

func (o *SearchOption) Check(tableName string) (bool, error)

type Service

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

func NewService

func NewService(ctx context.Context) (*Service, error)

func (*Service) Copy

func (s *Service) Copy(jobInsertProjectID string, srcDataset Dataset, dstDataset Dataset, tableID string) (jobID string, rerr error)

func (*Service) CopyAll

func (s *Service) CopyAll(jobInsertProjectID string, srcDataset Dataset, dstDataset Dataset, search *SearchOption) ([]string, error)

Copy is srcDatasetからdstDatasetにTableをコピーする start, end で指定した範囲に収まってるYYYYMMDDのTableをコピーする。

func (*Service) Delete

func (s *Service) Delete(dataset *Dataset, tableID string) error

func (*Service) DeleteAll

func (s *Service) DeleteAll(dataset Dataset, search *SearchOption) error

DeleteAll is 指定したDatasetの条件に一致するTableを削除する start, end で指定した範囲に収まってるYYYYMMDDのTableをコピーする。

func (*Service) DiffAll

func (s *Service) DiffAll(baseDataset Dataset, targetDataset Dataset, search *SearchOption) error

func (*Service) GetAll

func (s *Service) GetAll(projectID string, dataset string, search *SearchOption) ([]*bigquery.TableListTables, error)

type TableDiff

type TableDiff struct {
	TableID    string
	T1NumRows  uint64
	T2NumRows  uint64
	SchemaDiff []string
}

Jump to

Keyboard shortcuts

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