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

Commit f7f25f3

Browse files
Kyle ForemanTaras Kopets
authored andcommitted
add Snowflake (snowsql) support and give an example configuration
1 parent 190ee42 commit f7f25f3

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

SQLTools.sublime-settings

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"sqlite" : "sqlite3",
1616
"vertica" : "vsql",
1717
"firebird": "isql",
18-
"sqsh" : "sqsh"
18+
"sqsh" : "sqsh",
19+
"snowsql" : "snowsql"
1920
},
2021

2122
// If there is no SQL selected, use "expanded" region.
@@ -511,6 +512,36 @@
511512
"before": ["\\set semicolon_cmd=\"\\go -mpretty -l\""]
512513
}
513514
}
515+
},
516+
517+
"snowsql": {
518+
"options": [],
519+
"args": "-u {user} -a {account} -d {database} --authenticator {auth} -K",
520+
"queries": {
521+
"execute": {
522+
"options": [],
523+
},
524+
"show records": {
525+
"query": "SELECT * FROM {0} LIMIT {1};"
526+
},
527+
"desc table": {
528+
"query": "DESC TABLE {0};",
529+
"options": ["-o", "output_format=plain",
530+
"-o", "timing=False"]
531+
},
532+
"desc": {
533+
"query": "SELECT TABLE_SCHEMA || '.' || TABLE_NAME AS tbl FROM INFORMATION_SCHEMA.TABLES;",
534+
"options": ["-o", "output_format=plain",
535+
"-o", "header=False",
536+
"-o", "timing=False"]
537+
},
538+
"columns": {
539+
"query": "SELECT TABLE_NAME || '.' || COLUMN_NAME AS col FROM INFORMATION_SCHEMA.COLUMNS",
540+
"options": ["-o", "output_format=plain",
541+
"-o", "header=False",
542+
"-o", "timing=False"]
543+
}
544+
}
514545
}
515546
}
516547
}

SQLToolsConnections.sublime-settings

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@
8282
// note the forward slashes (if path is used)
8383
"database": "c:/firebird/examples/empbuild/employee.fdb",
8484
"encoding": "utf-8"
85+
},
86+
"Connection Snowflake": {
87+
"type" : "snowsql",
88+
"database": "database",
89+
// for possible authentication configurations see
90+
// https://docs.snowflake.net/manuals/user-guide/snowsql-start.html#authenticator
91+
// if using "snowflake", need to set SNOWSQL_PWD environment variable
92+
"user" : "[email protected]",
93+
"account" : "account_name",
94+
"auth": : "snowflake | externalbrowser | <okta-url>"
8595
}
8696
*/
8797
},

0 commit comments

Comments
 (0)