sqlc

package
v0.0.0-...-528a66c Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 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 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 Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id int32) (User, error)

func (*Queries) GetUserByTelegramID

func (q *Queries) GetUserByTelegramID(ctx context.Context, telegramID int64) (User, error)

func (*Queries) WithTx

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

type User

type User struct {
	ID                         int32
	TelegramID                 int64
	IsBlocked                  bool
	IsSubscribedToBroadcasting bool
	CreatedAt                  pgtype.Timestamp
	UpdatedAt                  pgtype.Timestamp
}

func (*User) ToEntity

func (u *User) ToEntity() *entity.User

Jump to

Keyboard shortcuts

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