Documentation
¶
Index ¶
- type Config
- type Database
- func (db Database) Close()
- func (db Database) ExecuteTransactions(transactions []transaction) error
- func (db Database) NewGamesQuery() *queries.GamesQuery
- func (db Database) NewLanguagesQuery() *queries.LanguagesQuery
- func (db Database) NewPlatformsQuery() *queries.PlatformsQuery
- func (db Database) NewRegionsQuery() *queries.RegionsQuery
- func (db Database) ProvidePlatformData(provider PlatformProvider) error
- type InitialData
- type PlatformProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is a wrapper around Gorm-handled SQLite3 database that exposes methods useful for GameDBV information handling
func NewDatabase ¶
func NewDatabase(cfg Config, initialData InitialData) (Database, error)
NewDatabase attempts to open the database, performing the auto-migration in the process
func OpenDatabase ¶
OpenDatabase attempts to open the database
func (Database) ExecuteTransactions ¶
ExecuteTransactions locks the database in order to execute batch of operations
func (Database) NewGamesQuery ¶
func (db Database) NewGamesQuery() *queries.GamesQuery
NewGamesQuery returns a query used for retrieving games
func (Database) NewLanguagesQuery ¶
func (db Database) NewLanguagesQuery() *queries.LanguagesQuery
NewLanguagesQuery returns a query used for retrieving lanugages
func (Database) NewPlatformsQuery ¶
func (db Database) NewPlatformsQuery() *queries.PlatformsQuery
NewPlatformsQuery returns a query used for retrieving lanugages
func (Database) NewRegionsQuery ¶
func (db Database) NewRegionsQuery() *queries.RegionsQuery
NewRegionsQuery returns a query used for retrieving regions
func (Database) ProvidePlatformData ¶
func (db Database) ProvidePlatformData(provider PlatformProvider) error
ProvidePlatformData takes a provider of platform's new data to be pushed to Database
type InitialData ¶
InitialData is used for population of database with platform-independent information
type PlatformProvider ¶
type PlatformProvider struct { Platform *models.Platform Games []*models.Game Descriptions []*models.GameDescription Languages []*models.Language GameRegions []*models.GameRegion Regions []*models.Region }
PlatformProvider is used for database population of a single platform's data