pgstore

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 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 AllLinksRow

type AllLinksRow struct {
	Base string
	Url  string
}

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 Link struct {
	Base      string
	Url       string
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt sql.NullTime
}

type Queries

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

func New

func New(db DBTX) *Queries
func (q *Queries) AllLinks(ctx context.Context) ([]AllLinksRow, error)
func (q *Queries) DeleteLink(ctx context.Context, base string) error
func (q *Queries) FindLink(ctx context.Context, base string) (string, error)
func (q *Queries) UpsertLink(ctx context.Context, arg UpsertLinkParams) error

func (*Queries) WithTx

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

type UpsertLinkParams

type UpsertLinkParams struct {
	Base string
	Url  string
}

Jump to

Keyboard shortcuts

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