repository

package
v0.1.32 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AiCache added in v0.1.30

type AiCache struct {
	ID     int32
	UserID int32
	// Type: profile, nowplaying, playlist
	CacheType string
	CacheKey  string
	// MD5 hash of prompt for change detection
	PromptHash string
	// Hash of input data (stats, track info) for change detection
	DataHash    string
	Response    string
	CreatedAt   pgtype.Timestamptz
	ExpiresAt   time.Time
	ListenCount pgtype.Int4
}

Server-side cache for AI responses with smart refresh

type AlltimeUserStat added in v0.1.30

type AlltimeUserStat struct {
	UserID          int32
	ListenCount     int64
	UniqueTracks    int64
	UniqueAlbums    int64
	UniqueArtists   int64
	SecondsListened interface{}
	FirstListen     interface{}
	LastListen      interface{}
}

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
	Genres        []string
	Bio           pgtype.Text
	Popularity    pgtype.Int4
	SpotifyID     pgtype.Text
	Followers     pgtype.Int4
	SearchVector  interface{}
}

type ArtistAlias

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

type ArtistEmbedding added in v0.1.30

type ArtistEmbedding struct {
	ArtistID  int32
	Embedding pgvector.Vector
	Model     pgtype.Text
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type ArtistRelease

type ArtistRelease struct {
	ArtistID  int32
	ReleaseID int32
	IsPrimary bool
}

type ArtistTrack

type ArtistTrack struct {
	ArtistID  int32
	TrackID   int32
	IsPrimary bool
}

type ArtistsOnlyPlayedOnceInYearParams

type ArtistsOnlyPlayedOnceInYearParams struct {
	Year   int32
	UserID int32
}

type ArtistsOnlyPlayedOnceInYearRow

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
	Genres        []string
	Bio           pgtype.Text
	Popularity    pgtype.Int4
	SpotifyID     pgtype.Text
	Followers     pgtype.Int4
	Name          string
}

type AssociateArtistToReleaseParams

type AssociateArtistToReleaseParams struct {
	ArtistID  int32
	ReleaseID int32
	IsPrimary bool
}

type AssociateArtistToTrackParams

type AssociateArtistToTrackParams struct {
	ArtistID  int32
	TrackID   int32
	IsPrimary bool
}

type ClientSource added in v0.1.30

type ClientSource struct {
	ID        uuid.UUID
	UserID    int32
	Name      string
	Token     string
	LastSeen  pgtype.Timestamptz
	Config    []byte
	CreatedAt pgtype.Timestamptz
}

type CountListensFromArtistParams

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

type CountListensFromReleaseParams

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

type CountListensFromTrackParams

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

type CountListensParams

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

type CountTimeListenedParams

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

type CountTimeListenedToArtistParams

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

type CountTimeListenedToReleaseParams

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

type CountTimeListenedToTrackParams

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

type CountTopArtistsParams

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

type CountTopReleasesParams

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

type CountTopTracksByArtistParams

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

type CountTopTracksByReleaseParams

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

type CountTopTracksParams

type CountTopTracksParams struct {
	ListenedAt   time.Time
	ListenedAt_2 time.Time
	UserID       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 DailyUserStat added in v0.1.30

type DailyUserStat struct {
	UserID          int32
	StatDate        pgtype.Date
	ListenCount     int64
	UniqueTracks    int64
	UniqueAlbums    int64
	UniqueArtists   int64
	SecondsListened interface{}
}

type DeleteAICacheByKeyParams added in v0.1.30

type DeleteAICacheByKeyParams struct {
	UserID    int32
	CacheType string
	CacheKey  string
}

type DeleteAICacheByTypeParams added in v0.1.30

type DeleteAICacheByTypeParams struct {
	UserID    int32
	CacheType string
}

type DeleteApiKeyParams added in v0.1.30

type DeleteApiKeyParams struct {
	ID     int32
	UserID int32
}

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
	UserID     int32
}

type DeleteReleaseAliasParams

type DeleteReleaseAliasParams struct {
	ReleaseID int32
	Alias     string
}

type DeleteTrackAliasParams

type DeleteTrackAliasParams struct {
	TrackID int32
	Alias   string
}

type ExistsListenFuzzyParams added in v0.1.30

type ExistsListenFuzzyParams struct {
	UserID     int32
	TrackID    int32
	ListenedAt time.Time
}

type GetAICacheParams added in v0.1.30

type GetAICacheParams struct {
	UserID    int32
	CacheType string
	CacheKey  string
}

type GetArtistByMbzIDRow

type GetArtistByMbzIDRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
	Genres        []string
	Bio           pgtype.Text
	Popularity    pgtype.Int4
	SpotifyID     pgtype.Text
	Followers     pgtype.Int4
	Name          string
	Aliases       []string
}

type GetArtistByNameRow

type GetArtistByNameRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
	Genres        []string
	Bio           pgtype.Text
	Popularity    pgtype.Int4
	SpotifyID     pgtype.Text
	Followers     pgtype.Int4
	Name          string
	Aliases       []string
}

type GetArtistCountInYearParams

type GetArtistCountInYearParams struct {
	UserID int32
	Year   int32
}

type GetArtistRow

type GetArtistRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
	Genres        []string
	Bio           pgtype.Text
	Popularity    pgtype.Int4
	SpotifyID     pgtype.Text
	Followers     pgtype.Int4
	Name          string
	Aliases       []string
}

type GetArtistWithLongestGapInYearParams

type GetArtistWithLongestGapInYearParams struct {
	Year           int32
	FirstDayOfYear pgtype.Date
}

type GetArtistWithLongestGapInYearRow

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

type GetArtistsWithOnlyOnePlayInYearRow

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

type GetFirstListenFromArtistParams added in v0.1.30

type GetFirstListenFromArtistParams struct {
	UserID   int32
	ArtistID int32
}

type GetFirstListenFromReleaseParams added in v0.1.30

type GetFirstListenFromReleaseParams struct {
	UserID    int32
	ReleaseID int32
}

type GetFirstListenFromTrackParams added in v0.1.30

type GetFirstListenFromTrackParams struct {
	UserID int32
	ID     int32
}

type GetFirstListenInYearRow

type GetFirstListenInYearRow struct {
	TrackID          int32
	ListenedAt       time.Time
	Client           *string
	UserID           int32
	ID               pgtype.Int4
	MusicBrainzID    *uuid.UUID
	Duration         pgtype.Int4
	ReleaseID        pgtype.Int4
	Popularity       pgtype.Int4
	SpotifyID        pgtype.Text
	Danceability     pgtype.Float8
	Energy           pgtype.Float8
	Key              pgtype.Int4
	Loudness         pgtype.Float8
	Mode             pgtype.Int4
	Speechiness      pgtype.Float8
	Acousticness     pgtype.Float8
	Instrumentalness pgtype.Float8
	Liveness         pgtype.Float8
	Valence          pgtype.Float8
	Tempo            pgtype.Float8
	Title            pgtype.Text
	Artists          []byte
}

type GetLastListensFromArtistPaginatedParams

type GetLastListensFromArtistPaginatedParams struct {
	UserID       int32
	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
	ReleaseImage *uuid.UUID
	ReleaseTitle string
	Artists      []byte
}

type GetLastListensFromReleasePaginatedParams

type GetLastListensFromReleasePaginatedParams struct {
	UserID       int32
	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
	ReleaseImage *uuid.UUID
	ReleaseTitle string
	Artists      []byte
}

type GetLastListensFromTrackPaginatedParams

type GetLastListensFromTrackPaginatedParams struct {
	UserID       int32
	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
	ReleaseImage *uuid.UUID
	ReleaseTitle string
	Artists      []byte
}

type GetLastListensPaginatedParams

type GetLastListensPaginatedParams struct {
	UserID       int32
	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
	ReleaseImage *uuid.UUID
	ReleaseTitle string
	Artists      []byte
}

type GetListenPercentageInTimeWindowInYearParams

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

type GetListenPercentageInTimeWindowInYearRow

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

type GetListensExportPageParams

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

type GetListensExportPageRow

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

type GetMostReplayedTrackInYearParams struct {
	UserID int32
	Year   int32
}

