I'd like to run Postgres SQL functions within a F# Query Expression. I'd like to know if it is even possible.
My use case is that I'd like to use TimescaleDB, a time series database. I can go like this in native sql.
SELECT time_bucket('15 minutes', time) AS fifteen_min,
location, COUNT(*),
MAX(temperature) AS max_temp,
MAX(humidity) AS max_hum
FROM conditions
WHERE time > NOW() - INTERVAL '3 hours'
GROUP BY fifteen_min, location
ORDER BY fifteen_min DESC, max_temp DESC;