Documentation ¶
Index ¶
- func Migrate(databaseURL string) error
- func NewPGStore(ctx context.Context, databaseURL string) (userz.Store, error)
- type PGCondition
- type PGIterator
- type PGPooledConn
- func (c *PGPooledConn) Begin(ctx context.Context) (pgx.Tx, error)
- func (c *PGPooledConn) Exec(ctx context.Context, statement string, params ...interface{}) (pgconn.CommandTag, error)
- func (c *PGPooledConn) Prepare(ctx context.Context, name, statement string) (*pgconn.StatementDescription, error)
- func (c *PGPooledConn) Query(ctx context.Context, statement string, params ...interface{}) (pgx.Rows, error)
- func (c *PGPooledConn) QueryRow(ctx context.Context, statement string, params ...interface{}) pgx.Row
- type PGStore
- func (s *PGStore) Add(ctx context.Context, user *userz.UserData) (*userz.User, error)
- func (s *PGStore) List(ctx context.Context, filter *userz.Filter, pageSize uint) (userz.Iterator[[]*userz.User], error)
- func (s *PGStore) Page(ctx context.Context, filter *userz.Filter, params *userz.PageParams) ([]*userz.User, error)
- func (s *PGStore) Remove(ctx context.Context, id string) (*userz.User, error)
- func (s *PGStore) Update(ctx context.Context, id string, user *userz.UserData) (*userz.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PGCondition ¶
type PGCondition[T userz.Conditionable] userz.Cond[T]
type PGIterator ¶
type PGIterator struct {
// contains filtered or unexported fields
}
func (*PGIterator) Len ¶
func (i *PGIterator) Len() userz.PaginationData
type PGPooledConn ¶
type PGPooledConn struct {
// contains filtered or unexported fields
}
PGPooledConn wraps a github.com/jackc/pgx/v4/pgxpool.Pool and implements the db interface.
func (*PGPooledConn) Exec ¶
func (c *PGPooledConn) Exec(ctx context.Context, statement string, params ...interface{}) (pgconn.CommandTag, error)
func (*PGPooledConn) Prepare ¶
func (c *PGPooledConn) Prepare(ctx context.Context, name, statement string) (*pgconn.StatementDescription, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.