Documentation
¶
Index ¶
- func NewRepositoryFactory() handlers.RepositoryFactory
- type DBConnectionFactory
- type SqlCommand
- func (s *SqlCommand) Description() *cmds.CommandDescription
- func (s *SqlCommand) IsValid() bool
- func (s *SqlCommand) Metadata(ctx context.Context, parsedLayers map[string]*layers.ParsedParameterLayer, ...) (map[string]interface{}, error)
- func (s *SqlCommand) RenderQuery(ctx context.Context, ps map[string]interface{}, db *sqlx.DB) (string, error)
- func (s *SqlCommand) RenderQueryFull(ctx context.Context, parsedLayers map[string]*layers.ParsedParameterLayer, ...) (string, error)
- func (s *SqlCommand) Run(ctx context.Context, parsedLayers map[string]*layers.ParsedParameterLayer, ...) error
- func (s *SqlCommand) RunQueryIntoGlaze(ctx context.Context, db *sqlx.DB, ps map[string]interface{}, ...) error
- func (s *SqlCommand) String() string
- func (s *SqlCommand) ToYAML(w io.Writer) error
- type SqlCommandDescription
- type SqlCommandLoader
- type SqlCommandOption
- type SqletonCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRepositoryFactory ¶
func NewRepositoryFactory() handlers.RepositoryFactory
Types ¶
type DBConnectionFactory ¶
type SqlCommand ¶
type SqlCommand struct {
*cmds.CommandDescription
Query string `yaml:"query"`
SubQueries map[string]string `yaml:"subqueries,omitempty"`
// contains filtered or unexported fields
}
SqlCommand describes a command line command that runs a query
func NewSqlCommand ¶
func NewSqlCommand( description *cmds.CommandDescription, options ...SqlCommandOption, ) (*SqlCommand, error)
func (*SqlCommand) Description ¶
func (s *SqlCommand) Description() *cmds.CommandDescription
func (*SqlCommand) IsValid ¶
func (s *SqlCommand) IsValid() bool
func (*SqlCommand) Metadata ¶ added in v0.1.74
func (s *SqlCommand) Metadata(ctx context.Context, parsedLayers map[string]*layers.ParsedParameterLayer, ps map[string]interface{}) (map[string]interface{}, error)
func (*SqlCommand) RenderQuery ¶
func (*SqlCommand) RenderQueryFull ¶
func (s *SqlCommand) RenderQueryFull( ctx context.Context, parsedLayers map[string]*layers.ParsedParameterLayer, ps map[string]interface{}, ) (string, error)
func (*SqlCommand) Run ¶
func (s *SqlCommand) Run( ctx context.Context, parsedLayers map[string]*layers.ParsedParameterLayer, ps map[string]interface{}, gp middlewares.Processor, ) error
func (*SqlCommand) RunQueryIntoGlaze ¶
func (s *SqlCommand) RunQueryIntoGlaze( ctx context.Context, db *sqlx.DB, ps map[string]interface{}, gp middlewares.Processor) error
func (*SqlCommand) String ¶
func (s *SqlCommand) String() string
type SqlCommandDescription ¶
type SqlCommandDescription struct {
Name string `yaml:"name"`
Short string `yaml:"short"`
Long string `yaml:"long,omitempty"`
Layout []*layout.Section `yaml:"layout,omitempty"`
Flags []*parameters.ParameterDefinition `yaml:"flags,omitempty"`
Arguments []*parameters.ParameterDefinition `yaml:"arguments,omitempty"`
Layers []layers.ParameterLayer `yaml:"layers,omitempty"`
SubQueries map[string]string `yaml:"subqueries,omitempty"`
Query string `yaml:"query"`
}
type SqlCommandLoader ¶
type SqlCommandLoader struct {
DBConnectionFactory DBConnectionFactory
}
func (*SqlCommandLoader) LoadCommandAliasFromYAML ¶
func (scl *SqlCommandLoader) LoadCommandAliasFromYAML(s io.Reader, options ...alias.Option) ([]*alias.CommandAlias, error)
func (*SqlCommandLoader) LoadCommandFromYAML ¶
func (scl *SqlCommandLoader) LoadCommandFromYAML( s io.Reader, options ...cmds.CommandDescriptionOption, ) ([]cmds.Command, error)
type SqlCommandOption ¶
type SqlCommandOption func(*SqlCommand)
func WithDbConnectionFactory ¶
func WithDbConnectionFactory(factory DBConnectionFactory) SqlCommandOption
func WithQuery ¶
func WithQuery(query string) SqlCommandOption
func WithSubQueries ¶
func WithSubQueries(subQueries map[string]string) SqlCommandOption
type SqletonCommand ¶
type SqletonCommand interface {
cmds.GlazeCommand
RunQueryIntoGlaze(
ctx context.Context,
db *sqlx.DB,
parameters map[string]interface{},
gp middlewares.TableProcessor,
) error
RenderQuery(parameters map[string]interface{}) (string, error)
}
Click to show internal directories.
Click to hide internal directories.