| OpenResty documentation | view source | Contained in the OpenResty distribution. |
OpenResty::Handler::CompiledView - Handler for pre-compiled views
It loads compiled.views file from etc/ or /etc/openresty/ (in such an order).
A sample compiled.views looks like this:
use OpenResty::QuasiQuote::SQL;
{
'yquestion|getquery' => [
{ _user => 'yquestion.Public' },
sub {
my ($openresty, $vars) = @_;
#$resty->set_use
my $query = $vars->{spell};
return [:sql|select * from getquery($query) as (query text, pop integer, des text) limit 10 |];
}
],
}
Agent Zhang (agentzh) <agentzh@yahoo.cn>
| OpenResty documentation | view source | Contained in the OpenResty distribution. |