sqlweld 0.2.0

Create SQL files from templates and partials
Documentation
1
2
3
4
5
6
7
8
9
10
{%- macro perm_check(user="$[user_id]", team="$[team_id]", action="'read'", table) -%}
EXISTS (
  SELECT 1
  FROM permissions
  WHERE user_id = {{ user }}
  AND team_id = {{ team }}
  AND action = {{ action }}
  AND object_type = {{table}}
)
{%- endmacro perm_check -%}