repository

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	ID        int32
	Key       string
	UserID    int32
	CreatedAt pgtype.Timestamp
	Label     string
}

type Artist

type Artist struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
}

type ArtistAlias

type ArtistAlias struct {
	ArtistID  int32
	Alias     string
	Source    string
	IsPrimary bool
}

type ArtistRelease

type ArtistRelease struct {
	ArtistID  int32
	ReleaseID int32
	IsPrimary bool
}

type ArtistTrack

type ArtistTrack struct {
	ArtistID  int32
	TrackID   int32
	IsPrimary bool
}

type ArtistsOnlyPlayedOnceInYearParams added in v0.0.13

type ArtistsOnlyPlayedOnceInYearParams struct {
	Year   int32
	UserID int32
}

type ArtistsOnlyPlayedOnceInYearRow added in v0.0.13

type ArtistsOnlyPlayedOnceInYearRow struct {
	ArtistID    int32
	Name        string
	ListenCount int64
}

type ArtistsWithName

type ArtistsWithName struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
	Name          string
}

type AssociateArtistToReleaseParams

type AssociateArtistToReleaseParams struct {
	ArtistID  int32
	ReleaseID int32
}

type AssociateArtistToTrackParams

type AssociateArtistToTrackParams struct {
	ArtistID int32
	TrackID  int32
}

type CountListensFromArtistParams

type CountListensFromArtistParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	ArtistID     int32
}

type CountListensFromReleaseParams

type CountListensFromReleaseParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	ReleaseID    int32
}

type CountListensFromTrackParams

type CountListensFromTrackParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	TrackID      int32
}

type CountListensParams

type CountListensParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
}

type CountTimeListenedParams

type CountTimeListenedParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
}

type CountTimeListenedToArtistParams

type CountTimeListenedToArtistParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	ArtistID     int32
}

type CountTimeListenedToReleaseParams

type CountTimeListenedToReleaseParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	ReleaseID    int32
}

type CountTimeListenedToTrackParams

type CountTimeListenedToTrackParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	ID           int32
}

type CountTopArtistsParams

type CountTopArtistsParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
}

type CountTopReleasesParams

type CountTopReleasesParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
}

type CountTopTracksByArtistParams

type CountTopTracksByArtistParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	ArtistID     int32
}

type CountTopTracksByReleaseParams

type CountTopTracksByReleaseParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	ReleaseID    int32
}

type CountTopTracksParams

type CountTopTracksParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
}

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 DeleteArtistAliasParams

type DeleteArtistAliasParams struct {
	ArtistID int32
	Alias    string
}

type DeleteConflictingArtistReleasesParams

type DeleteConflictingArtistReleasesParams struct {
	ArtistID   int32
	ArtistID_2 int32
}

type DeleteConflictingArtistTracksParams

type DeleteConflictingArtistTracksParams struct {
	ArtistID   int32
	ArtistID_2 int32
}

type DeleteListenParams

type DeleteListenParams struct {
	TrackID    int32
	ListenedAt time.Time
}

type DeleteReleaseAliasParams

type DeleteReleaseAliasParams struct {
	ReleaseID int32
	Alias     string
}

type DeleteTrackAliasParams

type DeleteTrackAliasParams struct {
	TrackID int32
	Alias   string
}

type GetArtistByMbzIDRow

type GetArtistByMbzIDRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
	Name          string
	Aliases       []string
}

type GetArtistByNameRow

type GetArtistByNameRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
	Name          string
	Aliases       []string
}

type GetArtistCountInYearParams added in v0.0.13

type GetArtistCountInYearParams struct {
	UserID int32
	Year   int32
}

type GetArtistRow

type GetArtistRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
	Name          string
	Aliases       []string
}

type GetArtistWithLongestGapInYearParams added in v0.0.13

type GetArtistWithLongestGapInYearParams struct {
	Year           int32
	FirstDayOfYear pgtype.Date
}

type GetArtistWithLongestGapInYearRow added in v0.0.13

type GetArtistWithLongestGapInYearRow struct {
	UserID            int32
	ArtistID          int32
	ArtistName        string
	LastListen        interface{}
	FirstListenOfYear interface{}
	GapDays           int32
}

type GetArtistsWithOnlyOnePlayInYearRow added in v0.0.13

type GetArtistsWithOnlyOnePlayInYearRow struct {
	UserID           int32
	ArtistID         int32
	FirstListen      interface{}
	Name             string
	TotalPlaysInYear int64
}

type GetFirstListenInYearRow added in v0.0.13

type GetFirstListenInYearRow struct {
	TrackID       int32
	ListenedAt    time.Time
	Client        *string
	UserID        int32
	ID            pgtype.Int4
	MusicBrainzID *uuid.UUID
	Duration      pgtype.Int4
	ReleaseID     pgtype.Int4
	Title         pgtype.Text
	Artists       []byte
}

type GetLastListensFromArtistPaginatedParams

type GetLastListensFromArtistPaginatedParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	Limit        int32
	Offset       int32
	ArtistID     int32
}

type GetLastListensFromArtistPaginatedRow

type GetLastListensFromArtistPaginatedRow struct {
	TrackID    int32
	ListenedAt time.Time
	Client     *string
	UserID     int32
	TrackTitle string
	ReleaseID  int32
	Artists    []byte
}

type GetLastListensFromReleasePaginatedParams

type GetLastListensFromReleasePaginatedParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	Limit        int32
	Offset       int32
	ReleaseID    int32
}

type GetLastListensFromReleasePaginatedRow

type GetLastListensFromReleasePaginatedRow struct {
	TrackID    int32
	ListenedAt time.Time
	Client     *string
	UserID     int32
	TrackTitle string
	ReleaseID  int32
	Artists    []byte
}

type GetLastListensFromTrackPaginatedParams

type GetLastListensFromTrackPaginatedParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	Limit        int32
	Offset       int32
	ID           int32
}

type GetLastListensFromTrackPaginatedRow

type GetLastListensFromTrackPaginatedRow struct {
	TrackID    int32
	ListenedAt time.Time
	Client     *string
	UserID     int32
	TrackTitle string
	ReleaseID  int32
	Artists    []byte
}

type GetLastListensPaginatedParams

type GetLastListensPaginatedParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	Limit        int32
	Offset       int32
}

type GetLastListensPaginatedRow

type GetLastListensPaginatedRow struct {
	TrackID    int32
	ListenedAt time.Time
	Client     *string
	UserID     int32
	TrackTitle string
	ReleaseID  int32
	Artists    []byte
}

type GetListenPercentageInTimeWindowInYearParams added in v0.0.13

type GetListenPercentageInTimeWindowInYearParams struct {
	UserID          int32
	Year            int32
	HourWindowStart int32
	HourWindowEnd   int32
}

type GetListenPercentageInTimeWindowInYearRow added in v0.0.13

type GetListenPercentageInTimeWindowInYearRow struct {
	InWindow       int64
	TotalListens   int64
	PercentOfTotal pgtype.Numeric
}

type GetListensExportPageParams added in v0.0.10

type GetListensExportPageParams struct {
	Limit      int32
	UserID     int32
	ListenedAt time.Time
	TrackID    int32
}

type GetListensExportPageRow added in v0.0.10

type GetListensExportPageRow struct {
	ListenedAt         time.Time
	UserID             int32
	Client             *string
	TrackID            int32
	TrackMbid          *uuid.UUID
	TrackDuration      int32
	TrackAliases       []byte
	ReleaseID          int32
	ReleaseMbid        *uuid.UUID
	ReleaseImage       *uuid.UUID
	ReleaseImageSource pgtype.Text
	VariousArtists     bool
	ReleaseAliases     []byte
	Artists            []byte
}

type GetMostReplayedTrackInYearParams added in v0.0.13

type GetMostReplayedTrackInYearParams struct {
	UserID int32
	Year   int32
}

type GetMostReplayedTrackInYearRow added in v0.0.13

type GetMostReplayedTrackInYearRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Duration      int32
	ReleaseID     int32
	Title         string
	Artists       []byte
	StreakLength  int64
}

type GetPercentageOfTotalListensFromTopArtistsInYearParams added in v0.0.13

type GetPercentageOfTotalListensFromTopArtistsInYearParams struct {
	Limit  int32
	UserID int32
	Year   int32
}

type GetPercentageOfTotalListensFromTopArtistsInYearRow added in v0.0.13

type GetPercentageOfTotalListensFromTopArtistsInYearRow struct {
	TopArtistTotal int64
	OverallTotal   int64
	PercentOfTotal pgtype.Numeric
}

type GetPercentageOfTotalListensFromTopTracksInYearParams added in v0.0.13

type GetPercentageOfTotalListensFromTopTracksInYearParams struct {
	Limit  int32
	UserID int32
	Year   int32
}

type GetPercentageOfTotalListensFromTopTracksInYearRow added in v0.0.13

type GetPercentageOfTotalListensFromTopTracksInYearRow struct {
	TopTracksTotal int64
	OverallTotal   int64
	PercentOfTotal pgtype.Numeric
}

type GetReleaseArtistsRow added in v0.0.8

type GetReleaseArtistsRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
	Name          string
	IsPrimary     pgtype.Bool
}

type GetReleaseByArtistAndTitleParams

type GetReleaseByArtistAndTitleParams struct {
	Title    string
	ArtistID int32
}

type GetReleaseByArtistAndTitlesParams

type GetReleaseByArtistAndTitlesParams struct {
	Column1  []string
	ArtistID int32
}

type GetReleaseRow added in v0.0.13

type GetReleaseRow struct {
	ID             int32
	MusicBrainzID  *uuid.UUID
	Image          *uuid.UUID
	VariousArtists bool
	ImageSource    pgtype.Text
	Title          string
	Artists        []byte
}

type GetReleasesWithoutImagesParams

type GetReleasesWithoutImagesParams struct {
	Limit int32
	ID    int32
}

type GetReleasesWithoutImagesRow

type GetReleasesWithoutImagesRow struct {
	ID             int32
	MusicBrainzID  *uuid.UUID
	Image          *uuid.UUID
	VariousArtists bool
	ImageSource    pgtype.Text
	Title          string
	Artists        []byte
}

type GetTopArtistsPaginatedParams

type GetTopArtistsPaginatedParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	Limit        int32
	Offset       int32
}

type GetTopArtistsPaginatedRow

type GetTopArtistsPaginatedRow struct {
	ID            int32
	Name          string
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ListenCount   int64
}

type GetTopReleasesFromArtistParams

type GetTopReleasesFromArtistParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	Limit        int32
	Offset       int32
	ArtistID     int32
}

