adapters

package
v0.0.0-...-b4aebca Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnmatchedDoubleQuote = func(position int) error { return fmt.Errorf("syntax error: unmatched double quote at: %d", position) }
	ErrUnmatchedSingleQuote = func(position int) error { return fmt.Errorf("syntax error: unmatched single quote at: %d", position) }
)

ErrUnmatchedDoubleQuote and ErrUnmatchedSingleQuote are errors returned from ParseRedisCmd

View Source
var (
	ErrUnsupportedTypeAlias = errors.New("no driver registered for provided type alias")
)

Functions

func NewConnection

func NewConnection(params *core.ConnectionParams) (*core.Connection, error)

NewConnection is a wrapper around core.NewConnection that uses the internal mux for adapter registration.

Types

type BigQuery

type BigQuery struct{}

func (*BigQuery) Connect

func (bq *BigQuery) Connect(rawURL string) (core.Driver, error)

Connect creates a BigQuery client connected to the project specified in the url. The format of the url is as follows:

bigquery://[project][?options]

where project is optional. If not set, the project will attempt to be detected from the credentials and current gcloud settings.

The options query parameters map directly to bigquery.QueryConfig fields using kebab-case. For example, MaxBytesBilled becomes max-bytes-billed.

Common options include:

  • credentials=path/to/creds.json: Path to credentials file
  • max-bytes-billed=integer: Maximum bytes to be billed
  • disable-query-cache=bool: Whether to disable query cache
  • use-legacy-sql=bool: Whether to use legacy SQL
  • location=string: Query location
  • enable-storage-read=bool: Enable BigQuery Storage API

For internal testing:

  • endpoint=url: Custom endpoint for test containers

If credentials are not specified, they will be located according to the Google Default Credentials process.

func (*BigQuery) GetHelpers

func (*BigQuery) GetHelpers(opts *core.TableOptions) map[string]string

type Clickhouse

type Clickhouse struct{}

func (*Clickhouse) Connect

func (p *Clickhouse) Connect(url string) (core.Driver, error)

func (*Clickhouse) GetHelpers

func (*Clickhouse) GetHelpers(opts *core.TableOptions) map[string]string

type Databricks

type Databricks struct{}

func (*Databricks) Connect

func (d *Databricks) Connect(connectionURL string) (core.Driver, error)

see https://github.com/databricks/databricks-sql-go for more information.

func (*Databricks) GetHelpers

func (d *Databricks) GetHelpers(opts *core.TableOptions) map[string]string

GetHelpers returns a map of helper queries for the given table.

type Duck

type Duck struct{}

func (*Duck) Connect

func (d *Duck) Connect(url string) (core.Driver, error)

func (*Duck) GetHelpers

func (*Duck) GetHelpers(opts *core.TableOptions) map[string]string

type Mongo

type Mongo struct{}

func (*Mongo) Connect

func (m *Mongo) Connect(rawURL string) (core.Driver, error)

func (*Mongo) GetHelpers

func (*Mongo) GetHelpers(opts *core.TableOptions) map[string]string

type Mux

type Mux struct{}

Mux is an interface to all internal adapters.

func (*Mux) AddAdapter

func (*Mux) AddAdapter(typ string, adapter core.Adapter) error

func (*Mux) AddHelpers

func (*Mux) AddHelpers(typ string, helpers map[string]string) error

func (*Mux) GetAdapter

func (*Mux) GetAdapter(typ string) (core.Adapter, error)

type MySQL

type MySQL struct{}

func (*MySQL) Connect

func (m *MySQL) Connect(url string) (core.Driver, error)

func (*MySQL) GetHelpers

func (*MySQL) GetHelpers(opts *core.TableOptions) map[string]string

type Oracle

type Oracle struct{}

func (*Oracle) Connect

func (o *Oracle) Connect(url string) (core.Driver, error)

func (*Oracle) GetHelpers

func (*Oracle) GetHelpers(opts *core.TableOptions) map[string]string

type Postgres

type Postgres struct{}

func (*Postgres) Connect

func (p *Postgres) Connect(url string) (core.Driver, error)

func (*Postgres) GetHelpers

func (*Postgres) GetHelpers(opts *core.TableOptions) map[string]string

type Redis

type Redis struct{}

func (*Redis) Connect

func (r *Redis) Connect(url string) (core.Driver, error)

func (*Redis) GetHelpers

func (*Redis) GetHelpers(opts *core.TableOptions) map[string]string

type Redshift

type Redshift struct{}

func (*Redshift) Connect

func (r *Redshift) Connect(rawURL string) (core.Driver, error)

func (*Redshift) GetHelpers

func (r *Redshift) GetHelpers(opts *core.TableOptions) map[string]string

type SQLServer

type SQLServer struct{}

func (*SQLServer) Connect

func (s *SQLServer) Connect(url string) (core.Driver, error)

func (*SQLServer) GetHelpers

func (*SQLServer) GetHelpers(opts *core.TableOptions) map[string]string

type SQLite

type SQLite struct{}

func (*SQLite) Connect

func (s *SQLite) Connect(url string) (core.Driver, error)

func (*SQLite) GetHelpers

func (*SQLite) GetHelpers(opts *core.TableOptions) map[string]string

Jump to

Keyboard shortcuts

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