go-jet / jet

Type safe SQL builder with code generation and automatic query result data mapping
Apache License 2.0
2.52k stars 118 forks source link

It would be nice to allow internal types for building based on user input #270

Closed albulescu closed 7 months ago

albulescu commented 1 year ago
func buildWhereExpression(q any) jet.BoolExpression {}
houten11 commented 1 year ago

Is How to construct dynamic condition? what you are looking for?

albulescu commented 1 year ago

Cool, @houten11 any support for postgres jsonb like t.props->>'key' = 'value' in where clause?

houten11 commented 1 year ago

No, but you can use Raw Expressions instead:

RawBool("t.props->>'key' = 'value'") 
// or
RawBool("t.props->> $k = $v", RawArg{"$k":"key", "$v": "value"}) 
// or
RawString("t.props->> $k", RawArg{"$k":"key"}).EQ(String("value"))