sql

package
v0.0.0-...-e917273 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PostgresDSN   string     `yaml:"postgresDsn,omitempty"`
	MysqlDSN      string     `yaml:"mysqlDSN,omitempty"`
	ClickHouseDSN string     `yaml:"clickhouseDSN,omitempty"`
	MaxConns      int        `yaml:"maxConns"`
	MaxIdleConns  int        `yaml:"maxIdleConns"`
	Concurrent    bool       `yaml:"concurrent"`
	Payloads      []*Payload `yaml:"payloads"`
}

Config is used for configuring SQL generators.

func (*Config) DB

func (c *Config) DB() (*gsql.DB, error)

DB returns a sql DB from a SQL config.

func (*Config) Validate

func (c *Config) Validate() error

Validate is used to validate a SQL configuration.

type Payload

type Payload struct {
	Exec         string         `yaml:"exec,omitempty"`
	Transactions []*Transaction `yaml:"transactions,omitempty"`
}

Payload is used for configuring a SQL payload.

type Transaction

type Transaction struct {
	Query string `yaml:"query,omitempty"`
	Exec  string `yaml:"exec,omitempty"`
}

Transaction is used for configuring a SQL transaction.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL