When creating pages from a single query, currently data that is required for any parameter value is included in all the pages.
This causes multiple issues:
+1, I am working with a large database of country related data, and each page should show only a single country's data. As filtering is done only as a very last step on the client, the data is 200x larger than it could be. Any chance this will be tackled soon?
Hey @MoritzStefaner
An unlock for this we think is in #294, adding support for Frontmatter, as this at least gives users a place to define global filters they would want every query to be filtered by.
That issue is up in the next cycle for us, so we hope to have that done "soon".
Then we're in a good place to get this issue started! There are a couple of things we'd need to iron out, off the top of my head these are:
SELECT * FROM existing_query WHERE column = condition
Hi, interesting! Yes, that makes a lot of sense and would be quite convenient.
The simpler version I had in mind was to be able to use the page parameters also in the SQL queries, a la
select
count(*) as num_events
from events
where country = {$page.params.country}
but probably that collides with when those clauses are rendered?
I can see why that would be convenient too.
As you say there are some implementation details that make this slightly tricky, but it's useful to know that's how you'd expect this to work.
I can also see scenarios where you wouldn't want to filter every query on a page by the condition. E.g. maybe one of the queries on the page shows a country in comparison to other countries, whereas the rest only contain country data
I can also see scenarios where you wouldn't want to filter every query on a page by the condition. E.g. maybe one of the queries on the page shows a country in comparison to other countries, whereas the rest only contain country data
Right!