test

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateTables

func MigrateTables(db *gorm.DB) error

func SetupMySQL added in v0.2.0

func SetupMySQL(datasource string) (*gorm.DB, error)

func SetupSQLite

func SetupSQLite(datasource string) (*gorm.DB, error)

Types

type Album

type Album struct {
	gorm.Model
	Title    string
	Released bool
}

type Artist

type Artist struct {
	gorm.Model
	Name        string
	Description string
	Tracks      []Track `gorm:"many2many:artist_tracks;"`
}

type Genre

type Genre struct {
	gorm.Model
	Name        string
	Description string
}

type TestDB

type TestDB struct {
	Driver     string
	DataSource string
}

func (*TestDB) NewConnection

func (t *TestDB) NewConnection() (*gorm.DB, error)

func (*TestDB) Setup

func (t *TestDB) Setup() error

type Track

type Track struct {
	gorm.Model
	Title    string
	Duration uint
	AlbumID  uint
	GenreID  uint
	Album    Album
	Genre    Genre
}

Jump to

Keyboard shortcuts

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