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 to use Select with a custom function #1247

Open
cruvie opened this issue Jan 4, 2025 · 0 comments
Open

how to use Select with a custom function #1247

cruvie opened this issue Jan 4, 2025 · 0 comments

Comments

@cruvie
Copy link

cruvie commented Jan 4, 2025

Your Question

how to use func (n nearbyUserDo) Select(conds ...field.Expr) INearbyUserDo and
func (INearbyUserDo) Where(conds ...gen.Condition) INearbyUserDo to implement this

select ST_distance(location,ST_GeometryFromText('POINT(100 120)')) as distance from table1
where st_dwithin(location, ST_SetSRID(ST_MakePoint(?, ?), 4326), ?)

The document you expected this should be explained

https://gorm.io/zh_CN/gen/query.html#%E6%96%B0%E5%BB%BA%E5%AD%97%E6%AE%B5

Expected answer

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