haorm

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

haorm

orm框架by Go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestDialect, _ = dialect.GetDialect("mysql")

Functions

func DbTest

func DbTest()

Types

type Account

type Account struct {
	ID          int `haorm:"PRIMARY KEY"`
	UserName    string
	UserAccount string
	Password    string
	CreateDate  time.Time
	UpdateDate  time.Time
}

func (*Account) AfterQuery

func (ac *Account) AfterQuery(s *haosession.Session) error

func (*Account) BeforeInsert

func (ac *Account) BeforeInsert(s *haosession.Session) error

type Engine

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

自定义orm的主要入口,用于配置各种数据库

func NewEngine

func NewEngine(driver, source string, idleNum, maxConnect int, idleTimeout, liveTimeout time.Duration, dbName string) (e *Engine, err error)

func (*Engine) Close

func (engine *Engine) Close()

func (*Engine) NewSession

func (enginde *Engine) NewSession() *session.Session

func (*Engine) Transation

func (engine *Engine) Transation(f TxFunc) (result interface{}, err error)

type Test

type Test struct {
	Name string `haorm:"PRIMARY KEY"`
	Age  int
}

type Test1

type Test1 struct {
	Name string `haorm:"PRIMARY KEY"`
	Age  int
}

type TxFunc

type TxFunc func(*session.Session) (interface{}, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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