Documentation
¶
Index ¶
- Variables
- func RunMigrateUp(db *Database) error
- type Album
- type Artist
- type Connection
- type CreateAlbumParams
- type CreateArtistParams
- type CreateTrackParams
- type Database
- func (db *Database) Begin() (*Database, *sql.Tx, error)
- func (db *Database) CreateAlbum(ctx context.Context, params CreateAlbumParams) (Album, error)
- func (db *Database) CreateArtist(ctx context.Context, params CreateArtistParams) (Artist, error)
- func (db *Database) CreateTrack(ctx context.Context, params CreateTrackParams) (Track, error)
- func (db *Database) Exec(ctx context.Context, s ToSQL) (sql.Result, error)
- func (db *Database) GetArtistById(ctx context.Context, id string) (Artist, error)
- func (db *Database) GetArtistByName(ctx context.Context, name string) (Artist, error)
- func (db *Database) Query(ctx context.Context, s ToSQL) (*sql.Rows, error)
- func (db *Database) QueryRow(ctx context.Context, s ToSQL) (*sql.Row, error)
- type ToSQL
- type Track
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrItemNotFound = errors.New("database: item not found")
Functions ¶
func RunMigrateUp ¶
Types ¶
type Artist ¶
type Artist struct {
Id string `json:"id"`
Name string `json:"name"`
Picture sql.NullString `json:"picture"`
}
type Connection ¶
type CreateAlbumParams ¶
type CreateAlbumParams struct {
ArtistId string
Name string
CoverArt sql.NullString
}
type CreateArtistParams ¶
type CreateArtistParams struct {
Name string
Picture sql.NullString
}
type CreateTrackParams ¶
type Database ¶
type Database struct {
RawConn *sql.DB
Conn Connection
}
func (*Database) CreateAlbum ¶
func (*Database) CreateArtist ¶
func (*Database) CreateTrack ¶
func (*Database) GetArtistById ¶
func (*Database) GetArtistByName ¶
Click to show internal directories.
Click to hide internal directories.