I am making a map using layers stored in a PostgreSQL (PostGIS) database. I am using GeoServer to successfully load layers with Leaflet in WFS format, but I wonder how to make SQL request on it through my JavaScript code.
How can I do that ? Or more generally, how can I can simply connect to a PG database within a JS script ?