type GetTopReleasesFromArtistRow

type GetTopReleasesFromArtistRow struct {
	ID             int32
	MusicBrainzID  *uuid.UUID
	Image          *uuid.UUID
	VariousArtists bool
	ImageSource    pgtype.Text
	Title          string
	ListenCount    int64
	Artists        []byte
}

type GetTopReleasesPaginatedParams

type GetTopReleasesPaginatedParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	Limit        int32
	Offset       int32
}

type GetTopReleasesPaginatedRow

type GetTopReleasesPaginatedRow struct {
	ID             int32
	MusicBrainzID  *uuid.UUID
	Image          *uuid.UUID
	VariousArtists bool
	ImageSource    pgtype.Text
	Title          string
	ListenCount    int64
	Artists        []byte
}

type GetTopTracksByArtistPaginatedParams

type GetTopTracksByArtistPaginatedParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	Limit        int32
	Offset       int32
	ArtistID     int32
}

type GetTopTracksByArtistPaginatedRow

type GetTopTracksByArtistPaginatedRow struct {
	ID            int32
	Title         string
	MusicBrainzID *uuid.UUID
	ReleaseID     int32
	Image         *uuid.UUID
	ListenCount   int64
	Artists       []byte
}

type GetTopTracksInReleasePaginatedParams

type GetTopTracksInReleasePaginatedParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	Limit        int32
	Offset       int32
	ReleaseID    int32
}

type GetTopTracksInReleasePaginatedRow

type GetTopTracksInReleasePaginatedRow struct {
	ID            int32
	Title         string
	MusicBrainzID *uuid.UUID
	ReleaseID     int32
	Image         *uuid.UUID
	ListenCount   int64
	Artists       []byte
}

type GetTopTracksPaginatedParams

type GetTopTracksPaginatedParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	Limit        int32
	Offset       int32
}

type GetTopTracksPaginatedRow

type GetTopTracksPaginatedRow struct {
	ID            int32
	Title         string
	MusicBrainzID *uuid.UUID
	ReleaseID     int32
	Image         *uuid.UUID
	ListenCount   int64
	Artists       []byte
}

type GetTrackArtistsRow added in v0.0.8

type GetTrackArtistsRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
	Name          string
	IsPrimary     pgtype.Bool
}

type GetTrackByTitleAndArtistsParams

type GetTrackByTitleAndArtistsParams struct {
	Title   string
	Column2 []int32
}

type GetTrackRow

type GetTrackRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Duration      int32
	ReleaseID     int32
	Title         string
	Artists       []byte
	Image         *uuid.UUID
}

type GetTracksPlayedAtLeastOncePerMonthInYearRow added in v0.0.13

type GetTracksPlayedAtLeastOncePerMonthInYearRow struct {
	TrackID int32
	Title   string
}

type GetUserBySessionRow

type GetUserBySessionRow struct {
	ID         int32
	Username   string
	Role       Role
	Password   []byte
	ID_2       uuid.UUID
	UserID     int32
	CreatedAt  time.Time
	ExpiresAt  time.Time
	Persistent bool
}

type GetWeekWithMostListensInYearParams added in v0.0.13

type GetWeekWithMostListensInYearParams struct {
	Year   int32
	UserID int32
}

type GetWeekWithMostListensInYearRow added in v0.0.13

type GetWeekWithMostListensInYearRow struct {
	WeekStart   int32
	ListenCount int64
}

type InsertApiKeyParams

type InsertApiKeyParams struct {
	UserID int32
	Key    string
	Label  string
}

type InsertArtistAliasParams

type InsertArtistAliasParams struct {
	ArtistID  int32
	Alias     string
	Source    string
	IsPrimary bool
}

type InsertArtistParams

type InsertArtistParams struct {
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
}

type InsertListenParams

type InsertListenParams struct {
	TrackID    int32
	ListenedAt time.Time
	UserID     int32
	Client     *string
}

type InsertReleaseAliasParams

type InsertReleaseAliasParams struct {
	ReleaseID int32
	Alias     string
	Source    string
	IsPrimary bool
}

type InsertReleaseParams

type InsertReleaseParams struct {
	MusicBrainzID  *uuid.UUID
	VariousArtists bool
	Image          *uuid.UUID
	ImageSource    pgtype.Text
}

type InsertSessionParams

type InsertSessionParams struct {
	ID         uuid.UUID
	UserID     int32
	ExpiresAt  time.Time
	Persistent bool
}

type InsertTrackAliasParams

type InsertTrackAliasParams struct {
	TrackID   int32
	Alias     string
	Source    string
	IsPrimary bool
}

type InsertTrackParams

type InsertTrackParams struct {
	MusicBrainzID *uuid.UUID
	ReleaseID     int32
	Duration      int32
}

type InsertUserParams

type InsertUserParams struct {
	Username string
	Password []byte
	Role     Role
}

type Listen

type Listen struct {
	TrackID    int32
	ListenedAt time.Time
	Client     *string
	UserID     int32
}

type ListenActivityForArtistParams

type ListenActivityForArtistParams struct {
	Column1  time.Time
	Column2  time.Time
	Column3  pgtype.Interval
	ArtistID int32
}

type ListenActivityForArtistRow

type ListenActivityForArtistRow struct {
	BucketStart time.Time
	ListenCount int64
}

type ListenActivityForReleaseParams

