Documentation ¶
Index ¶
- func BuildCLIOptions() *cli.App
- func DoCreateDatabase(cfg *config.SQL, defaultDb string, logger log.Logger) error
- func DoDropDatabase(cfg *config.SQL, defaultDb string, logger log.Logger) error
- func RunTool(args []string) error
- func ValidateConnectConfig(cfg *config.SQL) error
- 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) Type() string
- 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.27.0
BuildCLIOptions builds the options for cli
func DoCreateDatabase ¶ added in v1.1.0
func DoDropDatabase ¶ added in v1.1.0
func ValidateConnectConfig ¶ added in v0.27.0
ValidateConnectConfig validates params
Types ¶
type Connection ¶ added in v0.27.0
type Connection struct {
// contains filtered or unexported fields
}
Connection is the connection to database
func NewConnection ¶ added in v0.27.0
NewConnection creates a new connection to database
func (*Connection) Close ¶ added in v0.27.0
func (c *Connection) Close()
Close closes the sql client
func (*Connection) CreateDatabase ¶ added in v0.27.0
func (c *Connection) CreateDatabase(name string) error
CreateDatabase creates a database if it doesn't exist
func (*Connection) CreateSchemaVersionTables ¶ added in v0.27.0
func (c *Connection) CreateSchemaVersionTables() error
CreateSchemaVersionTables sets up the schema version tables
func (*Connection) DropAllTables ¶ added in v0.27.0
func (c *Connection) DropAllTables() error
DropAllTables drops all tables from this database
func (*Connection) DropDatabase ¶ added in v0.27.0
func (c *Connection) DropDatabase(name string) error
DropDatabase drops a database
func (*Connection) DropTable ¶ added in v0.27.0
func (c *Connection) DropTable(name string) error
DropTable drops a given table from the database
func (*Connection) Exec ¶ added in v0.27.0
func (c *Connection) Exec(stmt string, args ...interface{}) error
Exec executes a sql statement
func (*Connection) ListTables ¶ added in v0.27.0
func (c *Connection) ListTables() ([]string, error)
ListTables returns a list of tables in this database
func (*Connection) ReadSchemaVersion ¶ added in v0.27.0
func (c *Connection) ReadSchemaVersion() (string, error)
ReadSchemaVersion returns the current schema version for the keyspace
func (*Connection) Type ¶ added in v1.23.0
func (c *Connection) Type() string
Type gives the type of db
func (*Connection) UpdateSchemaVersion ¶ added in v0.27.0
func (c *Connection) UpdateSchemaVersion(newVersion string, minCompatibleVersion string) error
UpdateSchemaVersion updates the schema version for the keyspace
func (*Connection) WriteSchemaUpdateLog ¶ added in v0.27.0
func (c *Connection) WriteSchemaUpdateLog(oldVersion string, newVersion string, manifestMD5 string, desc string) error
WriteSchemaUpdateLog adds an entry to the schema update history table