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 ...any) 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 DoCreateDatabase ¶
func DoDropDatabase ¶
func ValidateConnectConfig ¶
ValidateConnectConfig validates params
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection is the connection to database
func NewConnection ¶
NewConnection creates a new connection to database
func (*Connection) CreateDatabase ¶
func (c *Connection) CreateDatabase(name string) error
CreateDatabase creates a database if it doesn't exist
func (*Connection) CreateSchemaVersionTables ¶
func (c *Connection) CreateSchemaVersionTables() error
CreateSchemaVersionTables sets up the schema version tables
func (*Connection) DropAllTables ¶
func (c *Connection) DropAllTables() error
DropAllTables drops all tables from this database
func (*Connection) DropDatabase ¶
func (c *Connection) DropDatabase(name string) error
DropDatabase drops a database
func (*Connection) DropTable ¶
func (c *Connection) DropTable(name string) error
DropTable drops a given table from the database
func (*Connection) Exec ¶
func (c *Connection) Exec(stmt string, args ...any) error
Exec executes a sql statement
func (*Connection) ListTables ¶
func (c *Connection) ListTables() ([]string, error)
ListTables returns a list of tables in this database
func (*Connection) ReadSchemaVersion ¶
func (c *Connection) ReadSchemaVersion() (string, error)
ReadSchemaVersion returns the current schema version for the keyspace
func (*Connection) UpdateSchemaVersion ¶
func (c *Connection) UpdateSchemaVersion(newVersion string, minCompatibleVersion string) error
UpdateSchemaVersion updates the schema version for the keyspace
func (*Connection) WriteSchemaUpdateLog ¶
func (c *Connection) WriteSchemaUpdateLog(oldVersion string, newVersion string, manifestMD5 string, desc string) error
WriteSchemaUpdateLog adds an entry to the schema update history table