type ListenActivityForReleaseParams struct {
	Column1   time.Time
	Column2   time.Time
	Column3   pgtype.Interval
	ReleaseID int32
}

type ListenActivityForReleaseRow

type ListenActivityForReleaseRow struct {
	BucketStart time.Time
	ListenCount int64
}

type ListenActivityForTrackParams

type ListenActivityForTrackParams struct {
	Column1 time.Time
	Column2 time.Time
	Column3 pgtype.Interval
	ID      int32
}

type ListenActivityForTrackRow

type ListenActivityForTrackRow struct {
	BucketStart time.Time
	ListenCount int64
}

type ListenActivityParams

type ListenActivityParams struct {
	Column1 time.Time
	Column2 time.Time
	Column3 pgtype.Interval
}

type ListenActivityRow

type ListenActivityRow struct {
	BucketStart time.Time
	ListenCount int64
}

type NullRole

type NullRole struct {
	Role  Role
	Valid bool // Valid is true if Role is not NULL
}

func (*NullRole) Scan

func (ns *NullRole) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRole) Value

func (ns NullRole) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ArtistsOnlyPlayedOnceInYear added in v0.0.13

func (q *Queries) ArtistsOnlyPlayedOnceInYear(ctx context.Context, arg ArtistsOnlyPlayedOnceInYearParams) ([]ArtistsOnlyPlayedOnceInYearRow, error)

func (*Queries) AssociateArtistToRelease

func (q *Queries) AssociateArtistToRelease(ctx context.Context, arg AssociateArtistToReleaseParams) error

func (*Queries) AssociateArtistToTrack

func (q *Queries) AssociateArtistToTrack(ctx context.Context, arg AssociateArtistToTrackParams) error

func (*Queries) CleanOrphanedEntries

func (q *Queries) CleanOrphanedEntries(ctx context.Context) error

DELETE FROM releases WHERE release_group_id NOT IN (SELECT t.release_group_id FROM tracks t); DELETE FROM releases WHERE release_group_id NOT IN (SELECT rg.id FROM release_groups rg);

func (*Queries) CountApiKeys

func (q *Queries) CountApiKeys(ctx context.Context, userID int32) (int64, error)

func (*Queries) CountListens

func (q *Queries) CountListens(ctx context.Context, arg CountListensParams) (int64, error)

func (*Queries) CountListensFromArtist

func (q *Queries) CountListensFromArtist(ctx context.Context, arg CountListensFromArtistParams) (int64, error)

func (*Queries) CountListensFromRelease

func (q *Queries) CountListensFromRelease(ctx context.Context, arg CountListensFromReleaseParams) (int64, error)

func (*Queries) CountListensFromTrack

func (q *Queries) CountListensFromTrack(ctx context.Context, arg CountListensFromTrackParams) (int64, error)

func (*Queries) CountReleasesFromArtist

func (q *Queries) CountReleasesFromArtist(ctx context.Context, artistID int32) (int64, error)

func (*Queries) CountTimeListened

func (q *Queries) CountTimeListened(ctx context.Context, arg CountTimeListenedParams) (int64, error)

func (*Queries) CountTimeListenedToArtist

func (q *Queries) CountTimeListenedToArtist(ctx context.Context, arg CountTimeListenedToArtistParams) (int64, error)

func (*Queries) CountTimeListenedToRelease

func (q *Queries) CountTimeListenedToRelease(ctx context.Context, arg CountTimeListenedToReleaseParams) (int64, error)

func (*Queries) CountTimeListenedToTrack

func (q *Queries) CountTimeListenedToTrack(ctx context.Context, arg CountTimeListenedToTrackParams) (int64, error)

func (*Queries) CountTopArtists

func (q *Queries) CountTopArtists(ctx context.Context, arg CountTopArtistsParams) (int64, error)

func (*Queries) CountTopReleases

func (q *Queries) CountTopReleases(ctx context.Context, arg CountTopReleasesParams) (int64, error)

func (*Queries) CountTopTracks

func (q *Queries) CountTopTracks(ctx context.Context, arg CountTopTracksParams) (int64, error)

func (*Queries) CountTopTracksByArtist

func (q *Queries) CountTopTracksByArtist(ctx context.Context, arg CountTopTracksByArtistParams) (int64, error)

func (*Queries) CountTopTracksByRelease

func (q *Queries) CountTopTracksByRelease(ctx context.Context, arg CountTopTracksByReleaseParams) (int64, error)

func (*Queries) CountUsers

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

func (*Queries) DeleteApiKey

func (q *Queries) DeleteApiKey(ctx context.Context, id int32) error

func (*Queries) DeleteArtist

func (q *Queries) DeleteArtist(ctx context.Context, id int32) error

func (*Queries) DeleteArtistAlias

func (q *Queries) DeleteArtistAlias(ctx context.Context, arg DeleteArtistAliasParams) error

func (*Queries) DeleteConflictingArtistReleases

func (q *Queries) DeleteConflictingArtistReleases(ctx context.Context, arg DeleteConflictingArtistReleasesParams) error

func (*Queries) DeleteConflictingArtistTracks

func (q *Queries) DeleteConflictingArtistTracks(ctx context.Context, arg DeleteConflictingArtistTracksParams) error

func (*Queries) DeleteListen

func (q *Queries) DeleteListen(ctx context.Context, arg DeleteListenParams) error

