bigquery

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseType = "bigquery"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProjectID       string `json:"project"`
	CredentialsJSON string `json:"credentials"`

	UseLegacyMappings bool `json:"useLegacyMappings"`
}

func (*Config) Parse

func (c *Config) Parse(configJSON json.RawMessage) error

Parse parses the given JSON into the config

type DB

type DB struct {
	*base.DB
}

func NewDB

func NewDB(configJSON json.RawMessage) (*DB, error)

NewDB creates a new bigquery db client

func (*DB) CurrentCatalog added in v1.1.0

func (db *DB) CurrentCatalog(ctx context.Context) (string, error)

func (*DB) ListSchemas

func (db *DB) ListSchemas(ctx context.Context) ([]sqlconnect.SchemaRef, error)

ListSchemas uses the bigquery client instead of [INFORMATION_SCHEMA.SCHEMATA] due to absence of a region qualifier https://cloud.google.com/bigquery/docs/information-schema-datasets-schemata#scope_and_syntax

func (*DB) SchemaExists

func (db *DB) SchemaExists(ctx context.Context, schemaRef sqlconnect.SchemaRef) (bool, error)

SchemaExists uses the bigquery client instead of [INFORMATION_SCHEMA.SCHEMATA] due to absence of a region qualifier https://cloud.google.com/bigquery/docs/information-schema-datasets-schemata#scope_and_syntax

func (*DB) WithBigqueryClient

func (db *DB) WithBigqueryClient(ctx context.Context, f func(*bigquery.Client) error) error

WithBigqueryClient runs the provided function by providing access to a native bigquery client, the underlying client that is used by the bigquery driver

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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