orm

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInstance

func AddInstance(dbServer, dbName, username, password string, maxConnNum int, owner string) (err error)

func DelInstance

func DelInstance(owner string)

func GetFilter

func GetFilter(provider provider.Provider) model.Filter

func Initialize

func Initialize()

Initialize InitOrm

func NewConfig

func NewConfig(dbAddress, dbName, username, password string) executor.Config

func NewExecutor

func NewExecutor(cfgPtr executor.Config) (executor.Executor, error)

NewExecutor NewExecutor

func NewPool

func NewPool() executor.Pool

NewPool new executor pool

func Uninitialize

func Uninitialize()

Uninitialize Uninitialize orm

Types

type Orm

type Orm interface {
	Create(entity model.Model) error
	Drop(entity model.Model) error
	Insert(entity model.Model) (model.Model, error)
	Update(entity model.Model) (model.Model, error)
	Delete(entity model.Model) (model.Model, error)
	Query(entity model.Model) (model.Model, error)
	Count(entity model.Model, filter model.Filter) (int64, error)
	BatchQuery(entity model.Model, filter model.Filter) ([]model.Model, error)
	BeginTransaction() error
	CommitTransaction() error
	RollbackTransaction() error
	Release()
}

Orm orm interface

func GetOrm

func GetOrm(provider provider.Provider) (ret Orm, err error)

GetOrm get orm from pool

func NewOrm

func NewOrm(provider provider.Provider, cfg executor.Config) (Orm, error)

NewOrm create new Orm

Jump to

Keyboard shortcuts

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