func (*Queries) DeleteRelease

func (q *Queries) DeleteRelease(ctx context.Context, id int32) error

func (*Queries) DeleteReleaseAlias

func (q *Queries) DeleteReleaseAlias(ctx context.Context, arg DeleteReleaseAliasParams) error

func (*Queries) DeleteReleasesFromArtist

func (q *Queries) DeleteReleasesFromArtist(ctx context.Context, artistID int32) error

func (*Queries) DeleteSession

func (q *Queries) DeleteSession(ctx context.Context, id uuid.UUID) error

func (*Queries) DeleteTrack

func (q *Queries) DeleteTrack(ctx context.Context, id int32) error

func (*Queries) DeleteTrackAlias

func (q *Queries) DeleteTrackAlias(ctx context.Context, arg DeleteTrackAliasParams) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id int32) error

func (*Queries) GetAllApiKeysByUserID

func (q *Queries) GetAllApiKeysByUserID(ctx context.Context, id int32) ([]ApiKey, error)

func (*Queries) GetAllArtistAliases

func (q *Queries) GetAllArtistAliases(ctx context.Context, artistID int32) ([]ArtistAlias, error)

func (*Queries) GetAllReleaseAliases

func (q *Queries) GetAllReleaseAliases(ctx context.Context, releaseID int32) ([]ReleaseAlias, error)

func (*Queries) GetAllTrackAliases

func (q *Queries) GetAllTrackAliases(ctx context.Context, trackID int32) ([]TrackAlias, error)

func (*Queries) GetAllTracksFromArtist

func (q *Queries) GetAllTracksFromArtist(ctx context.Context, artistID int32) ([]TracksWithTitle, error)

func (*Queries) GetArtist

func (q *Queries) GetArtist(ctx context.Context, id int32) (GetArtistRow, error)

func (*Queries) GetArtistAlias

func (q *Queries) GetArtistAlias(ctx context.Context, alias string) (ArtistAlias, error)

func (*Queries) GetArtistByImage

func (q *Queries) GetArtistByImage(ctx context.Context, image *uuid.UUID) (Artist, error)

func (*Queries) GetArtistByMbzID

func (q *Queries) GetArtistByMbzID(ctx context.Context, musicbrainzID *uuid.UUID) (GetArtistByMbzIDRow, error)

func (*Queries) GetArtistByName

func (q *Queries) GetArtistByName(ctx context.Context, alias string) (GetArtistByNameRow, error)

func (*Queries) GetArtistCountInYear added in v0.0.13

func (q *Queries) GetArtistCountInYear(ctx context.Context, arg GetArtistCountInYearParams) (int64, error)

func (*Queries) GetArtistWithLongestGapInYear added in v0.0.13

func (*Queries) GetArtistsWithOnlyOnePlayInYear added in v0.0.13

func (q *Queries) GetArtistsWithOnlyOnePlayInYear(ctx context.Context) ([]GetArtistsWithOnlyOnePlayInYearRow, error)

func (*Queries) GetFirstListenInYear added in v0.0.13

func (q *Queries) GetFirstListenInYear(ctx context.Context) (GetFirstListenInYearRow, error)

func (*Queries) GetLastListensPaginated

func (q *Queries) GetLastListensPaginated(ctx context.Context, arg GetLastListensPaginatedParams) ([]GetLastListensPaginatedRow, error)

func (*Queries) GetListenPercentageInTimeWindowInYear added in v0.0.13

func (*Queries) GetListensExportPage added in v0.0.10

func (q *Queries) GetListensExportPage(ctx context.Context, arg GetListensExportPageParams) ([]GetListensExportPageRow, error)

func (*Queries) GetMostReplayedTrackInYear added in v0.0.13

func (*Queries) GetRelease

func (q *Queries) GetRelease(ctx context.Context, id int32) (GetReleaseRow, error)

func (*Queries) GetReleaseAlias

func (q *Queries) GetReleaseAlias(ctx context.Context, alias string) (ReleaseAlias, error)

func (*Queries) GetReleaseArtists

func (q *Queries) GetReleaseArtists(ctx context.Context, releaseID int32) ([]GetReleaseArtistsRow, error)

func (*Queries) GetReleaseByArtistAndTitle

func (q *Queries) GetReleaseByArtistAndTitle(ctx context.Context, arg GetReleaseByArtistAndTitleParams) (ReleasesWithTitle, error)

func (*Queries) GetReleaseByArtistAndTitles

func (q *Queries) GetReleaseByArtistAndTitles(ctx context.Context, arg GetReleaseByArtistAndTitlesParams) (ReleasesWithTitle, error)

func (*Queries) GetReleaseByImageID

func (q *Queries) GetReleaseByImageID(ctx context.Context, image *uuid.UUID) (Release, error)

func (*Queries) GetReleaseByMbzID

func (q *Queries) GetReleaseByMbzID(ctx context.Context, musicbrainzID *uuid.UUID) (ReleasesWithTitle, error)

func (*Queries) GetReleasesWithoutImages

func (q *Queries) GetReleasesWithoutImages(ctx context.Context, arg GetReleasesWithoutImagesParams) ([]GetReleasesWithoutImagesRow, error)

func (*Queries) GetSession

func (q *Queries) GetSession(ctx context.Context, id uuid.UUID) (Session, error)

func (*Queries) GetTopArtistsPaginated

