db

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StmtBuilder = squirrel.StatementBuilder.PlaceholderFormat(squirrel.Dollar)
	Select      = StmtBuilder.Select
	Update      = StmtBuilder.Update
	Insert      = StmtBuilder.Insert
	Delete      = StmtBuilder.Delete
)
View Source
var (
	ErrInvalidMarker = errors.New("invalid marker")
)

Functions

func CheckQuota

func CheckQuota(pool PgxIface, r *http.Request, resource string) error

func GetTracer added in v1.0.1

func GetTracer() *tracelog.TraceLog

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
	/*Filter for resources belonging or accessible by a specific project.

	  Max Length: 32
	  Min Length: 32
	  In: query
	*/
	ProjectID *string
	/*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 pgxscan.Querier, q sq.SelectBuilder) (string, []any, error)

type PgxIface

type PgxIface interface {
	Begin(context.Context) (pgx.Tx, error)
	BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error)
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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