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

Commit 7f43ee6

Browse files
authored
Merge pull request #208 from kforeman/feature/snowsql-config
Snowflake (snowsql) support
2 parents c4d8be2 + 4d1f64e commit 7f43ee6

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ SQLTools will save you (for sure) a lot of time and help you to increase your pr
2121

2222
## Features
2323

24-
* Works with PostgreSQL, MySQL, Oracle, MSSQL, SQLite, Vertica, Firebird
24+
* Works with PostgreSQL, MySQL, Oracle, MSSQL, SQLite, Vertica, Firebird, and Snowflake
2525
* Smart completions (except SQLite)
2626
* Run SQL Queries &nbsp; <kbd>CTRL+e</kbd>, <kbd>CTRL+e</kbd>
2727
![Auto complete and run SQL queries](https://github.com/mtxr/SQLTools/raw/images/execute_auto_complete.gif?raw=true)

SQLTools.sublime-settings

Lines changed: 35 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,39 @@
511512
"before": ["\\set semicolon_cmd=\"\\go -mpretty -l\""]
512513
}
513514
}
515+
},
516+
517+
"snowsql": {
518+
"options": [],
519+
"env_optional": {
520+
"SNOWSQL_PWD": "{password}"
521+
},
522+
"args": "-u {user} -a {account} -d {database} --authenticator {auth} -K",
523+
"queries": {
524+
"execute": {
525+
"options": [],
526+
},
527+
"show records": {
528+
"query": "SELECT * FROM {0} LIMIT {1};"
529+
},
530+
"desc table": {
531+
"query": "DESC TABLE {0};",
532+
"options": ["-o", "output_format=plain",
533+
"-o", "timing=False"]
534+
},
535+
"desc": {
536+
"query": "SELECT TABLE_SCHEMA || '.' || TABLE_NAME AS tbl FROM INFORMATION_SCHEMA.TABLES ORDER BY tbl;",
537+
"options": ["-o", "output_format=plain",
538+
"-o", "header=False",
539+
"-o", "timing=False"]
540+
},
541+
"columns": {
542+
"query": "SELECT TABLE_NAME || '.' || COLUMN_NAME AS col FROM INFORMATION_SCHEMA.COLUMNS ORDER BY col;",
543+
"options": ["-o", "output_format=plain",
544+
"-o", "header=False",
545+
"-o", "timing=False"]
546+
}
547+
}
514548
}
515549
}
516550
}

SQLToolsConnections.sublime-settings

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@
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+
"user" : "[email protected]",
92+
"account" : "account_name",
93+
"auth": : "snowflake | externalbrowser | <okta-url>"
94+
// if using "auth": "snowflake", provide a password
95+
// you can alternatively set SNOWSQL_PWD in you environment instead
96+
// if using "auth": "externalbrowser" or "<okta-url>", no password needed
97+
"password": "pwd"
8598
}
8699
*/
87100
},

0 commit comments

Comments
 (0)