mysql

package
v0.0.0-...-167cc0b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2015 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package mysql provides the underlying connection used by the Database interface, using a MySQL connection.

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL