|
77 | 77 | "execute": { |
78 | 78 | "options": [] |
79 | 79 | }, |
80 | | - "desc": { |
81 | | - "query": "select '|' || quote_ident(table_schema)||'.'||quote_ident(table_name) ||'|' as tblname from information_schema.tables where table_schema not in ('pg_catalog', 'information_schema') order by table_schema = current_schema() desc, table_schema, table_name", |
82 | | - "options": ["--tuples-only", "--no-psqlrc"] |
| 80 | + "show records": { |
| 81 | + "query": "select * from {0} limit {1};", |
| 82 | + "options": [] |
83 | 83 | }, |
84 | 84 | "desc table": { |
85 | 85 | "query": "\\d+ {0}", |
86 | 86 | "options": [] |
87 | 87 | }, |
88 | | - "show records": { |
89 | | - "query": "select * from {0} limit {1}", |
| 88 | + "desc function": { |
| 89 | + "query": "\\sf {0}", |
| 90 | + "options": [] |
| 91 | + }, |
| 92 | + "explain plan": { |
| 93 | + "query": "explain analyze {0};", |
90 | 94 | "options": [] |
91 | 95 | }, |
| 96 | + "desc": { |
| 97 | + "query": "select '|' || quote_ident(table_schema)||'.'||quote_ident(table_name) ||'|' as tblname from information_schema.tables where table_schema not in ('pg_catalog', 'information_schema') order by table_schema = current_schema() desc, table_schema, table_name;", |
| 98 | + "options": ["--tuples-only", "--no-psqlrc"] |
| 99 | + }, |
92 | 100 | "columns": { |
93 | | - "query": "select '|' || quote_ident(table_name) || '.' || quote_ident(column_name) || '|' from information_schema.columns where table_schema not in ('pg_catalog', 'information_schema') order by table_name, ordinal_position", |
| 101 | + "query": "select '|' || quote_ident(table_name) || '.' || quote_ident(column_name) || '|' from information_schema.columns where table_schema not in ('pg_catalog', 'information_schema') order by table_name, ordinal_position;", |
94 | 102 | "options": ["--tuples-only", "--no-psqlrc"] |
95 | 103 | }, |
96 | 104 | "functions": { |
97 | | - "query": "select '|' || quote_ident(n.nspname)||'.'||quote_ident(f.proname) || '(' || pg_get_function_identity_arguments(f.oid) || ')' || '|' as funname from pg_catalog.pg_proc as f inner join pg_catalog.pg_namespace as n on n.oid = f.pronamespace where f.proisagg = false and n.nspname not in ('pg_catalog', 'information_schema')", |
| 105 | + "query": "select '|' || quote_ident(n.nspname)||'.'||quote_ident(f.proname) || '(' || pg_get_function_identity_arguments(f.oid) || ')' || '|' as funname from pg_catalog.pg_proc as f inner join pg_catalog.pg_namespace as n on n.oid = f.pronamespace where f.proisagg = false and n.nspname not in ('pg_catalog', 'information_schema');", |
98 | 106 | "options": ["--tuples-only", "--no-psqlrc"] |
99 | | - }, |
100 | | - "desc function": { |
101 | | - "query": "\\sf {0}", |
102 | | - "options": [] |
103 | | - }, |
104 | | - "explain plan": { |
105 | | - "query": "explain {0};", |
106 | | - "options": [] |
107 | 107 | } |
108 | 108 | } |
109 | 109 | }, |
110 | 110 | "oracle": { |
111 | 111 | "options": ["-S"], |
112 | | - "before": [], |
| 112 | + "before": [ |
| 113 | + "SET LINESIZE 32767", |
| 114 | + "SET WRAP OFF", |
| 115 | + "SET PAGESIZE 0", |
| 116 | + "SET EMBEDDED ON", |
| 117 | + "SET TRIMOUT ON", |
| 118 | + "SET TRIMSPOOL ON", |
| 119 | + "SET TAB OFF", |
| 120 | + "SET SERVEROUT ON", |
| 121 | + "SET NULL '@'", |
| 122 | + "SET COLSEP '|'", |
| 123 | + "SET SQLBLANKLINES ON" |
| 124 | + ], |
113 | 125 | "after": [], |
114 | 126 | "env_optional": { |
115 | 127 | "NLS_LANG": "{nls_lang}" |
|
120 | 132 | "options": [], |
121 | 133 | "before": [ |
122 | 134 | // "SET TIMING ON", |
123 | | - "SET LINESIZE 32767", |
124 | | - "SET PAGESIZE 0", |
125 | | - "SET EMBEDDED ON", |
126 | | - "SET WRAP OFF", |
127 | | - "SET TAB OFF", |
128 | | - "SET TRIMOUT ON", |
129 | | - "SET TRIMSPOOL ON", |
130 | | - "SET NULL '@'", |
131 | | - "SET COLSEP '|'", |
132 | | - "SET FEEDBACK ON", |
133 | | - "SET SERVEROUT ON", |
134 | | - "SET SQLBLANKLINES ON" |
| 135 | + "SET FEEDBACK ON" |
135 | 136 | ] |
136 | 137 | }, |
137 | | - "desc" : { |
138 | | - "query": "select owner || '.' || name as obj from (select owner, table_name as name from all_tables union all select owner, view_name as name from all_views) o where owner not in ('ANONYMOUS','APPQOSSYS','CTXSYS','DBSNMP','EXFSYS', 'LBACSYS', 'MDSYS','MGMT_VIEW','OLAPSYS','OWBSYS','ORDPLUGINS', 'ORDSYS','OUTLN', 'SI_INFORMTN_SCHEMA','SYS','SYSMAN','SYSTEM', 'TSMSYS','WK_TEST','WKSYS', 'WKPROXY','WMSYS','XDB','APEX_040000', 'APEX_PUBLIC_USER','DIP', 'FLOWS_30000','FLOWS_FILES','MDDATA', 'ORACLE_OCM','SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', 'XS$NULL','PUBLIC');", |
| 138 | + "show records": { |
| 139 | + "query": "select * from {0} where rownum <= {1};", |
139 | 140 | "options": [], |
140 | 141 | "before": [ |
141 | | - "SET LINESIZE 32767", |
142 | | - "SET PAGESIZE 0", |
143 | | - "SET EMBEDDED ON", |
144 | | - "SET WRAP OFF", |
145 | | - "SET HEADING OFF", |
146 | | - "SET FEEDBACK OFF", |
147 | | - "SET TRIMOUT ON" |
| 142 | + "SET FEEDBACK ON" |
148 | 143 | ] |
149 | 144 | }, |
150 | | - "columns": { |
151 | | - "query": "select table_name || '.' || column_name as obj from (select c.table_name, c.column_name, t.owner from all_tab_columns c inner join all_tables t on c.owner = t.owner and c.table_name = t.table_name union all select c.table_name, c.column_name, t.owner from all_tab_columns c inner join all_views t on c.owner = t.owner and c.table_name = t.view_name) o where owner not in ('ANONYMOUS','APPQOSSYS','CTXSYS','DBSNMP','EXFSYS', 'LBACSYS', 'MDSYS','MGMT_VIEW','OLAPSYS','OWBSYS','ORDPLUGINS', 'ORDSYS','OUTLN', 'SI_INFORMTN_SCHEMA','SYS','SYSMAN','SYSTEM', 'TSMSYS','WK_TEST','WKSYS', 'WKPROXY','WMSYS','XDB','APEX_040000', 'APEX_PUBLIC_USER','DIP', 'FLOWS_30000','FLOWS_FILES','MDDATA', 'ORACLE_OCM','SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', 'XS$NULL','PUBLIC');", |
| 145 | + "desc table": { |
| 146 | + "query": "desc {0};", |
152 | 147 | "options": [], |
153 | 148 | "before": [ |
154 | | - "SET LINESIZE 32767", |
155 | | - "SET PAGESIZE 0", |
156 | | - "SET EMBEDDED ON", |
157 | | - "SET WRAP OFF", |
158 | | - "SET HEADING OFF", |
159 | | - "SET FEEDBACK OFF", |
160 | | - "SET TRIMOUT ON" |
| 149 | + "SET LINESIZE 80", // override for readability |
| 150 | + "SET WRAP ON", // override for readability |
| 151 | + "SET FEEDBACK ON" |
161 | 152 | ] |
162 | 153 | }, |
163 | | - "functions": { |
164 | | - "query": "select case when object_type = 'PACKAGE' then object_name||'.'||procedure_name else owner || '.' || object_name end || '()' as obj from all_procedures where object_type in ('FUNCTION','PROCEDURE','PACKAGE') and owner = sys_context('USERENV', 'CURRENT_SCHEMA');", |
| 154 | + "explain plan": { |
| 155 | + "query": "explain plan for {0};\nselect plan_table_output from table(dbms_xplan.display());", |
165 | 156 | "options": [], |
166 | 157 | "before": [ |
167 | | - "SET LINESIZE 32767", |
168 | | - "SET PAGESIZE 0", |
169 | | - "SET EMBEDDED ON", |
170 | | - "SET WRAP OFF", |
171 | | - "SET HEADING OFF", |
172 | | - "SET FEEDBACK OFF", |
173 | | - "SET TRIMOUT ON" |
| 158 | + "SET FEEDBACK ON" |
174 | 159 | ] |
175 | 160 | }, |
176 | | - "desc table": { |
177 | | - "query": "desc {0};", |
| 161 | + "desc function": { |
| 162 | + "query": "select text from all_source where type in ('FUNCTION', 'PROCEDURE', 'PACKAGE', 'PACKAGE BODY') and name = nvl(substr(ltrim('{0}', sys_context('USERENV', 'CURRENT_SCHEMA') || '.' ), 0, instr(ltrim('{0}', sys_context('USERENV', 'CURRENT_SCHEMA') || '.' ), '.')-1), ltrim('{0}', sys_context('USERENV', 'CURRENT_SCHEMA') || '.' )) and owner = sys_context('USERENV', 'CURRENT_SCHEMA') order by type, line;", |
178 | 163 | "options": [], |
179 | 164 | "before": [ |
180 | | - "SET LINESIZE 80", // altered for readability |
181 | | - "SET PAGESIZE 0", |
182 | | - "SET EMBEDDED ON", |
183 | | - "SET WRAP OFF", |
184 | | - "SET TAB OFF", |
185 | | - "SET TRIMOUT ON", |
186 | | - "SET TRIMSPOOL ON", |
187 | | - "SET NULL '@'", |
188 | | - "SET COLSEP '|'", |
189 | | - "SET FEEDBACK ON", |
190 | | - "SET SERVEROUT ON", |
191 | | - "SET SQLBLANKLINES ON" |
| 165 | + "SET SERVEROUT OFF", // override |
| 166 | + "SET NULL ''", // override |
| 167 | + "SET HEADING OFF", |
| 168 | + "SET FEEDBACK OFF" |
192 | 169 | ] |
193 | 170 | }, |
194 | | - "show records": { |
195 | | - "query": "select * from {0} WHERE ROWNUM <= {1};", |
| 171 | + "desc" : { |
| 172 | + "query": "select owner || '.' || name as obj from (select owner, table_name as name from all_tables union all select owner, view_name as name from all_views) o where owner not in ('ANONYMOUS','APPQOSSYS','CTXSYS','DBSNMP','EXFSYS', 'LBACSYS', 'MDSYS','MGMT_VIEW','OLAPSYS','OWBSYS','ORDPLUGINS', 'ORDSYS','OUTLN', 'SI_INFORMTN_SCHEMA','SYS','SYSMAN','SYSTEM', 'TSMSYS','WK_TEST','WKSYS', 'WKPROXY','WMSYS','XDB','APEX_040000', 'APEX_PUBLIC_USER','DIP', 'FLOWS_30000','FLOWS_FILES','MDDATA', 'ORACLE_OCM','SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', 'XS$NULL','PUBLIC');", |
196 | 173 | "options": [], |
197 | 174 | "before": [ |
198 | | - "SET LINESIZE 32767", |
199 | | - "SET PAGESIZE 0", |
200 | | - "SET EMBEDDED ON", |
201 | | - "SET WRAP OFF", |
202 | | - "SET TAB OFF", |
203 | | - "SET TRIMOUT ON", |
204 | | - "SET TRIMSPOOL ON", |
205 | | - "SET NULL '@'", |
206 | | - "SET COLSEP '|'", |
207 | | - "SET FEEDBACK ON", |
208 | | - "SET SERVEROUT ON", |
209 | | - "SET SQLBLANKLINES ON" |
| 175 | + "SET SERVEROUT OFF", // override |
| 176 | + "SET NULL ''", // override |
| 177 | + "SET HEADING OFF", |
| 178 | + "SET FEEDBACK OFF" |
210 | 179 | ] |
211 | 180 | }, |
212 | | - "explain plan": { |
213 | | - "query": "explain plan for {0};\nselect plan_table_output from table(dbms_xplan.display());", |
| 181 | + "columns": { |
| 182 | + "query": "select table_name || '.' || column_name as obj from (select c.table_name, c.column_name, t.owner from all_tab_columns c inner join all_tables t on c.owner = t.owner and c.table_name = t.table_name union all select c.table_name, c.column_name, t.owner from all_tab_columns c inner join all_views t on c.owner = t.owner and c.table_name = t.view_name) o where owner not in ('ANONYMOUS','APPQOSSYS','CTXSYS','DBSNMP','EXFSYS', 'LBACSYS', 'MDSYS','MGMT_VIEW','OLAPSYS','OWBSYS','ORDPLUGINS', 'ORDSYS','OUTLN', 'SI_INFORMTN_SCHEMA','SYS','SYSMAN','SYSTEM', 'TSMSYS','WK_TEST','WKSYS', 'WKPROXY','WMSYS','XDB','APEX_040000', 'APEX_PUBLIC_USER','DIP', 'FLOWS_30000','FLOWS_FILES','MDDATA', 'ORACLE_OCM','SPATIAL_CSW_ADMIN_USR', 'SPATIAL_WFS_ADMIN_USR', 'XS$NULL','PUBLIC');", |
| 183 | + "options": [], |
| 184 | + "before": [ |
| 185 | + "SET SERVEROUT OFF", // override |
| 186 | + "SET NULL ''", // override |
| 187 | + "SET HEADING OFF", |
| 188 | + "SET FEEDBACK OFF" |
| 189 | + ] |
| 190 | + }, |
| 191 | + "functions": { |
| 192 | + "query": "select case when object_type = 'PACKAGE' then object_name||'.'||procedure_name else owner || '.' || object_name end || '()' as obj from all_procedures where object_type in ('FUNCTION','PROCEDURE','PACKAGE') and not (object_type = 'PACKAGE' and procedure_name is null) and owner = sys_context('USERENV', 'CURRENT_SCHEMA');", |
214 | 193 | "options": [], |
215 | 194 | "before": [ |
216 | | - "SET LINESIZE 32767", |
217 | | - "SET PAGESIZE 0", |
218 | | - "SET EMBEDDED ON", |
219 | | - "SET WRAP OFF", |
220 | | - "SET TAB OFF", |
221 | | - "SET TRIMOUT ON", |
222 | | - "SET TRIMSPOOL ON", |
223 | | - "SET NULL '@'", |
224 | | - "SET COLSEP '|'", |
225 | | - "SET FEEDBACK ON", |
226 | | - "SET SERVEROUT ON", |
227 | | - "SET SQLBLANKLINES ON" |
| 195 | + "SET SERVEROUT OFF", // override |
| 196 | + "SET NULL ''", // override |
| 197 | + "SET HEADING OFF", |
| 198 | + "SET FEEDBACK OFF" |
228 | 199 | ] |
229 | 200 | } |
230 | 201 | } |
|
0 commit comments