Documentation
¶
Overview ¶
This package has database database layer. Never deal with DDL construction.
Index ¶
- func ConcurrentMapFuncWithError[Tin any, Tout any](inputs []Tin, concurrency int, f func(Tin) (Tout, error)) ([]Tout, error)
- func RunDDLs(d Database, ddls []string, enableDropTable bool, beforeApply string, ...) error
- func TransactionSupported(ddl string) bool
- type Config
- type DDLStatement
- type Database
- type GeneratorConfig
- type GenericParser
- type Parser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcurrentMapFuncWithError ¶ added in v0.17.19
func TransactionSupported ¶
Types ¶
type DDLStatement ¶
A tuple of an original DDL and a Statement
type Database ¶
type Database interface {
DumpDDLs() (string, error)
DB() *sql.DB
Close() error
GetDefaultSchema() string
}
Abstraction layer for multiple kinds of databases
type GeneratorConfig ¶
type GeneratorConfig struct {
TargetTables []string
SkipTables []string
TargetSchema []string
Algorithm string
Lock string
DumpConcurrency int
}
func ParseGeneratorConfig ¶
func ParseGeneratorConfig(configFile string) GeneratorConfig
type GenericParser ¶
type GenericParser struct {
// contains filtered or unexported fields
}
func NewParser ¶
func NewParser(mode parser.ParserMode) GenericParser
func (GenericParser) Parse ¶
func (p GenericParser) Parse(sql string) ([]DDLStatement, error)
type Parser ¶
type Parser interface {
Parse(sql string) ([]DDLStatement, error)
}
Click to show internal directories.
Click to hide internal directories.