func (q *Queries) GetTopArtistsPaginated(ctx context.Context, arg GetTopArtistsPaginatedParams) ([]GetTopArtistsPaginatedRow, error)

func (*Queries) GetTopReleasesFromArtist

func (q *Queries) GetTopReleasesFromArtist(ctx context.Context, arg GetTopReleasesFromArtistParams) ([]GetTopReleasesFromArtistRow, error)

func (*Queries) GetTopReleasesPaginated

func (q *Queries) GetTopReleasesPaginated(ctx context.Context, arg GetTopReleasesPaginatedParams) ([]GetTopReleasesPaginatedRow, error)

func (*Queries) GetTopTracksPaginated

func (q *Queries) GetTopTracksPaginated(ctx context.Context, arg GetTopTracksPaginatedParams) ([]GetTopTracksPaginatedRow, error)

func (*Queries) GetTrack

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

func (*Queries) GetTrackAlias

func (q *Queries) GetTrackAlias(ctx context.Context, alias string) (TrackAlias, error)

func (*Queries) GetTrackArtists

func (q *Queries) GetTrackArtists(ctx context.Context, trackID int32) ([]GetTrackArtistsRow, error)

func (*Queries) GetTrackByMbzID

func (q *Queries) GetTrackByMbzID(ctx context.Context, musicbrainzID *uuid.UUID) (TracksWithTitle, error)

func (*Queries) GetTrackByTitleAndArtists

func (q *Queries) GetTrackByTitleAndArtists(ctx context.Context, arg GetTrackByTitleAndArtistsParams) (TracksWithTitle, error)

func (*Queries) GetTracksPlayedAtLeastOncePerMonthInYear added in v0.0.13

func (q *Queries) GetTracksPlayedAtLeastOncePerMonthInYear(ctx context.Context, userID int32) ([]GetTracksPlayedAtLeastOncePerMonthInYearRow, error)

func (*Queries) GetUserByApiKey

func (q *Queries) GetUserByApiKey(ctx context.Context, key string) (User, error)

func (*Queries) GetUserBySession

func (q *Queries) GetUserBySession(ctx context.Context, id uuid.UUID) (GetUserBySessionRow, error)

func (*Queries) GetUserByUsername

func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error)

func (*Queries) GetWeekWithMostListensInYear added in v0.0.13

func (*Queries) InsertApiKey

func (q *Queries) InsertApiKey(ctx context.Context, arg InsertApiKeyParams) (ApiKey, error)

func (*Queries) InsertArtist

func (q *Queries) InsertArtist(ctx context.Context, arg InsertArtistParams) (Artist, error)

func (*Queries) InsertArtistAlias

func (q *Queries) InsertArtistAlias(ctx context.Context, arg InsertArtistAliasParams) error

func (*Queries) InsertListen

func (q *Queries) InsertListen(ctx context.Context, arg InsertListenParams) error

func (*Queries) InsertRelease

func (q *Queries) InsertRelease(ctx context.Context, arg InsertReleaseParams) (Release, error)

func (*Queries) InsertReleaseAlias

func (q *Queries) InsertReleaseAlias(ctx context.Context, arg InsertReleaseAliasParams) error

func (*Queries) InsertSession

func (q *Queries) InsertSession(ctx context.Context, arg InsertSessionParams) (Session, error)

func (*Queries) InsertTrack

func (q *Queries) InsertTrack(ctx context.Context, arg InsertTrackParams) (Track, error)

func (*Queries) InsertTrackAlias

func (q *Queries) InsertTrackAlias(ctx context.Context, arg InsertTrackAliasParams) error

func (*Queries) InsertUser

func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) (User, error)

func (*Queries) ListenActivity

func (q *Queries) ListenActivity(ctx context.Context, arg ListenActivityParams) ([]ListenActivityRow, error)

func (*Queries) ListenActivityForArtist

func (q *Queries) ListenActivityForArtist(ctx context.Context, arg ListenActivityForArtistParams) ([]ListenActivityForArtistRow, error)

func (*Queries) ListenActivityForRelease

func (q *Queries) ListenActivityForRelease(ctx context.Context, arg ListenActivityForReleaseParams) ([]ListenActivityForReleaseRow, error)

func (*Queries) ListenActivityForTrack

func (q *Queries) ListenActivityForTrack(ctx context.Context, arg ListenActivityForTrackParams) ([]ListenActivityForTrackRow, error)

func (*Queries) SearchArtists

func (q *Queries) SearchArtists(ctx context.Context, arg SearchArtistsParams) ([]SearchArtistsRow, error)

func (*Queries) SearchArtistsBySubstring

func (q *Queries) SearchArtistsBySubstring(ctx context.Context, arg SearchArtistsBySubstringParams) ([]SearchArtistsBySubstringRow, error)

func (*Queries) SearchReleases

func (q *Queries) SearchReleases(ctx context.Context, arg SearchReleasesParams) ([]SearchReleasesRow, error)

func (*Queries) SearchReleasesBySubstring

func (q *Queries) SearchReleasesBySubstring(ctx context.Context, arg SearchReleasesBySubstringParams) ([]SearchReleasesBySubstringRow, error)

func (*Queries) SearchTracks

func (q *Queries) SearchTracks(ctx context.Context, arg SearchTracksParams) ([]SearchTracksRow, error)

func (*Queries) SearchTracksBySubstring

