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

How can I query array type in pgsql #4040

Open
shenghui0779 opened this issue Apr 30, 2024 · 1 comment
Open

How can I query array type in pgsql #4040

shenghui0779 opened this issue Apr 30, 2024 · 1 comment

Comments

@shenghui0779
Copy link

eg:

select * from post where 1 = ANY(tag);
@shenghui0779
Copy link
Author

shenghui0779 commented Apr 30, 2024

This can be solved. Is there any other way?

data, err := db.Client().Post.Query().Unique(false).Where(func(s *sql.Selector) {
    s.Where(sql.ExprP("1=ANY(path)"))
}).All(ctx)

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

No branches or pull requests

1 participant