type GetMostReplayedTrackInYearRow

type GetMostReplayedTrackInYearRow struct {
	ID               int32
	MusicBrainzID    *uuid.UUID
	Duration         int32
	ReleaseID        int32
	Popularity       pgtype.Int4
	SpotifyID        pgtype.Text
	Danceability     pgtype.Float8
	Energy           pgtype.Float8
	Key              pgtype.Int4
	Loudness         pgtype.Float8
	Mode             pgtype.Int4
	Speechiness      pgtype.Float8
	Acousticness     pgtype.Float8
	Instrumentalness pgtype.Float8
	Liveness         pgtype.Float8
	Valence          pgtype.Float8
	Tempo            pgtype.Float8
	Title            string
	Artists          []byte
	StreakLength     int64
}

type GetPercentageOfTotalListensFromTopArtistsInYearParams

type GetPercentageOfTotalListensFromTopArtistsInYearParams struct {
	Limit  int32
	UserID int32
	Year   int32
}

type GetPercentageOfTotalListensFromTopArtistsInYearRow

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

type GetPercentageOfTotalListensFromTopTracksInYearParams

type GetPercentageOfTotalListensFromTopTracksInYearParams struct {
	Limit  int32
	UserID int32
	Year   int32
}

type GetPercentageOfTotalListensFromTopTracksInYearRow

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

type GetReleaseArtistsRow

type GetReleaseArtistsRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
	Genres        []string
	Bio           pgtype.Text
	Popularity    pgtype.Int4
	SpotifyID     pgtype.Text
	Followers     pgtype.Int4
	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

type GetReleaseRow struct {
	ID                   int32
	MusicBrainzID        *uuid.UUID
	Image                *uuid.UUID
	VariousArtists       bool
	ImageSource          pgtype.Text
	Genres               []string
	ReleaseDate          pgtype.Text
	Popularity           pgtype.Int4
	SpotifyID            pgtype.Text
	Label                pgtype.Text
	ReleaseDatePrecision 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
	Genres               []string
	ReleaseDate          pgtype.Text
	Popularity           pgtype.Int4
	SpotifyID            pgtype.Text
	Label                pgtype.Text
	ReleaseDatePrecision pgtype.Text
	Title                string
	Genres_2             []string
	ReleaseDate_2        pgtype.Text
	Popularity_2         pgtype.Int4
	SpotifyID_2          pgtype.Text
	Artists              []byte
}

type GetTopArtistsPaginatedParams

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

type GetTopArtistsPaginatedRow

type GetTopArtistsPaginatedRow struct {
	ID            int32
	Name          string
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	Genres        []string
	Bio           pgtype.Text
	Popularity    pgtype.Int4
	SpotifyID     pgtype.Text
	ListenCount   int64
}

type GetTopReleasesFromArtistParams

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

type GetTopReleasesFromArtistRow

type GetTopReleasesFromArtistRow struct {
	ID                   int32
	MusicBrainzID        *uuid.UUID
	Image                *uuid.UUID
	VariousArtists       bool
	ImageSource          pgtype.Text
	Genres               []string
	ReleaseDate          pgtype.Text
	Popularity           pgtype.Int4
	SpotifyID            pgtype.Text
	Label                pgtype.Text
	ReleaseDatePrecision pgtype.Text
	Title                string
	Genres_2             []string
	ReleaseDate_2        pgtype.Text
	Popularity_2         pgtype.Int4
	SpotifyID_2          pgtype.Text
	ListenCount          int64
	Artists              []byte
}

type GetTopReleasesPaginatedParams

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

type GetTopReleasesPaginatedRow

type GetTopReleasesPaginatedRow struct {
	ID                   int32
	MusicBrainzID        *uuid.UUID
	Image                *uuid.UUID
	VariousArtists       bool
	ImageSource          pgtype.Text
	Genres               []string
	ReleaseDate          pgtype.Text
	Popularity           pgtype.Int4
	SpotifyID            pgtype.Text
	Label                pgtype.Text
	ReleaseDatePrecision pgtype.Text
	Title                string
	Genres_2             []string
	ReleaseDate_2        pgtype.Text
	Popularity_2         pgtype.Int4
	SpotifyID_2          pgtype.Text
	ListenCount          int64
	Artists              []byte
}

