I have an app written in TS with a PostgreSQL database that I access using Prisma. In the database I have a table called Points
with columns X
and Y
that represents points on the cartesian plane. I need to write a query that given point (x_p, y_p)
and radius R
will return all points within the radius. I’d rather avoid writing raw query, so I am looking for a solution using Prisma query(edit: I cannot use PostGIS). Is it something doable with Prisma query? Thanks!
Question posted in PostgreSQL
The official documentation can be found here.
The official documentation can be found here.
2
Answers
You can try something like this:
I would just use the SQL query: