Disconnect DataSets from Datasources
Disconnect DataSets from Datasources. If we could create a dataset seperately (Like we do with Query Tags) we could have datasets defined in the template itself and not in the datasources. This allows us to change the datasource when generating the template on the Staging or Prod machines and still have the same subset of data selected.
It would make templates much more reusable as we could define a handful of more general datasources and limit the data requested by using DataSets in the templates.
We have reviewed this idea and accepted it for future development. We will come up with a solution where you specify in the Engine to use the Dataset defined in the template instead of specifying the same query in the Engine. This way, changes made to the Dataset in the template can be used in the Engine at runtime without you needing to update the query somewhere in the Engine, but rather just by updating the template.
If this solution does not solve your problem, please let me know. Thank you for your idea and please submit any other ideas you have to improve our software.
Alexandre Giard commented
Both the staging and the production datasources have the same structures. What I was trying to achieve is to have the Dataset on the Template so that, no matter what connection is supplied, it "filters" to the requested Data. Right now, since the Dataset can only be set on the Datasource object that is provided at runtime, I'd need to keep the Dataset logic outside of the template itself.
Ideally, I would just need to provide the connection info to the template at runtime and the template would connect to the Datasource and then pass that through to the DataSet. In practice, we could compare this in some ways to the facade pattern where the template just want to know where to connect to and then filters it's data as it expects it to be structured.