Help us shape the future of Go! Take the 2026 Go Developer Survey

databricks

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseType = "databricks"
)

Variables

This section is empty.

Functions

func GoquDialectOptions added in v1.10.0

func GoquDialectOptions() *sqlgen.SQLDialectOptions

func GoquExpressions added in v1.10.0

func GoquExpressions() *base.Expressions

Types

type Config

type Config struct {
	Host    string `json:"host"`
	Port    int    `json:"port"`
	Path    string `json:"path"`
	Token   string `json:"token"`
	Catalog string `json:"catalog"`
	Schema  string `json:"schema"`

	TunnelInfo *sshtunnel.Config `json:"tunnel_info,omitempty"`

	RetryAttempts    int           `json:"retryAttempts"`    // default: 4
	MinRetryWaitTime time.Duration `json:"minRetryWaitTime"` // default: 1s
	MaxRetryWaitTime time.Duration `json:"maxRetryWaitTime"` // default: 30s
	MaxConnIdleTime  time.Duration `json:"maxConnIdleTime"`  // default: disabled

	Timeout time.Duration `json:"timeout"` // default: no timeout

	SessionParams map[string]string `json:"sessionParams"`

	UseLegacyMappings bool `json:"useLegacyMappings"`
	// SkipColumnNormalization skips normalizing column names during ListColumns and ListColumnsForSqlQuery.
	// Databricks is returning column names case sensitive from information schema, even though it is case insensitive.
	// So, by default table names are returned normalized by databricks, whereas column names are not.
	// To avoid this inconsistency, we are normalizing column names by default.
	// If you want to skip this normalization, set this flag to true.
	SkipColumnNormalization bool `json:"skipColumnNormalisation"`
}

func (*Config) Parse

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

type DB

type DB struct {
	*base.DB
	// contains filtered or unexported fields
}

func NewDB

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

NewDB creates a new databricks db client

func (*DB) ListColumns added in v1.1.0

func (db *DB) ListColumns(ctx context.Context, relation sqlconnect.RelationRef) ([]sqlconnect.ColumnRef, error)

ListColumns returns a list of columns for the given table

func (*DB) ListColumnsForSqlQuery added in v1.14.0

func (db *DB) ListColumnsForSqlQuery(ctx context.Context, sql string) ([]sqlconnect.ColumnRef, error)

func (*DB) RenameTable

func (db *DB) RenameTable(ctx context.Context, oldRef, newRef sqlconnect.RelationRef) error

RenameTable in databricks falls back to MoveTable if rename is not supported

Jump to

Keyboard shortcuts

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