Documentation ¶
Index ¶
- Constants
- func BuildCobraCommandWithSqletonMiddlewares(cmd cmds.Command, options ...cli.CobraParserOption) (*cobra.Command, error)
- func CleanQuery(query string) string
- func CreateTemplate(ctx context.Context, subQueries map[string]string, ps map[string]interface{}, ...) *template.Template
- func GetCobraCommandSqletonMiddlewares(commandSettings *cli.GlazedCommandSettings, cmd *cobra.Command, args []string) ([]middlewares.Middleware, error)
- func OpenDatabaseFromDefaultSqlConnectionLayer(parsedLayers *layers.ParsedLayers) (*sqlx.DB, error)
- func OpenDatabaseFromSqlConnectionLayer(parsedLayers *layers.ParsedLayers, sqlConnectionLayerName string, ...) (*sqlx.DB, error)
- func RenderQuery(ctx context.Context, db *sqlx.DB, query string, subQueries map[string]string, ...) (string, error)
- func RunNamedQueryIntoGlaze(dbContext context.Context, db *sqlx.DB, query string, ...) error
- func RunQuery(ctx context.Context, subQueries map[string]string, query string, ...) (string, *sqlx.Rows, error)
- func RunQueryIntoGlaze(dbContext context.Context, db *sqlx.DB, query string, parameters []interface{}, ...) error
- type DBConnectionFactory
- type DatabaseConfig
- type DbtParameterLayer
- type DbtSettings
- type Source
- type SqlConnectionParameterLayer
- type SqlConnectionSettings
Constants ¶
View Source
const DbtSlug = "dbt"
View Source
const SqlConnectionSlug = "sql-connection"
Variables ¶
This section is empty.
Functions ¶
func BuildCobraCommandWithSqletonMiddlewares ¶ added in v0.1.0
func CleanQuery ¶ added in v0.0.21
func CreateTemplate ¶
func GetCobraCommandSqletonMiddlewares ¶ added in v0.1.0
func GetCobraCommandSqletonMiddlewares( commandSettings *cli.GlazedCommandSettings, cmd *cobra.Command, args []string, ) ([]middlewares.Middleware, error)
func OpenDatabaseFromDefaultSqlConnectionLayer ¶
func OpenDatabaseFromDefaultSqlConnectionLayer( parsedLayers *layers.ParsedLayers, ) (*sqlx.DB, error)
func RenderQuery ¶ added in v0.0.28
func RunNamedQueryIntoGlaze ¶
func RunQueryIntoGlaze ¶
Types ¶
type DBConnectionFactory ¶ added in v0.1.0
type DBConnectionFactory func(parsedLayers *layers.ParsedLayers) (*sqlx.DB, error)
type DatabaseConfig ¶
type DatabaseConfig struct { Host string `glazed.parameter:"host"` Database string `glazed.parameter:"database"` User string `glazed.parameter:"user"` Password string `glazed.parameter:"password"` Port int `glazed.parameter:"port"` Schema string `glazed.parameter:"schema"` Type string `glazed.parameter:"db-type"` DSN string `glazed.parameter:"dsn"` Driver string `glazed.parameter:"driver"` DbtProfilesPath string `glazed.parameter:"dbt-profiles-path"` DbtProfile string `glazed.parameter:"dbt-profile"` UseDbtProfiles bool `glazed.parameter:"use-dbt-profiles"` }
func NewConfigFromParsedLayers ¶
func NewConfigFromParsedLayers(parsedLayers ...*layers.ParsedLayer) (*DatabaseConfig, error)
func (*DatabaseConfig) GetSource ¶
func (c *DatabaseConfig) GetSource() (*Source, error)
func (*DatabaseConfig) LogVerbose ¶
func (c *DatabaseConfig) LogVerbose()
LogVerbose just outputs information about the database config to the debug logging level.
func (*DatabaseConfig) ToString ¶
func (c *DatabaseConfig) ToString() string
type DbtParameterLayer ¶
type DbtParameterLayer struct {
layers.ParameterLayerImpl `yaml:",inline"`
}
func NewDbtParameterLayer ¶
func NewDbtParameterLayer( options ...layers.ParameterLayerOptions, ) (*DbtParameterLayer, error)
type DbtSettings ¶ added in v0.1.0
type Source ¶
type Source struct { Name string Type string `yaml:"type"` Hostname string `yaml:"server"` Port int `yaml:"port"` Username string `yaml:"username"` Password string `yaml:"password"` Schema string `yaml:"schema"` Database string `yaml:"database"` }
Source is the generic structure we use to represent a database connection string
func ParseDbtProfiles ¶
ParseDbtProfiles parses a dbt profiles.yml file and returns a map of sources
func (*Source) ToConnectionString ¶
type SqlConnectionParameterLayer ¶ added in v0.1.0
type SqlConnectionParameterLayer struct {
layers.ParameterLayerImpl `yaml:",inline"`
}
func NewSqlConnectionParameterLayer ¶
func NewSqlConnectionParameterLayer( options ...layers.ParameterLayerOptions, ) (*SqlConnectionParameterLayer, error)
type SqlConnectionSettings ¶ added in v0.1.0
type SqlConnectionSettings struct { Host string `glazed.parameter:"host"` Port int `glazed.parameter:"port"` Database string `glazed.parameter:"database"` User string `glazed.parameter:"user"` Password string `glazed.parameter:"password"` Schema string `glazed.parameter:"schema"` DbType string `glazed.parameter:"db-type"` Repository string `glazed.parameter:"repository"` Dsn string `glazed.parameter:"dsn"` Driver string `glazed.parameter:"driver"` }
Click to show internal directories.
Click to hide internal directories.