andrewpillar / query

Simple Query Builder for PostgreSQL - WIP

Home Page:https://andrewpillar.com/programming/2019/07/13/orms-and-query-building-in-go/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support expr

liyongjing opened this issue · comments

I want add basic expr such as NotEq, NotLike,Lt,LtOrEq,Gt, GtOrEq etc
one api definition such as

func WhereLike(col string, val interface{}) Option{}
func WhereEq(col string, val interface{}) Option {}
func WhereNotEq(col string, val interface{}) Option {}

one api defintion such as

const (
	OpEq   = "="
	OpGt   = ">"
	OpGtOrEq = ">="
	OpLt   = "<"
	OpLike = "LIKE"
)
func Where(col string, op string, val interface{}) Option {}

which?

Which is better for public api defintion? internal implement separately with basic operators and complexity operators.