1) Remove folders that are no longer used for older database versions.

2) Fixed RESQL tests for View/MView.
This commit is contained in:
Akshay Joshi
2022-09-29 16:45:51 +05:30
parent 9817a9b20f
commit d13ee8db29
170 changed files with 410 additions and 8087 deletions

View File

@@ -1,16 +0,0 @@
{% import 'sql/macros/utils.macros' as UTILS %}
EXPLAIN ({% if format -%}
FORMAT {{ format.upper() }}
{%- endif %}{% if analyze is defined -%}
, ANALYZE {{ UTILS.BOOL_TEXT(analyze) }}
{%- endif %}{% if verbose is defined -%}
, VERBOSE {{ UTILS.BOOL_TEXT(verbose) }}
{%- endif %}{% if costs is defined -%}
, COSTS {{ UTILS.BOOL_TEXT(costs) }}
{%- endif %}{% if timing is defined -%}
, TIMING {{ UTILS.BOOL_TEXT(timing) }}
{%- endif %}{% if buffers is defined -%}
, BUFFERS {{ UTILS.BOOL_TEXT(buffers) }}
{%- endif %}{% if summary is defined -%}
, SUMMARY {{ UTILS.BOOL_TEXT(summary) }}
{%- endif %}) {{ sql }}

View File

@@ -1,14 +0,0 @@
{% import 'sql/macros/utils.macros' as UTILS %}
EXPLAIN ({% if format -%}
FORMAT {{ format.upper() }}
{%- endif %}{% if analyze is defined -%}
, ANALYZE {{ UTILS.BOOL_TEXT(analyze) }}
{%- endif %}{% if verbose is defined -%}
, VERBOSE {{ UTILS.BOOL_TEXT(verbose) }}
{%- endif %}{% if costs is defined -%}
, COSTS {{ UTILS.BOOL_TEXT(costs) }}
{%- endif %}{% if timing is defined -%}
, TIMING {{ UTILS.BOOL_TEXT(timing) }}
{%- endif %}{% if buffers is defined -%}
, BUFFERS {{ UTILS.BOOL_TEXT(buffers) }}
{%- endif %}) {{ sql }}

View File

@@ -11,4 +11,6 @@ EXPLAIN ({% if format -%}
, TIMING {{ UTILS.BOOL_TEXT(timing) }}
{%- endif %}{% if buffers is defined -%}
, BUFFERS {{ UTILS.BOOL_TEXT(buffers) }}
{%- endif %}{% if summary is defined -%}
, SUMMARY {{ UTILS.BOOL_TEXT(summary) }}
{%- endif %}) {{ sql }}

View File

@@ -19,68 +19,12 @@ from pgadmin import tools
class TestExplainPlanTemplates(BaseTestGenerator):
scenarios = [
(
'When rendering Postgres 9.0 template, '
'when passing all parameters,'
'it returns the explain plan with all parameters',
dict(
template_path='sqleditor/sql/default/explain_plan.sql',
input_parameters=dict(
sql='SELECT * FROM places',
format='xml',
analyze=True,
verbose=True,
costs=False,
buffers=True
),
sql_statement='SELECT * FROM places',
expected_return_value='EXPLAIN '
'(FORMAT XML, ANALYZE true, '
'VERBOSE true, COSTS false, '
'BUFFERS true) SELECT * FROM places'
)
),
(
'When rendering Postgres 9.0 template, '
'when not all parameters are present,'
'it returns the explain plan with the present parameters',
dict(
template_path='sqleditor/sql/default/explain_plan.sql',
input_parameters=dict(
sql='SELECT * FROM places',
format='json',
buffers=True
),
sql_statement='SELECT * FROM places',
expected_return_value='EXPLAIN '
'(FORMAT JSON, BUFFERS true) '
'SELECT * FROM places'
)
),
(
'When rendering Postgres 9.2 template, '
'when timing is present,'
'it returns the explain plan with timing',
dict(
template_path='sqleditor/sql/9.2_plus/explain_plan.sql',
input_parameters=dict(
sql='SELECT * FROM places',
format='json',
buffers=True,
timing=False
),
sql_statement='SELECT * FROM places',
expected_return_value='EXPLAIN '
'(FORMAT JSON, TIMING false, '
'BUFFERS true) SELECT * FROM places'
)
),
(
'When rendering Postgres 10 template, '
'when summary is present,'
'it returns the explain plan with summary',
dict(
template_path='sqleditor/sql/10_plus/explain_plan.sql',
template_path='sqleditor/sql/default/explain_plan.sql',
input_parameters=dict(
sql='SELECT * FROM places',
format='yaml',