#YAO ###Yet Another Orm
Yao is an ORM for Golang, inspired in Laravel eloquent ORM Currently only compatible with postgresql.
go get github.com/alfonsodev/yao
yao gen -ddbname -o$(pwd)/models
Mysql:
import "github.com/youpackage/models/tablename"
Postgresql:
import "github.com/youpackage/models/schemaname/tablename"
var user Users
user.Email.Scan("yao@yao-orm.org")
user.Save()
users, err := Users.All()
for i, user := range users {
fmt.Println(user.Email.String)
}
users, err := Users.Where("Email", "LIKE", "%.edu").And("Location", "=", "Zurich").Get()