orm

package
v1.3.171 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 11 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 *cd.Result)

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, *cd.Result)

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 CountRunner added in v1.3.147

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

func NewCountRunner added in v1.3.147

func NewCountRunner(
	vModel model.Model,
	executor executor.Executor,
	provider provider.Provider,
	modelCodec codec.Codec) *CountRunner

func (*CountRunner) Count added in v1.3.147

func (s *CountRunner) Count(vFilter model.Filter) (ret int64, err *cd.Result)

type CreateRunner added in v1.3.147

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

func NewCreateRunner added in v1.3.147

func NewCreateRunner(vModel model.Model, executor executor.Executor, provider provider.Provider, modelCodec codec.Codec) *CreateRunner

func (*CreateRunner) Create added in v1.3.147

func (s *CreateRunner) Create() (err *cd.Result)

type DeleteRunner added in v1.3.147

type DeleteRunner struct {
	QueryRunner
	// contains filtered or unexported fields
}

func NewDeleteRunner added in v1.3.147

func NewDeleteRunner(
	vModel model.Model,
	executor executor.Executor,
	provider provider.Provider,
	modelCodec codec.Codec,
	deepLevel int) *DeleteRunner

func (*DeleteRunner) Delete added in v1.3.147

func (s *DeleteRunner) Delete() (err *cd.Result)

type DropRunner added in v1.3.147

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

func NewDropRunner added in v1.3.147

func NewDropRunner(vModel model.Model, executor executor.Executor, provider provider.Provider, modelCodec codec.Codec) *DropRunner

func (*DropRunner) Drop added in v1.3.147

func (s *DropRunner) Drop() (err *cd.Result)

type InsertRunner added in v1.3.147

type InsertRunner struct {
	QueryRunner
	// contains filtered or unexported fields
}

func NewInsertRunner added in v1.3.147

func NewInsertRunner(
	vModel model.Model,
	executor executor.Executor,
	provider provider.Provider,
	modelCodec codec.Codec) *InsertRunner

func (*InsertRunner) Insert added in v1.3.147

func (s *InsertRunner) Insert() (ret model.Model, err *cd.Result)

type Orm

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

Orm orm interface

func GetOrm

func GetOrm(provider provider.Provider, prefix string) (ret Orm, err *cd.Result)

GetOrm get orm from pool

func NewOrm

func NewOrm(provider provider.Provider, cfg executor.Config, prefix string) (Orm, *cd.Result)

NewOrm create new Orm

type QueryRunner added in v1.3.147

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

func NewQueryRunner added in v1.3.147

func NewQueryRunner(
	vModel model.Model,
	executor executor.Executor,
	provider provider.Provider,
	modelCodec codec.Codec,
	batchFilter bool,
	deepLevel int) *QueryRunner

func (*QueryRunner) Query added in v1.3.147

func (s *QueryRunner) Query(filter model.Filter) (ret []model.Model, err *cd.Result)

type UpdateRunner added in v1.3.147

type UpdateRunner struct {
	QueryRunner
	InsertRunner
	DeleteRunner
	// contains filtered or unexported fields
}

func NewUpdateRunner added in v1.3.147

func NewUpdateRunner(
	vModel model.Model,
	executor executor.Executor,
	provider provider.Provider,
	modelCodec codec.Codec) *UpdateRunner

func (*UpdateRunner) Update added in v1.3.147

func (s *UpdateRunner) Update() (ret model.Model, err *cd.Result)

Jump to

Keyboard shortcuts

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