type GetTopTracksByArtistPaginatedParams

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

type GetTopTracksByArtistPaginatedRow

type GetTopTracksByArtistPaginatedRow struct {
	ID            int32
	Title         string
	MusicBrainzID *uuid.UUID
	ReleaseID     int32
	Popularity    pgtype.Int4
	SpotifyID     pgtype.Text
	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
	UserID       int32
}

type GetTopTracksInReleasePaginatedRow

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

type GetTopTracksPaginatedParams

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

type GetTopTracksPaginatedRow

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

type GetTrackArtistsRow

type GetTrackArtistsRow struct {
	ID            int32
	MusicBrainzID *uuid.UUID
	Image         *uuid.UUID
	ImageSource   pgtype.Text
	Genres        []string
	Bio           pgtype.Text
	Popularity    pgtype.Int4
	SpotifyID     pgtype.Text
	Followers     pgtype.Int4
	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
	Popularity       pgtype.Int4
	SpotifyID        pgtype.Text
	Danceability     pgtype.Float8
	Energy           pgtype.Float8
	Key              pgtype.Int4
	Loudness         pgtype.Float8
	Mode             pgtype.Int4
	Speechiness      pgtype.Float8
	Acousticness     pgtype.Float8
	Instrumentalness pgtype.Float8
	Liveness         pgtype.Float8
	Valence          pgtype.Float8
	Tempo            pgtype.Float8
	Title            string
	Artists          []byte
	Image            *uuid.UUID
}

type GetTracksPlayedAtLeastOncePerMonthInYearRow

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

type GetWeekWithMostListensInYearParams struct {
	Year   int32
	UserID int32
}

type GetWeekWithMostListensInYearRow

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
	UserID   int32
	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
	UserID    int32
	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
	UserID  int32
	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
	UserID  int32
}

type ListenActivityRow

type ListenActivityRow struct {
	BucketStart time.Time
	ListenCount int64
}

type MonthlyUserStat added in v0.1.30

type MonthlyUserStat struct {
	UserID          int32
	StatMonth       pgtype.Date
	ListenCount     int64
	UniqueTracks    int64
	UniqueAlbums    int64
	UniqueArtists   int64
	SecondsListened interface{}
}

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) 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) CleanupOldPresence added in v0.1.30

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

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) DeleteAICacheByKey added in v0.1.30

func (q *Queries) DeleteAICacheByKey(ctx context.Context, arg DeleteAICacheByKeyParams) error

func (*Queries) DeleteAICacheByType added in v0.1.30

func (q *Queries) DeleteAICacheByType(ctx context.Context, arg DeleteAICacheByTypeParams) error

func (*Queries) DeleteAllAICache added in v0.1.30

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

func (*Queries) DeleteApiKey

func (q *Queries) DeleteApiKey(ctx context.Context, arg DeleteApiKeyParams) 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) DeleteExpiredAICache added in v0.1.30

func (q *Queries) DeleteExpiredAICache(ctx context.Context) 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) ExistsListenFuzzy added in v0.1.30

func (q *Queries) ExistsListenFuzzy(ctx context.Context, arg ExistsListenFuzzyParams) (bool, error)

func (*Queries) GetAICache added in v0.1.30

func (q *Queries) GetAICache(ctx context.Context, arg GetAICacheParams) (AiCache, 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) GetAllUsers added in v0.1.30

func (q *Queries) GetAllUsers(ctx context.Context) ([]User, 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

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

func (*Queries) GetArtistsWithOnlyOnePlayInYear

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

func (*Queries) GetClientSources added in v0.1.30

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

func (*Queries) GetFirstListenFromArtist

func (q *Queries) GetFirstListenFromArtist(ctx context.Context, arg GetFirstListenFromArtistParams) (Listen, error)

func (*Queries) GetFirstListenFromRelease

func (q *Queries) GetFirstListenFromRelease(ctx context.Context, arg GetFirstListenFromReleaseParams) (Listen, error)

func (*Queries) GetFirstListenFromTrack

func (q *Queries) GetFirstListenFromTrack(ctx context.Context, arg GetFirstListenFromTrackParams) (Listen, error)

func (*Queries) GetFirstListenInYear

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) GetListensExportPage

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

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

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

