queries

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MIT Imports: 3 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    sql.NullString
	Questions   queries_types.QuestionsDB
	BanUrl      sql.NullBool
	BanQuestion sql.NullBool
	BanTimeout  sql.NullInt32
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetGroupRow

type GetGroupRow struct {
	BanQuestion sql.NullBool
	BanUrl      sql.NullBool
	Greeting    sql.NullString
	Questions   queries_types.QuestionsDB
	BanTimeout  sql.NullInt32
}

type Group

type Group struct {
	// id.
	ID int64
	// Greeting.
	Greeting sql.NullString
	// Questions and answers.
	Questions queries_types.QuestionsDB
	// Ban by postings urls and forwards.
	BanUrl sql.NullBool
	// Ban by question.
	BanQuestion sql.NullBool
	// Ban delay after question
	BanTimeout sql.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) WithTx

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

Jump to

Keyboard shortcuts

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