xorm
xorm copied to clipboard
how to open session autoclose flag with xorm.engine
now i used engine.Where("") to create an autoclose session.
but, the souce looks not very good. does any suggestions for this?
if has some function like:
engine.NewAutoCloseSession()
or
session.AutoClose()
that is great!
It's unnecessary to close session manually if you use engine.Where.... Only when you use sess := engine.NewSession(), you should ensure you revoked sess.Close() before you leave the scope.