func (*Queries) GetUser added in v0.1.30

func (q *Queries) GetUser(ctx context.Context, id int32) (User, 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) GetUserPreferences added in v0.1.30

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

func (*Queries) GetUserPresence added in v0.1.30

func (q *Queries) GetUserPresence(ctx context.Context, userID int32) (UserPresence, error)

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) IsUserOnline added in v0.1.30

func (q *Queries) IsUserOnline(ctx context.Context, userID int32) (bool, 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) SaveUserPreferences added in v0.1.30

func (q *Queries) SaveUserPreferences(ctx context.Context, arg SaveUserPreferencesParams) 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

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) UpdateArtistMetadata added in v0.1.30

func (q *Queries) UpdateArtistMetadata(ctx context.Context, arg UpdateArtistMetadataParams) 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) UpdateReleaseMetadata added in v0.1.30

func (q *Queries) UpdateReleaseMetadata(ctx context.Context, arg UpdateReleaseMetadataParams) error

func (*Queries) UpdateReleasePrimaryArtist

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

func (*Queries) UpdateReleaseVariousArtists

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) UpdateTrackMetadata added in v0.1.30

func (q *Queries) UpdateTrackMetadata(ctx context.Context, arg UpdateTrackMetadataParams) error

func (*Queries) UpdateTrackPrimaryArtist

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) UpdateUserRole added in v0.1.30

func (q *Queries) UpdateUserRole(ctx context.Context, arg UpdateUserRoleParams) error

func (*Queries) UpdateUserUsername

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

func (*Queries) UpsertAICache added in v0.1.30

func (q *Queries) UpsertAICache(ctx context.Context, arg UpsertAICacheParams) error

func (*Queries) UpsertClientSource added in v0.1.30

func (q *Queries) UpsertClientSource(ctx context.Context, arg UpsertClientSourceParams) error

func (*Queries) UpsertUserPresence added in v0.1.30

func (q *Queries) UpsertUserPresence(ctx context.Context, userID int32) 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
	Genres               []string
	ReleaseDate          pgtype.Text
	Popularity           pgtype.Int4
	SpotifyID            pgtype.Text
	Label                pgtype.Text
	ReleaseDatePrecision pgtype.Text
	SearchVector         interface{}
}

type ReleaseAlias

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

type ReleaseEmbedding added in v0.1.30

