dboptions

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field string

func NewField

func NewField(f string) Field

func (Field) IsEmpty

func (f Field) IsEmpty() bool

func (Field) Normalize

func (f Field) Normalize() Field

func (Field) Parts

func (f Field) Parts() []string

func (Field) String

func (f Field) String() string

func (Field) ToCamel

func (f Field) ToCamel() string

func (Field) ToSnake

func (f Field) ToSnake() string

type Fields

type Fields []Field

func NewFields

func NewFields(fields []string) Fields

func (*Fields) Add

func (l *Fields) Add(in ...Field) bool

func (Fields) Has

func (l Fields) Has(in ...Field) bool

func (Fields) IsEmpty

func (l Fields) IsEmpty() bool

func (Fields) ToCamelStrings

func (l Fields) ToCamelStrings() []string

func (Fields) ToSnakeStrings

func (l Fields) ToSnakeStrings() []string

type Option

type Option func(o *Options)

func LockingFoUpdateOption

func LockingFoUpdateOption() Option

func SavingFieldsOption

func SavingFieldsOption(fields ...Field) Option

func WithRelationsOption

func WithRelationsOption(relations ...Field) Option

type Options

type Options struct {
	LockingForUpdate bool
	SavingFields     Fields
	WithRelations    Fields
}

func BuildOptions

func BuildOptions(opts []Option) *Options

type Order

type Order struct {
	Field Field `json:"field"`
	Desc  bool  `json:"desc"`
}

type Pagination

type Pagination struct {
	Page uint32
	Size uint32
}

func (Pagination) Limit

func (p Pagination) Limit() int

func (Pagination) Offset

func (p Pagination) Offset() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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