bqv

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ViewConfig

type ViewConfig struct {
	Query       string
	ViewName    string
	DatasetName string
	Description string
}

ViewConfig is...

func CreateViewConfigsFromDatasetDir

func CreateViewConfigsFromDatasetDir(dir string) ([]*ViewConfig, error)

CreateViewConfigsFromDatasetDir creates ViewConfig objects defined in the given dir directory.

func (*ViewConfig) Apply

func (v *ViewConfig) Apply(ctx context.Context, client *bigquery.Client, params map[string]string) (bool, error)

Apply creates the view or updates it when it existed. Apply returns (true, nil) if the view changed and (false ,nil) if the view didn't change

func (*ViewConfig) DeleteIfExist

func (v *ViewConfig) DeleteIfExist(ctx context.Context, client *bigquery.Client) (bool, error)

DeleteIfExist deletes the view if it exists. DeleteIfExist returns true if the view got deleted and false if not.

func (*ViewConfig) Diff

func (v *ViewConfig) Diff(ctx context.Context, client *bigquery.Client, params map[string](string)) (*ViewDiff, error)

Diff returns ViewDiff instance if the actual ViewQuery and the SQL made from Query and params are different.

func (*ViewConfig) DryRun

func (v *ViewConfig) DryRun(ctx context.Context, client *bigquery.Client, params map[string]string) (bool, error)

DryRun tests Query is valid by executing the query in dry-run mode. DryRun returns true if the view might get created or updated when you call Apply and false if not.

func (*ViewConfig) QueryWithParam

func (v *ViewConfig) QueryWithParam(params map[string]string) (string, error)

QueryWithParam returns the SQL made of the template Query and the given params.

type ViewDiff

type ViewDiff struct {
	ViewName       string
	DatasetName    string
	OldDescription string
	NewDescription string
	OldViewQuery   string
	NewViewQuery   string
}

ViewDiff is...

Jump to

Keyboard shortcuts

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