The name of this branch is a misnomer -- I haven't implemented the "get all rows" feature yet. Instead, this is work I'm doing in preparation for that feature.
Summary
Added a new internal data structure, a "query spec," that is a standardized serialization of the arguments to aw_freeform_table(). The idea is to capture those arguments, straighten them out a little (recycling to the right lengths, etc.), and then pass that structure around.
For the query spec data structure, I added a set of "getters" to access different elements. This way, if we modify the underlying data structure, we only have to change the getters, not any other functions. All are prefixed with qs_, e.g. qs_dimensions(q) will return the full list of dimensions for the query.
Along with the new structure, there are tests to guarantee the getters work consistently.
This is going towards a simpler, more digestible implementation. Once we have that, we can extend features more easily.
I did not try to implement the "all rows" feature yet. This is a little tricky, because of how it interacts with the recursive nature of the function. Hence, simplifying things is where I wanted to start.
For more, read the descriptions of the commits.
Checklist
[x] R CMD Check ran with 0 errors, 0 warnings, and 0 notes
[x] I ran a smattering of queries (I actually wrote a script to generate a ton of different queries) to check for errors. I spot-checked specific queries to ensure they worked as before.
The name of this branch is a misnomer -- I haven't implemented the "get all rows" feature yet. Instead, this is work I'm doing in preparation for that feature.
Summary
aw_freeform_table()
. The idea is to capture those arguments, straighten them out a little (recycling to the right lengths, etc.), and then pass that structure around.qs_
, e.g.qs_dimensions(q)
will return the full list of dimensions for the query.This is going towards a simpler, more digestible implementation. Once we have that, we can extend features more easily.
I did not try to implement the "all rows" feature yet. This is a little tricky, because of how it interacts with the recursive nature of the function. Hence, simplifying things is where I wanted to start.
For more, read the descriptions of the commits.
Checklist