database

package
v0.0.0-...-c3e16ed Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func MustLoadDatabase

func MustLoadDatabase(ctx context.Context) error

Types

type Chat

type Chat struct {
	ID        int64
	Command   string
	Step      int16
	Data      []byte
	CreatedAt pgtype.Timestamp
	UpdatedAt pgtype.Timestamp
}

type CreateChatParams

type CreateChatParams struct {
	ID        int64
	Command   string
	Step      int16
	Data      []byte
	CreatedAt pgtype.Timestamp
}

type CreateProductVersionParams

type CreateProductVersionParams struct {
	ProductID          int32
	ReleaseName        string
	ReleaseCodename    *string
	ReleaseLabel       string
	ReleaseDate        pgtype.Timestamp
	Version            string
	VersionReleaseDate pgtype.Timestamp
	VersionReleaseLink *string
	CreatedAt          pgtype.Timestamp
}

type CreateUserParams

type CreateUserParams struct {
	ID        int64
	Username  *string
	FirstName *string
	LastName  *string
	CreatedAt pgtype.Timestamp
}

type CreateWatchListParams

type CreateWatchListParams struct {
	ChatID    int64
	ProductID int32
	CreatedAt pgtype.Timestamp
}

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 DeleteWatchListParams

type DeleteWatchListParams struct {
	ChatID    int64
	ProductID int32
}

type GetProductByIdRow

type GetProductByIdRow struct {
	ID        int32
	Name      string
	Label     string
	Category  string
	ApiUrl    string
	CreatedAt pgtype.Timestamp
}

type GetProductsByLabelRow

type GetProductsByLabelRow struct {
	ID     int32
	Name   string
	Label  string
	ApiUrl string
}

type GetProductsWithNewReleasesParams

type GetProductsWithNewReleasesParams struct {
	CreatedAt pgtype.Timestamp
	Column2   []int32
}

type GetProductsWithNewReleasesRow

type GetProductsWithNewReleasesRow struct {
	ProductID       int32
	ProductLabel    string
	ProductEolUrl   string
	ProductVersions []byte
}

type GetWatchListRow

type GetWatchListRow struct {
	ProductName  string
	ProductLabel string
}

type GetWatchListsGroupedByChatRow

type GetWatchListsGroupedByChatRow struct {
	ChatID     int64
	ProductIds []byte
}

type GetWatchListsWithProductVersionsRow

type GetWatchListsWithProductVersionsRow struct {
	ProductID       int32
	ProductLabel    string
	ProductEolUrl   string
	ProductVersions []byte
}

type GetWatchedProductByNameParams

type GetWatchedProductByNameParams struct {
	Name   string
	ChatID int64
}

type GetWatchedProductByNameRow

type GetWatchedProductByNameRow struct {
	ID    int32
	Label string
}

type GetWatchedProductsRow

type GetWatchedProductsRow struct {
	ID     int32
	Name   string
	ApiUrl interface{}
}

type IsWatchListExistsParams

type IsWatchListExistsParams struct {
	ChatID    int64
	ProductID int32
}

type Product

type Product struct {
	ID        int32
	Name      string
	Label     string
	Category  string
	ApiUrl    string
	EolUrl    string
	CreatedAt pgtype.Timestamp
	UpdatedAt pgtype.Timestamp
}

type ProductVersion

type ProductVersion struct {
	ID                 int32
	ProductID          int32
	ReleaseName        string
	ReleaseCodename    *string
	ReleaseLabel       string
	ReleaseDate        pgtype.Timestamp
	Version            string
	VersionReleaseDate pgtype.Timestamp
	VersionReleaseLink *string
	CreatedAt          pgtype.Timestamp
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}
var Sqlc *Queries

func New

func New(db DBTX) *Queries

func (*Queries) CreateChat

func (q *Queries) CreateChat(ctx context.Context, arg *CreateChatParams) (*Chat, error)

func (*Queries) CreateProductVersion

func (q *Queries) CreateProductVersion(ctx context.Context, arg *CreateProductVersionParams) error

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg *CreateUserParams) (*User, error)

func (*Queries) CreateWatchList

func (q *Queries) CreateWatchList(ctx context.Context, arg *CreateWatchListParams) (*WatchList, error)

func (*Queries) DeleteChat

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

func (*Queries) DeleteWatchList

func (q *Queries) DeleteWatchList(ctx context.Context, arg *DeleteWatchListParams) error

func (*Queries) GetChat

func (q *Queries) GetChat(ctx context.Context, id int64) (*Chat, error)

func (*Queries) GetDistinctProductIdsFromProductVersionsByCreatedAt

func (q *Queries) GetDistinctProductIdsFromProductVersionsByCreatedAt(ctx context.Context, createdAt pgtype.Timestamp) ([]int32, error)

func (*Queries) GetProductById

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

func (*Queries) GetProductsByLabel

func (q *Queries) GetProductsByLabel(ctx context.Context, label string) ([]*GetProductsByLabelRow, error)

func (*Queries) GetProductsWithNewReleases

func (q *Queries) GetProductsWithNewReleases(ctx context.Context, arg *GetProductsWithNewReleasesParams) ([]*GetProductsWithNewReleasesRow, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id int64) (*User, error)

func (*Queries) GetWatchList

func (q *Queries) GetWatchList(ctx context.Context, chatID int64) ([]*GetWatchListRow, error)

func (*Queries) GetWatchListsGroupedByChat

func (q *Queries) GetWatchListsGroupedByChat(ctx context.Context) ([]*GetWatchListsGroupedByChatRow, error)

func (*Queries) GetWatchListsWithProductVersions

func (q *Queries) GetWatchListsWithProductVersions(ctx context.Context, chatID int64) ([]*GetWatchListsWithProductVersionsRow, error)

func (*Queries) GetWatchedProductByName

func (q *Queries) GetWatchedProductByName(ctx context.Context, arg *GetWatchedProductByNameParams) (*GetWatchedProductByNameRow, error)

func (*Queries) GetWatchedProducts

func (q *Queries) GetWatchedProducts(ctx context.Context) ([]*GetWatchedProductsRow, error)

func (*Queries) IsChatExists

func (q *Queries) IsChatExists(ctx context.Context, id int64) (bool, error)

func (*Queries) IsUserExists

func (q *Queries) IsUserExists(ctx context.Context, id int64) (bool, error)

func (*Queries) IsWatchListExists

func (q *Queries) IsWatchListExists(ctx context.Context, arg *IsWatchListExistsParams) (bool, error)

func (*Queries) UpdateChat

func (q *Queries) UpdateChat(ctx context.Context, arg *UpdateChatParams) (*Chat, error)

func (*Queries) UpsertProduct

func (q *Queries) UpsertProduct(ctx context.Context, arg *UpsertProductParams) error

func (*Queries) WithTx

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

type UpdateChatParams

type UpdateChatParams struct {
	Command   string
	Step      int16
	Data      []byte
	UpdatedAt pgtype.Timestamp
	ID        int64
}

type UpsertProductParams

type UpsertProductParams struct {
	Name      string
	Label     string
	Category  string
	ApiUrl    string
	EolUrl    string
	CreatedAt pgtype.Timestamp
}

type User

type User struct {
	ID        int64
	Username  *string
	FirstName *string
	LastName  *string
	CreatedAt pgtype.Timestamp
}

type WatchList

type WatchList struct {
	ID        int32
	ChatID    int64
	ProductID int32
	CreatedAt pgtype.Timestamp
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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