We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Do you had any plans to support Postgres JSON/JSONB data types? One example would be a "containment" query against JSONB structures.
JSONB
Currently I use a work around like this:
type Tag struct { Key string Value string .... } raw, _ := json.Marshal(Tag{Key: "some-key", "Value": "some-value"}) lk.Select().From("table").Where(lk.Raw(fmt.Sprintf(`tags @> '%s'`, string(raw))))
Thank you for your work on this wonderful library!
The text was updated successfully, but these errors were encountered:
At the moment, I'm afraid not... But I'll be glad to give you some pointers and any help you require to implement this type.
loukoum/stmt/expression.go
Line 293 in b658af1
You could add below a Json method that accept a JsonOp interface. Something like that:
Json
JsonOp
func (identifier Identifier) Json(op JsonOp) InfixExpression { return NewInfixExpression(identifier, op.Operator(), op.Expression()) }
Where JsonOp are all kind of JSON operation that you want to support, like containment, existence or even path traversal...
Hope that helps.
Sorry, something went wrong.
@novln Thanks for the suggestions, I will give this a shot as time permits and create a PR.
No branches or pull requests
Do you had any plans to support Postgres JSON/JSONB data types? One example would be a "containment" query against
JSONB
structures.Currently I use a work around like this:
Thank you for your work on this wonderful library!
The text was updated successfully, but these errors were encountered: