db_sqlc

package
v0.0.0-...-742d52a Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBatchAlreadyClosed = errors.New("batch already closed")
)

Functions

This section is empty.

Types

type Channel

type Channel struct {
	ID                    string
	PlatformChannelID     string
	CreatorID             string
	PlatformType          string
	Title                 string
	Description           string
	PublishedAt           pgtype.Timestamptz
	TotalViewCount        int32
	SubscriberCount       int32
	HiddenSubscriberCount bool
	TotalVideoCount       int32
	ThumbnailUrl          string
	UpdatedAt             pgtype.Timestamptz
	IsDeleted             bool
}

type CreateChannelBatchResults

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

func (*CreateChannelBatchResults) Close

func (b *CreateChannelBatchResults) Close() error

func (*CreateChannelBatchResults) QueryRow

func (b *CreateChannelBatchResults) QueryRow(f func(int, Channel, error))

type CreateChannelParams

type CreateChannelParams struct {
	ID                    string
	PlatformChannelID     string
	CreatorID             string
	PlatformType          string
	Title                 string
	Description           string
	PublishedAt           pgtype.Timestamptz
	TotalViewCount        int32
	SubscriberCount       int32
	HiddenSubscriberCount bool
	TotalVideoCount       int32
	ThumbnailUrl          string
	UpdatedAt             pgtype.Timestamptz
	IsDeleted             bool
}

type CreateCreatorBatchResults

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

func (*CreateCreatorBatchResults) Close

func (b *CreateCreatorBatchResults) Close() error

func (*CreateCreatorBatchResults) QueryRow

func (b *CreateCreatorBatchResults) QueryRow(f func(int, Creator, error))

type CreateCreatorParams

type CreateCreatorParams struct {
	ID         string
	Name       string
	MemberType string
}

type CreateStreamStatusBatchResults

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

func (*CreateStreamStatusBatchResults) Close

func (*CreateStreamStatusBatchResults) QueryRow

func (b *CreateStreamStatusBatchResults) QueryRow(f func(int, StreamStatus, error))

type CreateStreamStatusParams

type CreateStreamStatusParams struct {
	ID        string
	VideoID   string
	CreatorID string
	Status    string
	UpdatedAt pgtype.Timestamptz
	StartedAt pgtype.Timestamptz
	EndedAt   pgtype.Timestamptz
	ViewCount int32
}

type CreateVideoBatchResults

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

func (*CreateVideoBatchResults) Close

func (b *CreateVideoBatchResults) Close() error

func (*CreateVideoBatchResults) QueryRow

func (b *CreateVideoBatchResults) QueryRow(f func(int, Video, error))

type CreateVideoParams

type CreateVideoParams struct {
	ID           string
	ChannelID    string
	PlatformType string
	Title        string
	Description  string
	VideoType    string
	PublishedAt  pgtype.Timestamptz
	Tags         string
	ThumbnailUrl string
	IsDeleted    bool
}

type Creator

type Creator struct {
	ID         string
	Name       string
	MemberType string
}

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
	SendBatch(context.Context, *pgx.Batch) pgx.BatchResults
}

type GetChannelsByParamsParams

type GetChannelsByParamsParams struct {
	PlatformType string
	Limit        int32
	Offset       int32
}

type GetCreatorsWithChannelsRow

type GetCreatorsWithChannelsRow struct {
	Creator Creator
	Channel Channel
}

type GetVideosByIDsRow

type GetVideosByIDsRow struct {
	Video Video
}

type GetVideosByPlatformsWithStatusParams

type GetVideosByPlatformsWithStatusParams struct {
	VideoType     string
	Limit         int32
	Offset        int32
	PlatformTypes []string
}

type GetVideosByPlatformsWithStatusRow

type GetVideosByPlatformsWithStatusRow struct {
	Video        Video
	StreamStatus StreamStatus
}

type GetVideosByTimeRangeParams

type GetVideosByTimeRangeParams struct {
	StartedAt pgtype.Timestamptz
	EndedAt   pgtype.Timestamptz
}

type GetVideosByTimeRangeRow

type GetVideosByTimeRangeRow struct {
	Video        Video
	StreamStatus StreamStatus
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CountCreator

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

func (*Queries) CountVideo

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

func (*Queries) CreateChannel

func (*Queries) CreateCreator

func (*Queries) CreateStreamStatus

func (*Queries) CreateVideo

func (q *Queries) CreateVideo(ctx context.Context, arg []CreateVideoParams) *CreateVideoBatchResults

func (*Queries) DeleteVideosByIDs

func (q *Queries) DeleteVideosByIDs(ctx context.Context, ids []string) error

func (*Queries) ExistsChannel

func (q *Queries) ExistsChannel(ctx context.Context, id string) (bool, error)

func (*Queries) ExistsCreator

func (q *Queries) ExistsCreator(ctx context.Context, id string) (bool, error)

func (*Queries) GetChannelsByParams

func (q *Queries) GetChannelsByParams(ctx context.Context, arg GetChannelsByParamsParams) ([]Channel, error)

func (*Queries) GetCreatorsWithChannels

func (q *Queries) GetCreatorsWithChannels(ctx context.Context, memberTypes []string) ([]GetCreatorsWithChannelsRow, error)

func (*Queries) GetVideosByIDs

func (q *Queries) GetVideosByIDs(ctx context.Context, ids []string) ([]GetVideosByIDsRow, error)

func (*Queries) GetVideosByTimeRange

func (q *Queries) GetVideosByTimeRange(ctx context.Context, arg GetVideosByTimeRangeParams) ([]GetVideosByTimeRangeRow, error)

func (*Queries) UpdateChannel

func (q *Queries) UpdateChannel(ctx context.Context, arg UpdateChannelParams) (Channel, error)

func (*Queries) WithTx

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

type StreamStatus

type StreamStatus struct {
	ID        string
	VideoID   string
	CreatorID string
	Status    string
	StartedAt pgtype.Timestamptz
	EndedAt   pgtype.Timestamptz
	ViewCount int32
	UpdatedAt pgtype.Timestamptz
}

type UpdateChannelParams

type UpdateChannelParams struct {
	PlatformChannelID string
	Title             string
	Description       string
	ThumbnailUrl      string
	UpdatedAt         pgtype.Timestamptz
}

type Video

type Video struct {
	ID           string
	ChannelID    string
	PlatformType string
	Title        string
	Description  string
	VideoType    string
	PublishedAt  pgtype.Timestamptz
	Tags         string
	ThumbnailUrl string
	IsDeleted    bool
}

Jump to

Keyboard shortcuts

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