plmustache
plmustache copied to clipboard
Logic-less templates for Postgres
Since it doesn't make sense to load partials from file, it would be great if other functions could be called via partials: ```sql create or replace function hello() returns text...
## Problem As it can be seen on https://github.com/PostgREST/plmustache?tab=readme-ov-file#sections, regular syntax highlighting for mustache files doesn't work. ## Solution Add a `psql` command that can obtain the function body from...
Maybe just combine the [mustache logo](https://mustache.github.io/) with [slonik logo](https://wiki.postgresql.org/wiki/Logo).
WIP. Quick and dirty implementation. Closes https://github.com/PostgREST/plmustache/issues/6 ## TODO - [x] More tests - [x] Handle empty array - [ ] Test for multidimensional arrays - [ ] Refactor
## Problem The single quote `'` should be escaped. This is not on the mustache spec but most implementations have it. Also the mustache spec maintainers are open to add...
## 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: ```sql create function print_person(p person) returns text as...
Should be like: ```sql create type person (name text, lastname text); create or replace function hello(p person) returns text as $$ Hello, {{#p}} {{name}} {{/p}} $$ language plmustache; select hello('(John,Doe)');...
Should be like: ```sql create or replace function hello(xs text[]) returns text as $$ Hello, {{#xs}} {{.}} {{/xs}} $$ language plmustache; select hello(ARRAY['a', 'b', 'c']); Hello a b c ```...
## Problem To compile, right now I do: ``` $ nix-shell ``` And to recompile: ``` $ $ nix-shell # again ``` ## Proposal Similarly to the postgrest repo, a:...
BEGIN ATOMIC works like this right now: ```sql create table person ( firstname text, lastname text ); create function foo(person) returns text begin atomic select $1.firstname || $1.lastname; end; select...