pgx

package
v0.0.0-...-3010e5a Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilReference = errors.New("unexpectedly got nil reference in storage")
)

Functions

This section is empty.

Types

type Store

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

Store is postgres storage.

func New

func New(cli pgx.Client) (*Store, error)

New return storage with provided client

func (*Store) CreateRecord

func (str *Store) CreateRecord(ctx context.Context, record *model.Record) error

func (*Store) GetCountOfRecords

func (str *Store) GetCountOfRecords(ctx context.Context) (res int64, err error)

func (*Store) GetRecord

func (str *Store) GetRecord(ctx context.Context, id int64) (rec *model.Record, err error)

func (*Store) GetUserRecords

func (str *Store) GetUserRecords(ctx context.Context, user string) ([]model.UsersRecord, error)

func (*Store) GetUsers

func (str *Store) GetUsers(ctx context.Context) ([]string, error)

Jump to

Keyboard shortcuts

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