Documentation
¶
Index ¶
- Constants
- func GoquDialectOptions() *sqlgen.SQLDialectOptions
- func GoquExpressions() *base.Expressions
- type Config
- type DB
- func (db *DB) ListColumns(ctx context.Context, relation sqlconnect.RelationRef) ([]sqlconnect.ColumnRef, error)
- func (db *DB) ListColumnsForSqlQuery(ctx context.Context, sql string) ([]sqlconnect.ColumnRef, error)
- func (db *DB) RenameTable(ctx context.Context, oldRef, newRef sqlconnect.RelationRef) error
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"`
UseOAuth bool `json:"useOauth"`
OAuthClientID string `json:"oauthClientId"`
OAuthClientSecret string `json:"oauthClientSecret"`
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"`
}
type DB ¶
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) 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
Click to show internal directories.
Click to hide internal directories.