You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/internal/dao/sakila/yesql/gen.go

22 lines
477 B

package main
import (
"log"
"strings"
"github.com/alimy/yesql"
)
//go:generate go run $GOFILE
func main() {
log.Println("[Yesql] generate code start")
yesql.SetDefaultQueryHook(func(query *yesql.Query) (*yesql.Query, error) {
query.Query = strings.TrimRight(query.Query, ";")
return query, nil
})
if err := yesql.Generate("yesql.sql", "cc", "cc"); err != nil {
log.Fatalf("generate code occurs error: %s", err)
}
log.Println("[Yesql] generate code finish")
}