Documentation ¶
Index ¶
- func CheckInternalAthenaError(_ any, err error) exec.ErrorType
- func EscapeString(value string) string
- func IsInternalAthenaError(err error) bool
- func NewClient(ctx context.Context, config cfg.Config, logger log.Logger, name string, ...) (*athena.Client, error)
- func NewRepository[T any](ctx context.Context, config cfg.Config, logger log.Logger, settings *Settings) (*repository[T], error)
- func NewRepositoryRaw(ctx context.Context, config cfg.Config, logger log.Logger, settings *Settings) (*repositoryRaw, error)
- func NewRepositoryRawWithInterfaces(db *sql.DB, executor exec.Executor, settings *Settings) *repositoryRaw
- func NewRepositoryWithInterfaces[T any](raw RepositoryRaw, settings *Settings) *repository[T]
- func ProvideClient(ctx context.Context, config cfg.Config, logger log.Logger, name string, ...) (*athena.Client, error)
- func ReplaceDollarPlaceholders(query string, args []any) (sql string, err error)
- type ClientConfig
- type ClientOption
- type ClientSettings
- type Repository
- type RepositoryRaw
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckInternalAthenaError ¶ added in v0.33.2
func EscapeString ¶
EscapeString converts a string value to something you can embed in an SQL query (if you can't use parametrized queries). The string is surrounded by single quotes, so you don't need to take care of that yourself.
func IsInternalAthenaError ¶ added in v0.33.2
func NewRepository ¶
func NewRepositoryRaw ¶
func NewRepositoryWithInterfaces ¶
func NewRepositoryWithInterfaces[T any](raw RepositoryRaw, settings *Settings) *repository[T]
func ProvideClient ¶
func ReplaceDollarPlaceholders ¶
ReplaceDollarPlaceholders replaces $1, $2, etc. with the corresponding element from params. You have to supply an additional escape function which converts each parameter to a string safe to embed in the query.
Types ¶
type ClientConfig ¶
type ClientConfig struct { Settings ClientSettings LoadOptions []func(options *awsCfg.LoadOptions) error }
func (ClientConfig) GetLoadOptions ¶
func (c ClientConfig) GetLoadOptions() []func(options *awsCfg.LoadOptions) error
func (ClientConfig) GetRetryOptions ¶
func (c ClientConfig) GetRetryOptions() []func(*retry.StandardOptions)
func (ClientConfig) GetSettings ¶
func (c ClientConfig) GetSettings() gosoAws.ClientSettings
type ClientOption ¶
type ClientOption func(cfg *ClientConfig)
type ClientSettings ¶
type Repository ¶
type Repository[T any] interface { RepositoryRaw // QueryBuilder returns a prepared query builder with prefilled columns and table name QueryBuilder() squirrel.SelectBuilder // Query accepts a query builder and executes the resulting sql statement. Query(ctx context.Context, qb squirrel.SelectBuilder) ([]T, error) // QuerySql accepts an already formatted sql statement and executes it. QuerySql(ctx context.Context, query string) ([]T, error) }
Repository is a high level repository implementation to query Athena. The repository is typed to return a slice of structs as a result instead of raw rows.
Click to show internal directories.
Click to hide internal directories.