queries

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOrUpdateGroupParams

type CreateOrUpdateGroupParams struct {
	ID             int64
	Greeting       nan.NullString
	Questions      queries_types.QuestionsDB
	BanUrl         nan.NullBool
	BanQuestion    nan.NullBool
	BanTimeout     nan.NullInt32
	IgnoreDomain   []string
	BanEmojiiCount nan.NullInt32
}

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 GetGroupRow

type GetGroupRow struct {
	BanQuestion    nan.NullBool
	BanUrl         nan.NullBool
	Greeting       nan.NullString
	Questions      queries_types.QuestionsDB
	BanTimeout     nan.NullInt32
	IgnoreDomain   []string
	BanEmojiiCount nan.NullInt32
}

type Group

type Group struct {
	// id.
	ID int64
	// Greeting.
	Greeting nan.NullString
	// Questions and answers.
	Questions queries_types.QuestionsDB
	// Ban by postings urls and forwards.
	BanUrl nan.NullBool
	// Ban by question.
	BanQuestion nan.NullBool
	// Ban delay after question
	BanTimeout     nan.NullInt32
	IgnoreDomain   []string
	BanEmojiiCount nan.NullInt32
}

Group data.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateOrUpdateGroup

func (q *Queries) CreateOrUpdateGroup(ctx context.Context, arg CreateOrUpdateGroupParams) error

func (*Queries) GetGroup

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

func (*Queries) GetGroups added in v1.6.6

func (q *Queries) GetGroups(ctx context.Context) ([]int64, error)

func (*Queries) WithTx

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

Jump to

Keyboard shortcuts

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