orm

package
v1.3.35 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertAndReturnSlice added in v1.2.0

func AssertAndReturnSlice(targetType reflect.Type, value interface{}, e error) ([]interface{}, error)

Types

type ORM

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

ORM struct encapsulates the metadata and methods for a table.

func Load

func Load(entity any) *ORM

Load initializes the ORM with the given struct.

func (*ORM) GetAll

func (o *ORM) GetAll() (any, error)

GetAll fetches all rows from the table.

func (*ORM) GetByFieldCompare added in v1.2.0

func (o *ORM) GetByFieldCompare(fieldName string, value any, operator string) (any, error)

func (*ORM) GetByFieldEquals added in v1.2.0

func (o *ORM) GetByFieldEquals(fieldName string, value any) (any, error)

func (*ORM) GetByFieldGreaterThan added in v1.2.0

func (o *ORM) GetByFieldGreaterThan(fieldName string, value any) (any, error)

func (*ORM) GetByFieldGreaterThanEquals added in v1.2.0

func (o *ORM) GetByFieldGreaterThanEquals(fieldName string, value any) (any, error)

func (*ORM) GetByFieldIn added in v1.2.0

func (o *ORM) GetByFieldIn(fieldName string, values []any) (any, error)

func (*ORM) GetByFieldLessThan added in v1.2.0

func (o *ORM) GetByFieldLessThan(fieldName string, value any) (any, error)

func (*ORM) GetByFieldLessThanEquals added in v1.2.0

func (o *ORM) GetByFieldLessThanEquals(fieldName string, value any) (any, error)

func (*ORM) GetByFieldLike added in v1.2.0

func (o *ORM) GetByFieldLike(fieldName string, value any) (any, error)

func (*ORM) GetByPrimaryKey

func (o *ORM) GetByPrimaryKey(key string) (any, error)

GetByPrimaryKey fetches a row by its primary key.

func (*ORM) GetCount added in v1.2.0

func (o *ORM) GetCount(fieldName string, value any, operator string) (int, error)

func (*ORM) Insert

func (o *ORM) Insert(entity any) error

Insert inserts a new row into the table.

func (*ORM) Update

func (o *ORM) Update(entity any, primaryKeyValue string) error

Update updates an existing row in the table.

Jump to

Keyboard shortcuts

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