postgres

package
v0.0.0-...-26b8432 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddParams

type AddParams struct {
	FirstName sql.NullString
	LastName  sql.NullString
	Nickname  string
	Password  []byte
	Email     string
	Country   sql.NullString
}

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) Add

func (q *Queries) Add(ctx context.Context, arg AddParams) (User, error)

func (*Queries) Get

func (q *Queries) Get(ctx context.Context, id uuid.UUID) (User, error)

func (*Queries) Remove

func (q *Queries) Remove(ctx context.Context, id uuid.UUID) (User, error)

func (*Queries) Update

func (q *Queries) Update(ctx context.Context, arg UpdateParams) (User, error)

func (*Queries) WithTx

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

type UpdateParams

type UpdateParams struct {
	ID        uuid.UUID
	FirstName sql.NullString
	LastName  sql.NullString
	Nickname  string
	Password  []byte
	Email     string
	Country   sql.NullString
}

type User

type User struct {
	ID        uuid.UUID
	FirstName sql.NullString
	LastName  sql.NullString
	Nickname  string
	Password  []byte
	Email     string
	Country   sql.NullString
	CreatedAt sql.NullTime
	UpdatedAt sql.NullTime
}

Jump to

Keyboard shortcuts

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