Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the main struct of geeorm, manages all db sessions and transactions.
func NewEngine ¶
NewEngine create a instance of Engine connect database and ping it to test whether it's alive.
func (*Engine) NewSession ¶
NewSession creates a new session for next operations (recommend assigning a data model). QEMU Virtual CPU version 2.5+ eg: engine.NewSession().SetModel(&User{}) Benchmark-1 736880 1389 ns/op 904 B/op 17 allocs/op Benchmark-2 801439 1292 ns/op 904 B/op 17 allocs/op eg: engine.NewSession(&User{}) Benchmark-1 5557647 215.2 ns/op 160 B/op 3 allocs/op Benchmark-2 6056534 202.6 ns/op 160 B/op 3 allocs/op