func (q *Queries) SearchTracksBySubstring(ctx context.Context, arg SearchTracksBySubstringParams) ([]SearchTracksBySubstringRow, error)

func (*Queries) SetArtistAliasPrimaryStatus

func (q *Queries) SetArtistAliasPrimaryStatus(ctx context.Context, arg SetArtistAliasPrimaryStatusParams) error

func (*Queries) SetReleaseAliasPrimaryStatus

func (q *Queries) SetReleaseAliasPrimaryStatus(ctx context.Context, arg SetReleaseAliasPrimaryStatusParams) error

func (*Queries) SetTrackAliasPrimaryStatus

func (q *Queries) SetTrackAliasPrimaryStatus(ctx context.Context, arg SetTrackAliasPrimaryStatusParams) error

func (*Queries) TracksOnlyPlayedOnceInYear added in v0.0.13

func (q *Queries) TracksOnlyPlayedOnceInYear(ctx context.Context, arg TracksOnlyPlayedOnceInYearParams) ([]TracksOnlyPlayedOnceInYearRow, error)

func (*Queries) UpdateApiKeyLabel

func (q *Queries) UpdateApiKeyLabel(ctx context.Context, arg UpdateApiKeyLabelParams) error

func (*Queries) UpdateArtistImage

func (q *Queries) UpdateArtistImage(ctx context.Context, arg UpdateArtistImageParams) error

func (*Queries) UpdateArtistMbzID

func (q *Queries) UpdateArtistMbzID(ctx context.Context, arg UpdateArtistMbzIDParams) error

func (*Queries) UpdateArtistReleases

func (q *Queries) UpdateArtistReleases(ctx context.Context, arg UpdateArtistReleasesParams) error

func (*Queries) UpdateArtistTracks

func (q *Queries) UpdateArtistTracks(ctx context.Context, arg UpdateArtistTracksParams) error

func (*Queries) UpdateReleaseForAll

func (q *Queries) UpdateReleaseForAll(ctx context.Context, arg UpdateReleaseForAllParams) error

func (*Queries) UpdateReleaseImage

func (q *Queries) UpdateReleaseImage(ctx context.Context, arg UpdateReleaseImageParams) error

func (*Queries) UpdateReleaseMbzID

func (q *Queries) UpdateReleaseMbzID(ctx context.Context, arg UpdateReleaseMbzIDParams) error

func (*Queries) UpdateReleasePrimaryArtist added in v0.0.8

func (q *Queries) UpdateReleasePrimaryArtist(ctx context.Context, arg UpdateReleasePrimaryArtistParams) error

func (*Queries) UpdateReleaseVariousArtists added in v0.0.6

func (q *Queries) UpdateReleaseVariousArtists(ctx context.Context, arg UpdateReleaseVariousArtistsParams) error

func (*Queries) UpdateSessionExpiry

func (q *Queries) UpdateSessionExpiry(ctx context.Context, arg UpdateSessionExpiryParams) error

func (*Queries) UpdateTrackDuration

func (q *Queries) UpdateTrackDuration(ctx context.Context, arg UpdateTrackDurationParams) error

func (*Queries) UpdateTrackIdForListens

func (q *Queries) UpdateTrackIdForListens(ctx context.Context, arg UpdateTrackIdForListensParams) error

func (*Queries) UpdateTrackMbzID

func (q *Queries) UpdateTrackMbzID(ctx context.Context, arg UpdateTrackMbzIDParams) error

func (*Queries) UpdateTrackPrimaryArtist added in v0.0.8

func (q *Queries) UpdateTrackPrimaryArtist(ctx context.Context, arg UpdateTrackPrimaryArtistParams) error

func (*Queries) UpdateUserPassword

func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error

func (*Queries) UpdateUserUsername

func (q *Queries) UpdateUserUsername(ctx context.Context, arg UpdateUserUsernameParams) error

func (*Queries) WithTx

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

type Release

type Release struct {
	ID             int32
	MusicBrainzID  *uuid.UUID
	Image          *uuid.UUID
	VariousArtists bool
	ImageSource    pgtype.Text
}

type ReleaseAlias

type ReleaseAlias struct {
	ReleaseID int32
	Alias     string
	Source    string
	IsPrimary bool
}

type ReleasesWithTitle

type ReleasesWithTitle struct {
	ID             int32
	MusicBrainzID  *uuid.UUID
	Image          *uuid.UUID
	VariousArtists bool
	ImageSource    pgtype.Text
	Title          string
}

type Role

type Role string
const (
	RoleAdmin Role = "admin"
	RoleUser  Role = "user"
)

func (*Role) Scan

func (e *Role) Scan(src interface{}) error

type SearchArtistsBySubstringParams

type SearchArtistsBySubstringParams struct {
	Column1 pgtype.Text
	Limit   int32
}

type SearchArtistsBySubstringRow

type SearchArtistsBySubstringRow struct {
	ID            int32
	Name          string
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	Score         float64
}

type SearchArtistsParams

type SearchArtistsParams struct {
	Similarity string
	Limit      int32
}

type SearchArtistsRow

type SearchArtistsRow struct {
	ID            int32
	Name          string
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	Score         float32
}

type SearchReleasesBySubstringParams

type SearchReleasesBySubstringParams struct {
	Column1 pgtype.Text
	Limit   int32
}

type SearchReleasesBySubstringRow

