Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit 0a35bd8

Browse files
authored
Merge branch 'master' into v0_9_6_release
2 parents f4c346a + 29ab283 commit 0a35bd8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

SQLTools.sublime-settings

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
},
7474
"queries": {
7575
"desc" : {
76-
"query": "select '|' || quote_ident(table_schema)||'.'||quote_ident(table_name) ||'|' as tblname from information_schema.tables where table_schema = any(current_schemas(false)) and table_schema not in ('pg_catalog', 'information_schema') order by table_schema = current_schema() desc, table_schema, table_name",
76+
"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",
7777
"options": ["--tuples-only", "--no-psqlrc"]
7878
},
7979
"desc table": {
@@ -85,11 +85,11 @@
8585
"options": ["--no-password"]
8686
},
8787
"columns": {
88-
"query": "select '|' || quote_ident(table_name) || '.' || quote_ident(column_name) || '|' from information_schema.columns where table_schema = any(current_schemas(false)) and table_schema not in ('pg_catalog', 'information_schema') order by table_name, ordinal_position",
88+
"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",
8989
"options": ["--no-password", "--tuples-only", "--no-psqlrc"]
9090
},
9191
"functions": {
92-
"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 = any(current_schemas(false)) and n.nspname not in ('pg_catalog', 'information_schema')",
92+
"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')",
9393
"options": ["--no-password", "--tuples-only", "--no-psqlrc"]
9494
},
9595
"desc function": {
@@ -156,7 +156,7 @@
156156
"args_optional": ["--login-path=\"{login-path}\"", "--defaults-extra-file=\"{defaults-extra-file}\"", "-p\"{password}\""],
157157
"queries": {
158158
"desc" : {
159-
"query": "select concat('|', table_schema, '.', table_name, '|') from information_schema.tables where table_schema = database() order by table_name;",
159+
"query": "select concat('|', case when table_schema REGEXP '[^0-9a-zA-Z$_]' then concat('`',table_schema,'`') else table_schema end, '.', case when table_name REGEXP '[^0-9a-zA-Z$_]' then concat('`',table_name,'`') else table_name end, '|') from information_schema.tables where table_schema = database() order by table_name;",
160160
"options": ["-f", "--silent", "--raw"]
161161
},
162162
"desc table": {
@@ -168,15 +168,15 @@
168168
"options": ["-f", "--table"]
169169
},
170170
"columns": {
171-
"query": "select concat('|', table_name, '.', column_name, '|') from information_schema.columns where table_schema = database() order by table_name, ordinal_position;",
171+
"query": "select concat('|', case when table_name REGEXP '[^0-9a-zA-Z$_]' then concat('`',table_name,'`') else table_name end, '.', case when column_name REGEXP '[^0-9a-zA-Z$_]' then concat('`',column_name,'`') else column_name end, '|') from information_schema.columns where table_schema = database() order by table_name, ordinal_position;",
172172
"options": ["-f", "--silent", "--raw"]
173173
},
174174
"functions": {
175-
"query": "select concat('|', routine_schema, '.', routine_name, '()', '|') from information_schema.routines where routine_schema = database();",
175+
"query": "select concat('|', case when routine_schema REGEXP '[^0-9a-zA-Z$_]' then concat('`',routine_schema,'`') else routine_schema end, '.', case when routine_name REGEXP '[^0-9a-zA-Z$_]' then concat('`',routine_name,'`') else routine_name end, '()', '|') from information_schema.routines where routine_schema = database();",
176176
"options": ["-f", "--silent", "--raw"]
177177
},
178178
"desc function": {
179-
"query": "select routine_definition from information_schema.routines where concat(routine_schema, '.', routine_name) = '%s';",
179+
"query": "select routine_definition from information_schema.routines where concat(case when routine_schema REGEXP '[^0-9a-zA-Z$_]' then concat('`',routine_schema,'`') else routine_schema end, '.', case when routine_name REGEXP '[^0-9a-zA-Z$_]' then concat('`',routine_name,'`') else routine_name end) = '%s';",
180180
"options": ["-f", "--silent", "--raw"]
181181
},
182182
"explain plan": {

0 commit comments

Comments
 (0)