Documentation
¶
Index ¶
- func CreateTemplate(ctx context.Context, subQueries map[string]string, ps map[string]interface{}, ...) *template.Template
- func OpenDatabaseFromDefaultSqlConnectionLayer(parsedLayers map[string]*layers.ParsedParameterLayer) (*sqlx.DB, error)
- func OpenDatabaseFromParsedLayers(parsedLayers ...*layers.ParsedParameterLayer) (*sqlx.DB, error)
- func OpenDatabaseFromSqlConnectionLayer(parsedLayers map[string]*layers.ParsedParameterLayer, ...) (*sqlx.DB, 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 ConnectionParameterLayer
- type DatabaseConfig
- type DbtParameterLayer
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTemplate ¶
func OpenDatabaseFromParsedLayers ¶
func OpenDatabaseFromParsedLayers(parsedLayers ...*layers.ParsedParameterLayer) (*sqlx.DB, error)
func RunNamedQueryIntoGlaze ¶
func RunQueryIntoGlaze ¶
Types ¶
type ConnectionParameterLayer ¶
type ConnectionParameterLayer struct {
layers.ParameterLayerImpl `yaml:",inline"`
}
func NewSqlConnectionParameterLayer ¶
func NewSqlConnectionParameterLayer( options ...layers.ParameterLayerOptions, ) (*ConnectionParameterLayer, error)
func (*ConnectionParameterLayer) ParseFlagsFromCobraCommand ¶
func (cp *ConnectionParameterLayer) ParseFlagsFromCobraCommand(cmd *cobra.Command) (map[string]interface{}, 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.ParsedParameterLayer) (*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)
func (*DbtParameterLayer) ParseFlagsFromCobraCommand ¶
func (d *DbtParameterLayer) ParseFlagsFromCobraCommand(cmd *cobra.Command) (map[string]interface{}, error)
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 ¶
Click to show internal directories.
Click to hide internal directories.