db_sqlc

package
v0.0.0-...-68ea8a3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 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 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
	StartedAt       pgtype.Timestamptz
	EndedAt         pgtype.Timestamptz
	BroadcastStatus string
	Tags            string
	ViewCount       int32
	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 GetVideosByParamsParams

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

type GetVideosByParamsRow

type GetVideosByParamsRow struct {
	Video Video
}

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

func (q *Queries) GetVideosByParams(ctx context.Context, arg GetVideosByParamsParams) ([]GetVideosByParamsRow, 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 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
	StartedAt       pgtype.Timestamptz
	EndedAt         pgtype.Timestamptz
	BroadcastStatus string
	Tags            string
	ViewCount       int32
	ThumbnailUrl    string
	IsDeleted       bool
}

Jump to

Keyboard shortcuts

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