db

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMarker = errors.New("invalid marker")
)

Functions

func Migrate

func Migrate(dbUrl string) error

func Rollback

func Rollback(dbUrl string) error

func TxExecute

func TxExecute(db *sqlx.DB, fn func(*sqlx.Tx) error) error

TxExecute is a handy wrapper for safely executing queries inside a closure

Types

type Pagination

type Pagination struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`

	/*Sets the page size.
	  In: query
	*/
	Limit *int64
	/*Pagination ID of the last item in the previous list.
	  In: query
	*/
	Marker *strfmt.UUID
	/*Filter for resources not having tags, multiple not-tags are considered as logical AND.
	Should be provided in a comma separated list.

	  In: query
	*/
	NotTags []string
	/*Filter for resources not having tags, multiple tags are considered as logical OR.
	Should be provided in a comma separated list.

	  In: query
	*/
	NotTagsAny []string
	/*Sets the page direction.
	  In: query
	*/
	PageReverse *bool
	/*Comma-separated list of sort keys, optionally prefix with - to reverse sort order.
	  In: query
	*/
	Sort *string
	/*Filter for tags, multiple tags are considered as logical AND.
	Should be provided in a comma separated list.

	  In: query
	*/
	Tags []string
	/*Filter for tags, multiple tags are considered as logical OR.
	Should be provided in a comma separated list.

	  In: query
	*/
	TagsAny []string
}
func (p *Pagination) GetLinks(modelList any) []*models.Link

func (*Pagination) Query

func (p *Pagination) Query(db *sqlx.DB, query string, filter map[string]any) (*sqlx.Rows, error)

Query pagination helper that also includes policy query filter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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