Documentation ¶
Overview ¶
Package mysql provides the underlying connection used by the Database interface, using a MySQL connection.
Index ¶
- type DatabaseConnection
- func (c *DatabaseConnection) Connect() error
- func (c *DatabaseConnection) LoadAllCorporations() ([]*models.Corporation, error)
- func (c *DatabaseConnection) LoadAllIgnoredSolarSystemsForCorporation(corporationID int64) ([]int64, error)
- func (c *DatabaseConnection) LoadCorporation(corporationID int64) (*models.Corporation, error)
- func (c *DatabaseConnection) RawQuery(query string, v ...interface{}) ([]map[string]interface{}, error)
- func (c *DatabaseConnection) SaveCorporation(corporation *models.Corporation) (*models.Corporation, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseConnection ¶
type DatabaseConnection struct { // Config stores the current configuration values being used Config *misc.Configuration // contains filtered or unexported fields }
DatabaseConnection provides an implementation of the Connection interface using a MySQL database
func (*DatabaseConnection) Connect ¶
func (c *DatabaseConnection) Connect() error
Connect tries to establish a connection to the MySQL backend, returning an error if the attempt failed
func (*DatabaseConnection) LoadAllCorporations ¶
func (c *DatabaseConnection) LoadAllCorporations() ([]*models.Corporation, error)
LoadAllCorporations retrieves all corporations from the MySQL database, returning an error if the query failed
func (*DatabaseConnection) LoadAllIgnoredSolarSystemsForCorporation ¶
func (c *DatabaseConnection) LoadAllIgnoredSolarSystemsForCorporation(corporationID int64) ([]int64, error)
LoadAllIgnoredSolarSystemsForCorporation retrieves all ignored solar systems associated with the given corporation from the MySQL database, returning an error if the query failed
func (*DatabaseConnection) LoadCorporation ¶
func (c *DatabaseConnection) LoadCorporation(corporationID int64) (*models.Corporation, error)
LoadCorporation retrieves the corporation with the given ID from the MySQL database, returning an error if the query failed
func (*DatabaseConnection) RawQuery ¶
func (c *DatabaseConnection) RawQuery(query string, v ...interface{}) ([]map[string]interface{}, error)
RawQuery performs a raw MySQL query and returns a map of interfaces containing the retrieve data. An error is returned if the query failed
func (*DatabaseConnection) SaveCorporation ¶
func (c *DatabaseConnection) SaveCorporation(corporation *models.Corporation) (*models.Corporation, error)
SaveCorporation saves a corporation to the database, returning the updated model or an error if the query failed