Skip to content

handle partials by calling other (plmustache) functions #17

@wolfgangwalther

Description

@wolfgangwalther

Since it doesn't make sense to load partials from file, it would be great if other functions could be called via partials:

create or replace function hello() returns text as $$
Hello, {{>world}}
$$ language plmustache;

create or replace function world() returns text as $$
World
$$ language plmustache;

select hello();
Hello, World

It should even be possible to pass arguments to those functions via blocks and parents:

create or replace function hello(subject text) returns text as $$
Hello, {{subject}}
$$ language plmustache;

create or replace function hello_world() returns text as $$
{{<hello}}
  {{$subject}}World{{/subject}}
{{/hello}}
$$ language plmustache;

select hello();
Hello, World

Neither blocks, nor parents are supported by jobol/mustach, yet. I opened an issue about it.

I don't think it's possible to override the default "file loader" either, so that probably needs some changes in jobol/mustach, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions