-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support expr #2
Comments
const (
OpEq = "="
OpGt = ">"
OpGtOrEq = ">="
OpLt = "<"
OpLike = "LIKE"
)
func Where(col string, op string, val interface{}) Option {}
How would this work for WHERE clauses that use "IN"?
|
Which is better for public api defintion? internal implement separately with basic operators and complexity operators. |
Which is better for public api defintion?
How about implement the new API, but keep the old public API just as a
wrapper around the new one. Something like this:
```
type Op string
const (
OpEq Op = "="
)
func Where(col string, op Op, val interface{}) Option {}
func WhereEq(col string, val interface{}) Option {
return Where(col, OpEq, val)
}
```
Also, how about making the `op` passed to the `Where` function its own
type? I prefer the explicitness that comes with this.
We could also add another function called `WhereRaw` for handling
values for the query we don't want to use bindvars for.
```
func WhereRaw(col string, op Op, val interface{}) Option {}
```
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want add basic expr such as NotEq, NotLike,Lt,LtOrEq,Gt, GtOrEq etc
one api definition such as
one api defintion such as
which?
The text was updated successfully, but these errors were encountered: