Handle variables with composite types
Problem
Right now is not possible to get a composite type members.
Solution
Support mustache dotted names https://github.com/mustache/spec/blob/master/specs/interpolation.yml#L162-L167 like so:
create function print_person(p person) returns text as $$
Hello, {{p.name}} {{p.lastname}}
$$ language plmustache;
It would be much easier to handle this if mustache-c sent us an array of cstrings with the dotted names..
Upstreaming a feature like that into mustache-c might be trouble because it would be a breaking change. Right now it sends dotted names as a long name.
Could be done on our fork though: https://github.com/PostgREST/mustache-c
Maybe I'll proceed with sections now, according to the spec dotted names are a shorthand for sections:
https://github.com/mustache/spec/blob/master/specs/interpolation.yml#L142-L148