orm

package
v1.3.78 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDatabase added in v1.3.2

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

func DelDatabase added in v1.3.2

func DelDatabase(owner string)

func Initialize

func Initialize()

Initialize InitOrm

func NewConfig

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

func NewExecutor

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

NewExecutor NewExecutor

func NewPool

func NewPool() executor.Pool

NewPool new executor pool

func Uninitialized added in v1.3.0

func Uninitialized()

Uninitialized 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(filter model.Filter) (int64, error)
	BatchQuery(filter model.Filter) ([]model.Model, error)
	BeginTransaction() error
	CommitTransaction() error
	RollbackTransaction() error
	Release()
}

Orm orm interface

func GetOrm

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

GetOrm get orm from pool

func NewOrm

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

NewOrm create new Orm

Jump to

Keyboard shortcuts

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