Add FDW selector that queries a separate schema
On the assumption that the ClickHouse foreign tables would be imported into a schema named uk, add an additional option to the database selector, "fdw".
Change the selector code to set the value to "fdw" when appropriate.
In runQuery(), replace FROM uk with FROM uk.uk or FROM public.uk in the query when the database choice is "fdw", and change getQuery() to also recognize "uk" as an option.
Long term we might want to make the schema choice a parameter when formatting queries, but this seemed like the simplest way to start. FWIW I tried setting the search path for every query, but it got super slow after the first load.
Also add support for querying the large dataset via the FDW. Currently dupes the regular Postgres queries but replaces the some of the table names to use the ClickHouse materialized views.
Update the SelectArea() function to enable the medium/large buttons for both FDW and CLickHouse, and update getQuery() to fetch the large FDW queries when wanted.
Add DDL to schemas/postgres.sql to create the clickhouse_fdw extension and import the tables from the demo database so that they're accessible to HouseClick. This won't work without clickhouse_fdw, so add a placeholder to README.md for forthcoming installation instructions.
While at it, remove some trailing spaces from files and restore the EXTRACT() function to the Postgres queries, since it was fixed by ClickHouse/clickhouse_fdw#31.
@theory is attempting to deploy a commit to the ClickHouse Team on Vercel.
A member of the Team first needs to authorize it.