Documentation ¶
Index ¶
- Constants
- Variables
- func FilterInclExcl(list []string, incl map[string]bool, excl map[string]bool) []string
- type Column
- type Config
- type DbExecutor
- func (e *DbExecutor) Close() error
- func (e *DbExecutor) GetDb() *sql.DB
- func (e *DbExecutor) HasCapability(capability int) bool
- func (e *DbExecutor) Multiple(name string, statements []string) []error
- func (e *DbExecutor) Single(name string, statement string) error
- func (e *DbExecutor) Transaction(name string, statements []string) error
- type Executor
- type FileExecutor
- func (e *FileExecutor) Close() error
- func (e *FileExecutor) GetDb() *sql.DB
- func (e *FileExecutor) HasCapability(capability int) bool
- func (e *FileExecutor) Multiple(name string, statements []string) []error
- func (e *FileExecutor) Single(name string, statement string) error
- func (e *FileExecutor) Transaction(name string, statements []string) error
- type Queryer
- type ReadCloser
- type Reader
- type Table
- type WriteCloser
- type Writer
Constants ¶
View Source
const ( SBegin = "BEGIN" SCommit = "COMMIT" SRollback = "ROLLBACK" )
View Source
const (
CapCopy = iota
)
Variables ¶
View Source
var (
DBEXEC_VERBOSE = true
)
Functions ¶
Types ¶
type Config ¶
type Config struct { Hostname string `yaml:"hostname,omitempty"` Socket string `yaml:"socket,omitempty"` Port int `yaml:"port,omitempty"` Username string `yaml:"username,omitempty"` Password string `yaml:"password,omitempty"` Database string `yaml:"database,omitempty"` Compress bool `yaml:"compress,omitempty"` }
type DbExecutor ¶
type DbExecutor struct {
// contains filtered or unexported fields
}
func NewDbExecutor ¶
func NewDbExecutor(db *sql.DB) (*DbExecutor, error)
func (*DbExecutor) Close ¶
func (e *DbExecutor) Close() error
warning: closes the db connection that was passed to the constructor
func (*DbExecutor) GetDb ¶
func (e *DbExecutor) GetDb() *sql.DB
func (*DbExecutor) HasCapability ¶
func (e *DbExecutor) HasCapability(capability int) bool
func (*DbExecutor) Multiple ¶
func (e *DbExecutor) Multiple(name string, statements []string) []error
func (*DbExecutor) Transaction ¶
func (e *DbExecutor) Transaction(name string, statements []string) error
type Executor ¶
type Executor interface { io.Closer Transaction(name string, statements []string) error Multiple(name string, statements []string) []error Single(name string, statement string) error /* for e.g. PostgreSQL COPY support */ HasCapability(capability int) bool /* will return the underlying sql.DB if it exists, otherwise nil */ GetDb() *sql.DB }
type FileExecutor ¶
type FileExecutor struct {
// contains filtered or unexported fields
}
func NewFileExecutor ¶
func NewFileExecutor(filename string) (*FileExecutor, error)
func (*FileExecutor) Close ¶
func (e *FileExecutor) Close() error
func (*FileExecutor) GetDb ¶
func (e *FileExecutor) GetDb() *sql.DB
func (*FileExecutor) HasCapability ¶
func (e *FileExecutor) HasCapability(capability int) bool
func (*FileExecutor) Multiple ¶
func (e *FileExecutor) Multiple(name string, statements []string) []error
func (*FileExecutor) Transaction ¶
func (e *FileExecutor) Transaction(name string, statements []string) error
type ReadCloser ¶
type Reader ¶
type Reader interface { Queryer TableNames() []string /* FilteredTables() is more performant than Tables() if you * only need a few tables */ Tables() []*Table FilteredTables(incl, excl map[string]bool) []*Table Read(table *Table) (*sql.Rows, error) CreateView(name string, body string) error DropView(name string) error CreateProjection(name string, body string, engine string, pk []string, uks [][]string) error DropProjection(name string) error }
type WriteCloser ¶
Click to show internal directories.
Click to hide internal directories.