Skip to content
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 postgresql array operators #172

Open
wexder opened this issue Aug 29, 2022 · 1 comment
Open

Support postgresql array operators #172

wexder opened this issue Aug 29, 2022 · 1 comment

Comments

@wexder
Copy link
Contributor

wexder commented Aug 29, 2022

Is your feature request related to a problem? Please describe.
We have few usecases where we need to have column as postgresql array and then filter if some item is in the array. If I'm not mistaken the only way we can currently do it in jet is like

postgres.CAST(postgres.Raw("moment.statuses @> #status", postgres.RawArgs{"#status": string(domain.MomentStatusActive)})).AS_BOOL()

Which is not nice.

Describe the solution you'd like
Support array types and array operators as like https://www.postgresql.org/docs/9.1/functions-array.html

@houten11
Copy link

+1

@wexder, your line can be simplified a bit using RawBool

RawBool("moment.statuses @> #status", postgres.RawArgs{"#status": string(domain.MomentStatusActive)})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants