mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
27 lines
1.4 KiB
Plaintext
27 lines
1.4 KiB
Plaintext
{####################################################}
|
|
{# This will be specific macro for Role objects #}
|
|
{####################################################}
|
|
{% macro APPLY(conn, database, role, param, value) -%}
|
|
ALTER {% if role %}ROLE {{ self.conn|qtIdent(role) }}{% if database %} IN DATABASE {{ conn|qtIdent(database) }}{% endif %}{% else %}DATABASE {{ conn|qtIdent(database) }}{% endif %}
|
|
|
|
SET {{ conn|qtIdent(param) }} TO {{ value|qtLiteral }};
|
|
{%- endmacro %}
|
|
{% macro RESET(conn, database, role, param) -%}
|
|
ALTER {% if role %}ROLE {{ self.conn|qtIdent(role) }}{% if database %} IN DATABASE {{ conn|qtIdent(database) }}{% endif %}{% else %}DATABASE {{ conn|qtIdent(database) }}{% endif %}
|
|
|
|
RESET {{ conn|qtIdent(param) }};
|
|
{%- endmacro %}
|
|
{################################################}
|
|
{# This will be generic macro for other objects #}
|
|
{################################################}
|
|
{% macro SET(conn, object_type, object_name, options) -%}
|
|
ALTER {{object_type}} {{ conn|qtIdent(object_name) }}
|
|
SET ({% for opt in options %}{% if loop.index != 1 %}
|
|
, {% endif %}{{ conn|qtIdent(opt.name) }}={{ opt.value }}{% endfor %});
|
|
{%- endmacro %}
|
|
{% macro UNSET(conn, object_type, object_name, options) -%}
|
|
ALTER {{object_type}} {{ conn|qtIdent(object_name) }}
|
|
RESET ({% for opt in options %}{% if loop.index != 1 %}
|
|
, {% endif %}{{ conn|qtIdent(opt.name) }}{% endfor %});
|
|
{%- endmacro %}
|