Documentation ¶
Index ¶
- func BuildCLIOptions() *cli.App
- func CheckCompatibleVersion(cfg config.SQL, expectedVersion string) error
- func RunTool(args []string) error
- func ValidateConnectParams(params *ConnectParams, isDryRun bool) error
- func VerifyCompatibleVersion(cfg config.Persistence) error
- type ConnectParams
- type Connection
- func (c *Connection) Close()
- func (c *Connection) CreateDatabase(name string) error
- func (c *Connection) CreateSchemaVersionTables() error
- func (c *Connection) DropAllTables() error
- func (c *Connection) DropDatabase(name string) error
- func (c *Connection) DropTable(name string) error
- func (c *Connection) Exec(stmt string, args ...interface{}) error
- func (c *Connection) ListTables() ([]string, error)
- func (c *Connection) ReadSchemaVersion() (string, error)
- func (c *Connection) UpdateSchemaVersion(newVersion string, minCompatibleVersion string) error
- func (c *Connection) WriteSchemaUpdateLog(oldVersion string, newVersion string, manifestMD5 string, desc string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCLIOptions ¶ added in v0.11.0
BuildCLIOptions builds the options for cli
func CheckCompatibleVersion ¶ added in v0.11.0
CheckCompatibleVersion check the version compatibility
func ValidateConnectParams ¶ added in v0.11.0
func ValidateConnectParams(params *ConnectParams, isDryRun bool) error
ValidateConnectParams validates params
func VerifyCompatibleVersion ¶ added in v0.11.0
func VerifyCompatibleVersion( cfg config.Persistence, ) error
VerifyCompatibleVersion ensures that the installed version of cadence and visibility is greater than or equal to the expected version.
Types ¶
type ConnectParams ¶ added in v0.11.0
type ConnectParams struct { Host string Port int User string Password string Database string PluginName string }
ConnectParams is the connection param
type Connection ¶ added in v0.11.0
type Connection struct {
// contains filtered or unexported fields
}
Connection is the connection to database
func NewConnection ¶ added in v0.11.0
func NewConnection(params *ConnectParams) (*Connection, error)
NewConnection creates a new connection to database
func (*Connection) Close ¶ added in v0.11.0
func (c *Connection) Close()
Close closes the sql client
func (*Connection) CreateDatabase ¶ added in v0.11.0
func (c *Connection) CreateDatabase(name string) error
CreateDatabase creates a database if it doesn't exist
func (*Connection) CreateSchemaVersionTables ¶ added in v0.11.0
func (c *Connection) CreateSchemaVersionTables() error
CreateSchemaVersionTables sets up the schema version tables
func (*Connection) DropAllTables ¶ added in v0.11.0
func (c *Connection) DropAllTables() error
DropAllTables drops all tables from this database
func (*Connection) DropDatabase ¶ added in v0.11.0
func (c *Connection) DropDatabase(name string) error
DropDatabase drops a database
func (*Connection) DropTable ¶ added in v0.11.0
func (c *Connection) DropTable(name string) error
DropTable drops a given table from the database
func (*Connection) Exec ¶ added in v0.11.0
func (c *Connection) Exec(stmt string, args ...interface{}) error
Exec executes a sql statement
func (*Connection) ListTables ¶ added in v0.11.0
func (c *Connection) ListTables() ([]string, error)
ListTables returns a list of tables in this database
func (*Connection) ReadSchemaVersion ¶ added in v0.11.0
func (c *Connection) ReadSchemaVersion() (string, error)
ReadSchemaVersion returns the current schema version for the keyspace
func (*Connection) UpdateSchemaVersion ¶ added in v0.11.0
func (c *Connection) UpdateSchemaVersion(newVersion string, minCompatibleVersion string) error
UpdateSchemaVersion updates the schema version for the keyspace
func (*Connection) WriteSchemaUpdateLog ¶ added in v0.11.0
func (c *Connection) WriteSchemaUpdateLog(oldVersion string, newVersion string, manifestMD5 string, desc string) error
WriteSchemaUpdateLog adds an entry to the schema update history table