db

package
v0.0.0-...-51b8a26 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 FindFoodPostsByDateRangeParams

type FindFoodPostsByDateRangeParams struct {
	FromTs  pgtype.Timestamp
	UntilTs pgtype.Timestamp
}

type FoodPost

type FoodPost struct {
	MessageID   int64
	PostTs      pgtype.Timestamp
	PhotoKey    string
	CaptionText string
	Raw         []byte
}

type InsertFoodPostParams

type InsertFoodPostParams struct {
	MessageID   int64
	PostTs      pgtype.Timestamp
	PhotoKey    string
	CaptionText string
	Raw         []byte
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) FindFoodPostByMessageId

func (q *Queries) FindFoodPostByMessageId(ctx context.Context, messageID int64) (FoodPost, error)

func (*Queries) FindFoodPostsByDateRange

func (q *Queries) FindFoodPostsByDateRange(ctx context.Context, arg FindFoodPostsByDateRangeParams) ([]FoodPost, error)

func (*Queries) InsertFoodPost

func (q *Queries) InsertFoodPost(ctx context.Context, arg InsertFoodPostParams) (int64, error)

func (*Queries) UpdateFoodPostSetPhoto

func (q *Queries) UpdateFoodPostSetPhoto(ctx context.Context, arg UpdateFoodPostSetPhotoParams) (int64, error)

func (*Queries) WithTx

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

type UpdateFoodPostSetPhotoParams

type UpdateFoodPostSetPhotoParams struct {
	MessageID int64
	PhotoKey  string
}

Jump to

Keyboard shortcuts

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