database

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sqlx.DB

Functions

func AppSchemaVersion added in v0.2.0

func AppSchemaVersion() uint

func Backup added in v0.2.0

func Backup(backupPath string) error

Backup the database

func DatabaseBackupPath added in v0.2.0

func DatabaseBackupPath() string

func Initialize

func Initialize(databasePath string)

func NeedsMigration added in v0.2.0

func NeedsMigration() bool

Migrate the database

func Reset

func Reset(databasePath string) error

func RestoreFromBackup added in v0.2.0

func RestoreFromBackup(backupPath string) error

func RunMigrations added in v0.2.0

func RunMigrations() error

Migrate the database

func Version added in v0.2.0

func Version() uint

func WithInstance

func WithInstance(instance *Packr2Source) (source.Driver, error)

Types

type Packr2Source

type Packr2Source struct {
	Box        *packr.Box
	Migrations *source.Migrations
}

func (*Packr2Source) Close

func (s *Packr2Source) Close() error

func (*Packr2Source) First

func (s *Packr2Source) First() (version uint, err error)

func (*Packr2Source) Next

func (s *Packr2Source) Next(version uint) (nextVersion uint, err error)

func (*Packr2Source) Open

func (s *Packr2Source) Open(url string) (source.Driver, error)

func (*Packr2Source) Prev

func (s *Packr2Source) Prev(version uint) (prevVersion uint, err error)

func (*Packr2Source) ReadDown

func (s *Packr2Source) ReadDown(version uint) (r io.ReadCloser, identifier string, err error)

func (*Packr2Source) ReadUp

func (s *Packr2Source) ReadUp(version uint) (r io.ReadCloser, identifier string, err error)

Jump to

Keyboard shortcuts

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