Documentation
¶
Index ¶
- Constants
- func BuildCobraCommandWithSqletonMiddlewares(cmd cmds.Command, options ...cli.CobraOption) (*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(parsedCommandLayers *layers.ParsedLayers, cmd *cobra.Command, args []string) ([]middlewares.Middleware, error)
- func GetConnectionStringFromParsedLayers(parsedLayers *layers.ParsedLayers) (string, error)
- func GetConnectionStringFromSqlConnectionLayer(parsedLayers *layers.ParsedLayers, sqlConnectionLayerName string, ...) (string, error)
- func GetSqletonMiddlewares(parsedCommandLayers *layers.ParsedLayers) ([]middlewares.Middleware, error)
- func OpenDatabaseFromDefaultSqlConnectionLayer(ctx context.Context, parsedLayers *layers.ParsedLayers) (*sqlx.DB, error)
- func OpenDatabaseFromSqlConnectionLayer(ctx context.Context, parsedLayers *layers.ParsedLayers, ...) (*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( parsedCommandLayers *layers.ParsedLayers, cmd *cobra.Command, args []string, ) ([]middlewares.Middleware, error)
func GetConnectionStringFromParsedLayers ¶ added in v0.1.40
func GetConnectionStringFromParsedLayers(parsedLayers *layers.ParsedLayers) (string, error)
GetConnectionStringFromParsedLayers extracts a connection string from parsed layers This is useful for tools like River that need a connection string directly
func GetConnectionStringFromSqlConnectionLayer ¶ added in v0.1.40
func GetConnectionStringFromSqlConnectionLayer( parsedLayers *layers.ParsedLayers, sqlConnectionLayerName string, dbtLayerName string, ) (string, error)
GetConnectionStringFromSqlConnectionLayer extracts a connection string from specific layer names
func GetSqletonMiddlewares ¶ added in v0.1.29
func GetSqletonMiddlewares( parsedCommandLayers *layers.ParsedLayers, ) ([]middlewares.Middleware, error)
GetSqletonMiddlewares returns the common middleware chain used by sqleton commands
func RenderQuery ¶ added in v0.0.28
func RunNamedQueryIntoGlaze ¶
func RunQueryIntoGlaze ¶
Types ¶
type DBConnectionFactory ¶ added in v0.1.0
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"`
SSLDisable bool `glazed.parameter:"ssl-disable"`
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 NewConfigFromRawParsedLayers ¶ added in v0.1.32
func NewConfigFromRawParsedLayers(parsedLayers *layers.ParsedLayers) (*DatabaseConfig, error)
func (*DatabaseConfig) GetConnectionString ¶ added in v0.1.40
func (c *DatabaseConfig) GetConnectionString() (string, error)
GetConnectionString returns the connection string for this database config
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"`
SSLDisable bool `yaml:"ssl_disable"`
}
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"`
SSLDisable bool `glazed.parameter:"ssl-disable"`
}
Click to show internal directories.
Click to hide internal directories.