type SearchReleasesBySubstringRow struct {
	ID             int32
	Title          string
	MusicBrainzID  *uuid.UUID
	Image          *uuid.UUID
	VariousArtists bool
	Score          float64
	Artists        []byte
}

type SearchReleasesParams

type SearchReleasesParams struct {
	Similarity string
	Limit      int32
}

type SearchReleasesRow

type SearchReleasesRow struct {
	ID             int32
	Title          string
	MusicBrainzID  *uuid.UUID
	Image          *uuid.UUID
	VariousArtists bool
	Score          float32
	Artists        []byte
}

type SearchTracksBySubstringParams

type SearchTracksBySubstringParams struct {
	Column1 pgtype.Text
	Limit   int32
}

type SearchTracksBySubstringRow

type SearchTracksBySubstringRow struct {
	ID            int32
	Title         string
	MusicBrainzID *uuid.UUID
	ReleaseID     int32
	Image         *uuid.UUID
	Score         float64
	Artists       []byte
}

type SearchTracksParams

type SearchTracksParams struct {
	Similarity string
	Limit      int32
}

type SearchTracksRow

type SearchTracksRow struct {
	ID            int32
	Title         string
	MusicBrainzID *uuid.UUID
	ReleaseID     int32
	Image         *uuid.UUID
	Score         float32
	Artists       []byte
}

type Session

type Session struct {
	ID         uuid.UUID
	UserID     int32
	CreatedAt  time.Time
	ExpiresAt  time.Time
	Persistent bool
}

type SetArtistAliasPrimaryStatusParams

type SetArtistAliasPrimaryStatusParams struct {
	IsPrimary bool
	ArtistID  int32
	Alias     string
}

type SetReleaseAliasPrimaryStatusParams

type SetReleaseAliasPrimaryStatusParams struct {
	IsPrimary bool
	ReleaseID int32
	Alias     string
}

type SetTrackAliasPrimaryStatusParams

type SetTrackAliasPrimaryStatusParams struct {
	IsPrimary bool
	TrackID   int32
	Alias     string
}

type Track

type Track struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Duration      int32
	ReleaseID     int32
}

type TrackAlias

type TrackAlias struct {
	TrackID   int32
	Alias     string
	IsPrimary bool
	Source    string
}

type TracksOnlyPlayedOnceInYearParams added in v0.0.13

type TracksOnlyPlayedOnceInYearParams struct {
	Limit  int32
	Year   int32
	UserID int32
}

type TracksOnlyPlayedOnceInYearRow added in v0.0.13

type TracksOnlyPlayedOnceInYearRow struct {
	TrackID     int32
	Title       string
	Artists     []byte
	ListenCount int64
}

type TracksWithTitle

type TracksWithTitle struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Duration      int32
	ReleaseID     int32
	Title         string
}

type UpdateApiKeyLabelParams

type UpdateApiKeyLabelParams struct {
	ID     int32
	UserID int32
	Label  string
}

type UpdateArtistImageParams

type UpdateArtistImageParams struct {
	ID          int32
	Image       *uuid.UUID
	ImageSource pgtype.Text
}

type UpdateArtistMbzIDParams

type UpdateArtistMbzIDParams struct {
	ID            int32
	MusicBrainzID *uuid.UUID
}

type UpdateArtistReleasesParams

type UpdateArtistReleasesParams struct {
	ArtistID   int32
	ArtistID_2 int32
}

type UpdateArtistTracksParams

type UpdateArtistTracksParams struct {
	ArtistID   int32
	ArtistID_2 int32
}

type UpdateReleaseForAllParams

type UpdateReleaseForAllParams struct {
	ReleaseID   int32
	ReleaseID_2 int32
}

type UpdateReleaseImageParams

type UpdateReleaseImageParams struct {
	ID          int32
	Image       *uuid.UUID
	ImageSource pgtype.Text
}

type UpdateReleaseMbzIDParams

type UpdateReleaseMbzIDParams struct {
	ID            int32
	MusicBrainzID *uuid.UUID
}

type UpdateReleasePrimaryArtistParams added in v0.0.8

type UpdateReleasePrimaryArtistParams struct {
	ArtistID  int32
	ReleaseID int32
	IsPrimary bool
}

type UpdateReleaseVariousArtistsParams added in v0.0.6

type UpdateReleaseVariousArtistsParams struct {
	ID             int32
	VariousArtists bool
}

type UpdateSessionExpiryParams

type UpdateSessionExpiryParams struct {
	ID        uuid.UUID
	ExpiresAt time.Time
}

type UpdateTrackDurationParams

type UpdateTrackDurationParams struct {
	ID       int32
	Duration int32
}

type UpdateTrackIdForListensParams

type UpdateTrackIdForListensParams struct {
	TrackID   int32
	TrackID_2 int32
}

type UpdateTrackMbzIDParams

type UpdateTrackMbzIDParams struct {
	ID            int32
	MusicBrainzID *uuid.UUID
}

type UpdateTrackPrimaryArtistParams added in v0.0.8

type UpdateTrackPrimaryArtistParams struct {
	ArtistID  int32
	TrackID   int32
	IsPrimary bool
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	ID       int32
	Password []byte
}

type UpdateUserUsernameParams

type UpdateUserUsernameParams struct {
	ID       int32
	Username string
}

type User

type User struct {
	ID       int32
	Username string
	Role     Role
	Password []byte
}

Jump to

Keyboard shortcuts

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