Documentation ¶ Index ¶ func MigrateTables(db *gorm.DB) error func SetupMySQL(datasource string) (*gorm.DB, error) func SetupSQLite(datasource string) (*gorm.DB, error) type Album type Artist type Genre type TestDB func (t *TestDB) NewConnection() (*gorm.DB, error) func (t *TestDB) Setup() error type Track 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 } Source Files ¶ View all Source files setup.go Click to show internal directories. Click to hide internal directories.