Versions in this module Expand all Collapse all v1 v1.6.1 Dec 6, 2021 Changes in this version + func AddDelimiter(stmt string) string + func AppendToFile(filePath, contents string) (bytesWritten int, created bool, err error) + func CanParse(input string) (bool, error) + func FileNameForObject(objectName string) string + func HostDefaultDirName(hostname string, port int) string + func MakeTestDirectory(t *testing.T, path string) + func NeedSpecialDelimiter(key tengo.ObjectKey, stmt string) bool + func ParentOptionFiles(dirPath string, baseConfig *mybase.Config) ([]*mybase.File, string, error) + func PathForObject(dirPath, objectName string) string + func ReadTestFile(t *testing.T, filename string) string + func RemoveTestDirectory(t *testing.T, path string) + func RemoveTestFile(t *testing.T, filename string) + func WriteTestFile(t *testing.T, filename, contents string) + type Dir struct + Config *mybase.Config + IgnoredStatements []*Statement + LogicalSchemas []*LogicalSchema + OptionFile *mybase.File + ParseError error + Path string + SQLFiles []SQLFile + func ParseDir(dirPath string, globalConfig *mybase.Config) (*Dir, error) + func (dir *Dir) BaseName() string + func (dir *Dir) CreateOptionFile(optionFile *mybase.File) (err error) + func (dir *Dir) CreateSubdir(name string, optionFile *mybase.File) (*Dir, error) + func (dir *Dir) Delete() error + func (dir *Dir) FirstInstance() (*tengo.Instance, error) + func (dir *Dir) Generator() (major, minor, patch int, edition string) + func (dir *Dir) HasFile(name string) (bool, error) + func (dir *Dir) HasSchema() bool + func (dir *Dir) Hostnames() ([]string, error) + func (dir *Dir) InstanceDefaultParams() (string, error) + func (dir *Dir) Instances() ([]*tengo.Instance, error) + func (dir *Dir) NamedSchemaStatements() []*Statement + func (dir *Dir) RelPath() string + func (dir *Dir) SchemaNames(instance *tengo.Instance) (names []string, err error) + func (dir *Dir) String() string + func (dir *Dir) Subdirs() ([]*Dir, error) + func (dir *Dir) ValidateInstance(instance *tengo.Instance) error + type DuplicateDefinitionError struct + DupeFile string + DupeLine int + FirstFile string + FirstLine int + ObjectKey tengo.ObjectKey + func (dde DuplicateDefinitionError) Error() string + type LogicalSchema struct + Alters []*Statement + CharSet string + Collation string + Creates map[tengo.ObjectKey]*Statement + Name string + func (logicalSchema *LogicalSchema) AddStatement(stmt *Statement) error + type SQLFile struct + Dir string + FileName string + func (sf SQLFile) Create(contents string) error + func (sf SQLFile) Delete() error + func (sf SQLFile) Exists() (bool, error) + func (sf SQLFile) Path() string + func (sf SQLFile) String() string + func (sf SQLFile) Tokenize() (*TokenizedSQLFile, error) + func (sf SQLFile) WriteStatements(statements []*Statement) (int, error) + type Statement struct + CharNo int + DefaultDatabase string + File string + FromFile *TokenizedSQLFile + LineNo int + ObjectName string + ObjectQualifier string + ObjectType tengo.ObjectType + Text string + Type StatementType + func (stmt *Statement) Body() string + func (stmt *Statement) Location() string + func (stmt *Statement) ObjectKey() tengo.ObjectKey + func (stmt *Statement) Remove() + func (stmt *Statement) Schema() string + func (stmt *Statement) SplitTextBody() (body string, suffix string) + type StatementType int + const StatementTypeAlter + const StatementTypeCommand + const StatementTypeCreate + const StatementTypeNoop + const StatementTypeUnknown + type TokenizedSQLFile struct + Statements []*Statement + func NewTokenizedSQLFile(sf SQLFile, statements []*Statement) *TokenizedSQLFile + func (tsf *TokenizedSQLFile) Rewrite() (int, error)