Documentation ¶
Index ¶
- type MySQL
- func (m *MySQL) Connect() error
- func (m *MySQL) Connection() *sql.DB
- func (m *MySQL) CreateAndUseDB(name string) error
- func (m *MySQL) CreateDatabase(name string) error
- func (m *MySQL) CreateTable(name string, columns []string) error
- func (m *MySQL) CreateUser(username string, password string) error
- func (m *MySQL) Delete(table string, where string) error
- func (m *MySQL) DescribeTable(name string) (*sql.Rows, error)
- func (m *MySQL) Disconnect() error
- func (m *MySQL) DropDatabase(name string) error
- func (m *MySQL) DropTable(name string) error
- func (m *MySQL) Insert(table string, columns []string, values []string) error
- func (m *MySQL) Ping() error
- func (m *MySQL) Query(query string) (*sql.Rows, error)
- func (m *MySQL) Select(table string, columns []string, where string) (*sql.Rows, error)
- func (m *MySQL) ShowDatabases() (*sql.Rows, error)
- func (m *MySQL) ShowTables() (*sql.Rows, error)
- func (m *MySQL) TruncateTable(name string) error
- func (m *MySQL) Update(table string, columns []string, values []string, where string) error
- func (m *MySQL) UseDatabase(name string) error
- func (m *MySQL) WhereAmI() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQL ¶
type MySQL struct { Host string Port string User string Password string Database string Conn *sql.DB }
MySQL is an implementation of the Database interface
func FromEnvironment ¶
func (*MySQL) Connection ¶
func (*MySQL) CreateAndUseDB ¶
Helper function to create and use a database in one go
func (*MySQL) CreateDatabase ¶
CreateDatabase creates the database
func (*MySQL) CreateTable ¶
CreateTable creates a table in the database
func (*MySQL) Disconnect ¶
Disconnect disconnects from the MySQL database
func (*MySQL) DropDatabase ¶
func (*MySQL) TruncateTable ¶
func (*MySQL) UseDatabase ¶
Click to show internal directories.
Click to hide internal directories.