database

package
v0.0.0-...-f0446e5 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddTrackParams

type AddTrackParams struct {
	ID      string
	Artist  string
	Name    string
	Genre   string
	BPM     float64
	Key     string
	Created time.Time
	Updated time.Time
}

type AddTracklistParams

type AddTracklistParams struct {
	ID      string
	Name    string
	URL     string
	Artwork string
	Date    time.Time
}

type AddTracklistTrackParams

type AddTracklistTrackParams struct {
	ID          string
	TracklistID string
	TrackID     string
	TrackNumber int32
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type GetMostPlayedTracksRow

type GetMostPlayedTracksRow struct {
	Track  Track
	Played int64
}

type GetTrackByArtistAndNameParams

type GetTrackByArtistAndNameParams struct {
	Artist string
	Name   string
}

type GetTrackByArtistAndNameRow

type GetTrackByArtistAndNameRow struct {
	ID      string
	Artist  string
	Name    string
	Genre   string
	BPM     float64
	Key     string
	Created time.Time
	Updated time.Time
}

type GetTrackRow

type GetTrackRow struct {
	ID      string
	Artist  string
	Name    string
	Genre   string
	BPM     float64
	Key     string
	Created time.Time
	Updated time.Time
}

type GetTracklistWithTracksRow

type GetTracklistWithTracksRow struct {
	Tracklist Tracklist
	Track     Track
}

type GetTracklistsByTrackParams

type GetTracklistsByTrackParams struct {
	TrackID string
	Offset  int32
	Limit   int32
}

type GetTracklistsByTrackRow

type GetTracklistsByTrackRow struct {
	Tracklist  Tracklist
	TrackCount int64
}

type GetTracklistsParams

type GetTracklistsParams struct {
	Offset int32
	Limit  int32
}

type GetTracklistsRow

type GetTracklistsRow struct {
	Tracklist  Tracklist
	TrackCount int64
}

type GetTracksByQueryParams

type GetTracksByQueryParams struct {
	Query    string
	RowLimit int32
}

type GetTracksByQueryRow

type GetTracksByQueryRow struct {
	ID                string
	Artist            string
	ArtistHighlighted []byte
	Name              string
	NameHighlighted   []byte
	Genre             string
	BPM               float64
	Key               string
	Created           time.Time
	Updated           time.Time
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddTrack

func (q *Queries) AddTrack(ctx context.Context, arg AddTrackParams) error

func (*Queries) AddTracklist

func (q *Queries) AddTracklist(ctx context.Context, arg AddTracklistParams) (*Tracklist, error)

func (*Queries) AddTracklistTrack

func (q *Queries) AddTracklistTrack(ctx context.Context, arg AddTracklistTrackParams) error

func (*Queries) CountTracklists

func (q *Queries) CountTracklists(ctx context.Context) (int64, error)

func (*Queries) CountTracklistsByTrack

func (q *Queries) CountTracklistsByTrack(ctx context.Context, trackID string) (int64, error)

func (*Queries) GetMostPlayedTracks

func (q *Queries) GetMostPlayedTracks(ctx context.Context, limit int32) ([]*GetMostPlayedTracksRow, error)

func (*Queries) GetTrack

func (q *Queries) GetTrack(ctx context.Context, id string) (*GetTrackRow, error)

func (*Queries) GetTrackByArtistAndName

func (q *Queries) GetTrackByArtistAndName(ctx context.Context, arg GetTrackByArtistAndNameParams) (*GetTrackByArtistAndNameRow, error)

func (*Queries) GetTracklistWithTracks

func (q *Queries) GetTracklistWithTracks(ctx context.Context, id string) ([]*GetTracklistWithTracksRow, error)

func (*Queries) GetTracklists

func (q *Queries) GetTracklists(ctx context.Context, arg GetTracklistsParams) ([]*GetTracklistsRow, error)

func (*Queries) GetTracklistsByTrack

func (q *Queries) GetTracklistsByTrack(ctx context.Context, arg GetTracklistsByTrackParams) ([]*GetTracklistsByTrackRow, error)

func (*Queries) GetTracksByQuery

func (q *Queries) GetTracksByQuery(ctx context.Context, arg GetTracksByQueryParams) ([]*GetTracksByQueryRow, error)

func (*Queries) UpdateTracklist

func (q *Queries) UpdateTracklist(ctx context.Context, arg UpdateTracklistParams) (*Tracklist, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Track

type Track struct {
	ID               string
	Artist           string
	Name             string
	Genre            string
	BPM              float64
	Key              string
	Created          time.Time
	Updated          time.Time
	FtsNameAndArtist string
}

type Tracklist

type Tracklist struct {
	ID      string
	Name    string
	Date    time.Time
	Artwork string
	URL     string
	Created time.Time
	Updated time.Time
}

type UpdateTracklistParams

type UpdateTracklistParams struct {
	ID   string
	Name string
	URL  string
	Date time.Time
}

Jump to

Keyboard shortcuts

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