Versions in this module Expand all Collapse all v1 v1.1.13 May 18, 2021 Changes in this version + const DDLQueryTimeout + const DMLQueryTimeout + const DateUniXFormat + const DebugLevel + const DefaultBytesScannedCutoffPerQuery + const DefaultDBName + const DefaultRegion + const DefaultWGName + const DriverName + const DriverVersion + const DummyAccessID + const DummyRegion + const DummySecretAccessKey + const ErrorLevel + const InfoLevel + const LoggerKey + const MAXQueryStringLength + const MetricsKey + const PCGetDriverVersion + const PCGetQID + const PCGetQIDStatus + const PCStopQID + const PoolInterval + const TimestampUniXFormat + const Version + const WarnLevel + const ZeroDateTimeString + var AthenaColumnTypes = [...]string + var ErrAthenaNilAPI = errors.New("athenaAPI must not be nil") + var ErrAthenaNilDatum = errors.New("*athena.Datum must not be nil") + var ErrAthenaTransactionUnsupported = errors.New("Athena doesn't support transaction statements") + var ErrConfigAccessIDRequired = errors.New("AWS access ID is required") + var ErrConfigAccessKeyRequired = errors.New("AWS access Key is required") + var ErrConfigInvalidConfig = errors.New("driver config is invalid") + var ErrConfigOutputLocation = errors.New("output location must starts with s3") + var ErrConfigRegion = errors.New("region is required") + var ErrConfigWGPointer = errors.New("workgroup pointer is nil") + var ErrInvalidQuery = errors.New("query is not valid") + var ErrQueryBufferOF = errors.New("query buffer overflow") + var ErrQueryTimeout = errors.New("query timeout") + var ErrQueryUnknownType = errors.New("query parameter type is unknown") + var ErrTestMockFailedByAthena = errors.New("the reason why Athena failed the query") + var ErrTestMockGeneric = errors.New("some_mock_error_for_test") + var OutputFormats = [...]string + var OutputStyles = [...]string + func ColsRowsToCSV(rows *sql.Rows) string + func ColsToCSV(rows *sql.Rows) string + func GetDefaultWGConfig() *athena.WorkGroupConfiguration + func GetFromEnvVal(keys []string) string + func GetTableNamesInQuery(query string) map[string]bool + func GetTidySQL(query string) string + func IsQID(q string) bool + func NewWGConfig(bytesScannedCutoffPerQuery int64, enforceWorkGroupConfiguration bool, ...) *athena.WorkGroupConfiguration + func PrettyPrintCSV(rows *sql.Rows) + func PrettyPrintFancy(rows *sql.Rows) + func PrettyPrintMD(rows *sql.Rows) + func PrettyPrintSQLColsRows(rows *sql.Rows, style string, render string, page int) + func PrettyPrintSQLRows(rows *sql.Rows, style string, render string, page int) + func RowsToCSV(rows *sql.Rows) string + type AthenaCache interface + GetQID func(query string) QIDMetaData + GetQuery func(QID string) string + SetQID func(query string, data QIDMetaData) + type AthenaResult struct + func (a AthenaResult) LastInsertId() (int64, error) + func (a AthenaResult) RowsAffected() (int64, error) + type AthenaTime struct + Time time.Time + Valid bool + type Config struct + func NewConfig(s string) (*Config, error) + func NewDefaultConfig(outputBucket string, region string, accessID string, secretAccessKey string) (*Config, error) + func NewNoOpsConfig() *Config + func (c *Config) CheckColumnMasked(columnName string) (string, bool) + func (c *Config) GetAWSProfile() string + func (c *Config) GetAccessID() string + func (c *Config) GetDB() string + func (c *Config) GetOutputBucket() string + func (c *Config) GetRegion() string + func (c *Config) GetSecretAccessKey() string + func (c *Config) GetSessionToken() string + func (c *Config) GetUser() string + func (c *Config) GetWorkgroup() Workgroup + func (c *Config) IsLoggingEnabled() bool + func (c *Config) IsMetricsEnabled() bool + func (c *Config) IsMissingAsDefault() bool + func (c *Config) IsMissingAsEmptyString() bool + func (c *Config) IsMoneyWise() bool + func (c *Config) IsReadOnly() bool + func (c *Config) IsWGRemoteCreationAllowed() bool + func (c *Config) SafeStringify() string + func (c *Config) SetAWSProfile(profile string) + func (c *Config) SetAccessID(o string) error + func (c *Config) SetDB(o string) + func (c *Config) SetLogging(b bool) + func (c *Config) SetMaskedColumnValue(columnName string, value string) + func (c *Config) SetMetrics(b bool) + func (c *Config) SetMissingAsDefault(b bool) + func (c *Config) SetMissingAsEmptyString(b bool) + func (c *Config) SetMoneyWise(b bool) + func (c *Config) SetOutputBucket(o string) error + func (c *Config) SetReadOnly(b bool) + func (c *Config) SetRegion(o string) error + func (c *Config) SetSecretAccessKey(o string) error + func (c *Config) SetSessionToken(o string) + func (c *Config) SetUser(o string) + func (c *Config) SetWGRemoteCreationAllowed(b bool) + func (c *Config) SetWorkGroup(w *Workgroup) error + func (c *Config) String() string + func (c *Config) Stringify() string + type Connection struct + func (c *Connection) Begin() (driver.Tx, error) + func (c *Connection) BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error) + func (c *Connection) CheckNamedValue(nv *driver.NamedValue) (err error) + func (c *Connection) Close() error + func (c *Connection) ExecContext(ctx context.Context, query string, namedArgs []driver.NamedValue) (driver.Result, error) + func (c *Connection) Ping(ctx context.Context) error + func (c *Connection) Prepare(query string) (driver.Stmt, error) + func (c *Connection) QueryContext(ctx context.Context, query string, namedArgs []driver.NamedValue) (driver.Rows, error) + type DriverTracer struct + func (c *DriverTracer) Config() *Config + func (c *DriverTracer) Log(lvl zapcore.Level, msg string, fields ...zap.Field) + func (c *DriverTracer) Logger() *zap.Logger + func (c *DriverTracer) Scope() tally.Scope + func (c *DriverTracer) SetLogger(logger *zap.Logger) + func (c *DriverTracer) SetScope(scope tally.Scope) + type QIDMetaData struct + QID string + type Rows struct + ResultOutput *athena.GetQueryResultsOutput + func NewNonOpsRows(ctx context.Context, athenaAPI athenaiface.AthenaAPI, queryID string, ...) (*Rows, error) + func NewRows(ctx context.Context, athenaAPI athenaiface.AthenaAPI, queryID string, ...) (*Rows, error) + func (r *Rows) Close() error + func (r *Rows) ColumnTypeDatabaseTypeName(index int) string + func (r *Rows) Columns() []string + func (r *Rows) Next(dest []driver.Value) error + type SQLConnector struct + func NoopsSQLConnector() *SQLConnector + func (c *SQLConnector) Connect(ctx context.Context) (driver.Conn, error) + func (c *SQLConnector) Driver() driver.Driver + type SQLDriver struct + func (d *SQLDriver) Open(dsn string) (driver.Conn, error) + func (d *SQLDriver) OpenConnector(dsn string) (driver.Connector, error) + type Statement struct + func (s *Statement) Close() error + func (s *Statement) ColumnConverter(idx int) driver.ValueConverter + func (s *Statement) Exec(args []driver.Value) (driver.Result, error) + func (s *Statement) NumInput() int + func (s *Statement) Query(args []driver.Value) (driver.Rows, error) + type TContextKey string + type WGConfig struct + type WGTags struct + func NewWGTags() *WGTags + func (t *WGTags) AddTag(k string, v string) + func (t *WGTags) Get() []*athena.Tag + type Workgroup struct + Config *athena.WorkGroupConfiguration + Name string + Tags *WGTags + func NewDefaultWG(name string, config *athena.WorkGroupConfiguration, tags *WGTags) *Workgroup + func NewWG(name string, config *athena.WorkGroupConfiguration, tags *WGTags) *Workgroup + func (w *Workgroup) CreateWGRemotely(athenaService athenaiface.AthenaAPI) error