store

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Migrations Migrations
	Unittests  Unittests
	// contains filtered or unexported fields
}

Context defines the global database context with access to all database available tables and operations.

func Open

func Open(driver, source string) (*Context, error)

Open initializes the context and creates a database connection.

func (*Context) Close

func (r *Context) Close() error

Close terminates the connection to the database and closes context.

func (*Context) GetDBMap

func (r *Context) GetDBMap() *gorp.DbMap

GetDBMap returns the global connection database object.

type Migrations

type Migrations struct {
	// contains filtered or unexported fields
}

Migrations defines a wrapper struct for all of the migrations table operations.

func (Migrations) CreateTableIfNotExists

func (r Migrations) CreateTableIfNotExists() error

CreateTableIfNotExists create migrations table if one does not exist.

func (Migrations) Delete

func (r Migrations) Delete(migrations ...interface{}) error

Delete instructs a migration record to be deleted from the database.

func (Migrations) DropTablesIfExists

func (r Migrations) DropTablesIfExists() error

DropTablesIfExists drops a table from the database if already exists.

func (Migrations) GetDBMap

func (r Migrations) GetDBMap() *gorp.DbMap

GetDBMap returns the underlying migrations table database model object.

func (Migrations) GetMigrations

func (r Migrations) GetMigrations() ([]dao.Migration, error)

GetMigrations returns database migration records.

func (Migrations) GetMigrationsSorted

func (r Migrations) GetMigrationsSorted() (dao.Migrations, error)

GetMigrationsSorted returns sorted database migration records.

func (Migrations) Insert

func (r Migrations) Insert(migrations ...interface{}) error

Insert adds a migration record to the database.

type Unittests

type Unittests struct {
	// contains filtered or unexported fields
}

Unittests defines a set of operations for the unittests table.

func (Unittests) GetDBMap

func (r Unittests) GetDBMap() *gorp.DbMap

GetDBMap returns the underlying unittests table database model object.

func (Unittests) GetUnittests

func (r Unittests) GetUnittests() ([]dao.Unittest, error)

GetUnittests returns database unittest records.

Jump to

Keyboard shortcuts

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