grpcusersql

package
v0.0.0-...-8bea463 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 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 ListParams

type ListParams struct {
	Offset int32
	Limit  int32
}

type Querier

type Querier interface {
	Count(ctx context.Context) (int64, error)
	GetByEmail(ctx context.Context, email string) (*User, error)
	GetByExternalID(ctx context.Context, externalID string) (*User, error)
	GetByID(ctx context.Context, id uuid.UUID) (*User, error)
	List(ctx context.Context, arg ListParams) ([]*User, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) Count

func (q *Queries) Count(ctx context.Context) (int64, error)

func (*Queries) GetByEmail

func (q *Queries) GetByEmail(ctx context.Context, email string) (*User, error)

func (*Queries) GetByExternalID

func (q *Queries) GetByExternalID(ctx context.Context, externalID string) (*User, error)

func (*Queries) GetByID

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

func (*Queries) List

func (q *Queries) List(ctx context.Context, arg ListParams) ([]*User, error)

func (*Queries) WithTx

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

type User

type User struct {
	ID         uuid.UUID
	Email      string
	Name       string
	ExternalID string
}

Jump to

Keyboard shortcuts

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