bigquery

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

README

BigQuery Connector

This connector allows you to connect to Google BigQuery and execute queries against your datasets.

Configuration

The connector requires the following configuration parameters:

  • type (string): Constant - bigquery
  • project_id (string): Your Google Cloud Project ID
  • dataset (string): The BigQuery dataset name
  • credentials (string): Google Cloud service account credentials JSON as a string

Example Configuration

type: bigquery
project_id: your-project-id
dataset: your_dataset
credentials: |
  {
    "type": "service_account",
    ...
  }

Features

  • Table discovery
  • Query execution with parameters
  • Schema inference
  • Row sampling

Limitations

  • BigQuery doesn't support traditional primary keys
  • Credentials must be provided as a JSON string
  • Some BigQuery-specific features like clustering and partitioning are not exposed through this connector

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProjectID   string `json:"project_id"`
	Dataset     string `json:"dataset"`
	Credentials string `json:"credentials"`
	Endpoint    string `yaml:"endpoint"`
}

func (Config) Doc

func (c Config) Doc() string

func (Config) Type

func (c Config) Type() string

type Connector

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

func (*Connector) Discovery

func (c *Connector) Discovery(ctx context.Context) ([]model.Table, error)

func (*Connector) GuessColumnType

func (c *Connector) GuessColumnType(sqlType string) model.ColumnType

func (*Connector) InferQuery

func (c *Connector) InferQuery(ctx context.Context, query string) ([]model.ColumnSchema, error)

func (*Connector) InferResultColumns

func (c *Connector) InferResultColumns(ctx context.Context, query string) ([]model.ColumnSchema, error)

func (*Connector) Ping

func (c *Connector) Ping(ctx context.Context) error

func (*Connector) Query

func (c *Connector) Query(ctx context.Context, endpoint model.Endpoint, params map[string]any) ([]map[string]any, error)

func (*Connector) Sample

func (c *Connector) Sample(ctx context.Context, table model.Table) ([]map[string]any, error)

Jump to

Keyboard shortcuts

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