type ReleaseEmbedding struct {
	ReleaseID int32
	Embedding pgvector.Vector
	Model     pgtype.Text
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type ReleasesWithTitle

type ReleasesWithTitle struct {
	ID                   int32
	MusicBrainzID        *uuid.UUID
	Image                *uuid.UUID
	VariousArtists       bool
	ImageSource          pgtype.Text
	Genres               []string
	ReleaseDate          pgtype.Text
	Popularity           pgtype.Int4
	SpotifyID            pgtype.Text
	Label                pgtype.Text
	ReleaseDatePrecision 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 SaveUserPreferencesParams added in v0.1.30

type SaveUserPreferencesParams struct {
	UserID          int32
	PreferencesData []byte
}

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
	Popularity       pgtype.Int4
	SpotifyID        pgtype.Text
	Danceability     pgtype.Float8
	Energy           pgtype.Float8
	Key              pgtype.Int4
	Loudness         pgtype.Float8
	Mode             pgtype.Int4
	Speechiness      pgtype.Float8
	Acousticness     pgtype.Float8
	Instrumentalness pgtype.Float8
	Liveness         pgtype.Float8
	Valence          pgtype.Float8
	Tempo            pgtype.Float8
	SearchVector     interface{}
}

type TrackAlias

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

type TrackEmbedding added in v0.1.30

type TrackEmbedding struct {
	TrackID   int32
	Embedding pgvector.Vector
	Model     pgtype.Text
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type TracksOnlyPlayedOnceInYearParams

type TracksOnlyPlayedOnceInYearParams struct {
	Limit  int32
	Year   int32
	UserID int32
}

type TracksOnlyPlayedOnceInYearRow

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
	Popularity       pgtype.Int4
	SpotifyID        pgtype.Text
	Danceability     pgtype.Float8
	Energy           pgtype.Float8
	Key              pgtype.Int4
	Loudness         pgtype.Float8
	Mode             pgtype.Int4
	Speechiness      pgtype.Float8
	Acousticness     pgtype.Float8
	Instrumentalness pgtype.Float8
	Liveness         pgtype.Float8
	Valence          pgtype.Float8
	Tempo            pgtype.Float8
	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 UpdateArtistMetadataParams added in v0.1.30

type UpdateArtistMetadataParams struct {
	ID         int32
	Genres     []string
	Bio        pgtype.Text
	Popularity pgtype.Int4
	SpotifyID  pgtype.Text
	Followers  pgtype.Int4
}

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 UpdateReleaseMetadataParams added in v0.1.30

type UpdateReleaseMetadataParams struct {
	ID                   int32
	Genres               []string
	ReleaseDate          pgtype.Text
	Popularity           pgtype.Int4
	SpotifyID            pgtype.Text
	Label                pgtype.Text
	ReleaseDatePrecision pgtype.Text
}

type UpdateReleasePrimaryArtistParams

type UpdateReleasePrimaryArtistParams struct {
	ArtistID  int32
	ReleaseID int32
	IsPrimary bool
}

type UpdateReleaseVariousArtistsParams

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 UpdateTrackMetadataParams added in v0.1.30

type UpdateTrackMetadataParams struct {
	ID               int32
	Popularity       pgtype.Int4
	SpotifyID        pgtype.Text
	Danceability     pgtype.Float8
	Energy           pgtype.Float8
	Key              pgtype.Int4
	Loudness         pgtype.Float8
	Mode             pgtype.Int4
	Speechiness      pgtype.Float8
	Acousticness     pgtype.Float8
	Instrumentalness pgtype.Float8
	Liveness         pgtype.Float8
	Valence          pgtype.Float8
	Tempo            pgtype.Float8
}

type UpdateTrackPrimaryArtistParams

type UpdateTrackPrimaryArtistParams struct {
	ArtistID  int32
	TrackID   int32
	IsPrimary bool
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	ID       int32
	Password []byte
}

type UpdateUserRoleParams added in v0.1.30

type UpdateUserRoleParams struct {
	ID   int32
	Role Role
}

type UpdateUserUsernameParams

type UpdateUserUsernameParams struct {
	ID       int32
	Username string
}

type UpsertAICacheParams added in v0.1.30

type UpsertAICacheParams struct {
	UserID      int32
	CacheType   string
	CacheKey    string
	PromptHash  string
	DataHash    string
	Response    string
	ExpiresAt   time.Time
	ListenCount pgtype.Int4
}

type UpsertClientSourceParams added in v0.1.30

type UpsertClientSourceParams struct {
	UserID int32
	Name   string
	Token  string
}

type User

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

type UserPreference added in v0.1.30

type UserPreference struct {
	UserID          int32
	PreferencesData []byte
	CreatedAt       pgtype.Timestamp
	UpdatedAt       pgtype.Timestamp
}

type UserPresence added in v0.1.30

type UserPresence struct {
	UserID   int32
	LastPing time.Time
}

Tracks active user sessions for Now Playing critique optimization

type UserTasteEmbedding added in v0.1.30

type UserTasteEmbedding struct {
	UserID               int32
	Embedding            pgvector.Vector
	Model                pgtype.Text
	LastComputed         pgtype.Timestamptz
	ListenCountAtCompute pgtype.Int4
}

type UserTheme

type UserTheme struct {
	UserID    int32
	ThemeData []byte
	CreatedAt pgtype.Timestamp
	UpdatedAt pgtype.Timestamp
}

type YearlyUserStat added in v0.1.30

type YearlyUserStat struct {
	UserID          int32
	StatYear        int32
	ListenCount     int64
	UniqueTracks    int64
	UniqueAlbums    int64
	UniqueArtists   int64
	SecondsListened interface{}
}

Jump to

Keyboard shortcuts

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