These are chat archives for directus/directus

30th
Jun 2017
Veronica Canterbury
@vimcat
Jun 30 2017 17:28
Hi all! How do I perform a custom query on my content through the api? I want to do this: SELECT id, ( 3959 acos( cos( radians(37) ) cos( radians( lat ) ) cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) sin( radians( lat ) ) ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT 0 , 20;
lat and lng are fields in the markers table
Ben Haynes
@benhaynes
Jun 30 2017 21:19
Chances are you would need to fetch all this data and then filter/limit on the server. I don't know if we have a pass-through for SQL that would allow you to send vanilla (or parameterized) queries.
Veronica Canterbury
@vimcat
Jun 30 2017 21:20
@benhaynes thanks for response, I suspected as much :)