Skip to content

Commit

Permalink
add Snowflake (snowsql) support and give an example configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Foreman committed Feb 27, 2019
1 parent 9ba95d3 commit eae14b1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
33 changes: 32 additions & 1 deletion SQLTools.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"sqlite" : "sqlite3",
"vertica" : "vsql",
"firebird": "isql",
"sqsh" : "sqsh"
"sqsh" : "sqsh",
"snowsql" : "snowsql"
},

// If there is no SQL selected, use "expanded" region.
Expand Down Expand Up @@ -511,6 +512,36 @@
"before": ["\\set semicolon_cmd=\"\\go -mpretty -l\""]
}
}
},

"snowsql": {
"options": [],
"args": "-u {user} -a {account} -d {database} --authenticator {auth} -K",
"queries": {
"execute": {
"options": [],
},
"show records": {
"query": "SELECT * FROM {0} LIMIT {1};"
},
"desc table": {
"query": "DESC TABLE {0};",
"options": ["-o", "output_format=plain",
"-o", "timing=False"]
},
"desc": {
"query": "SELECT TABLE_SCHEMA || '.' || TABLE_NAME AS tbl FROM INFORMATION_SCHEMA.TABLES;",
"options": ["-o", "output_format=plain",
"-o", "header=False",
"-o", "timing=False"]
},
"columns": {
"query": "SELECT TABLE_NAME || '.' || COLUMN_NAME AS col FROM INFORMATION_SCHEMA.COLUMNS",
"options": ["-o", "output_format=plain",
"-o", "header=False",
"-o", "timing=False"]
}
}
}
}
}
10 changes: 10 additions & 0 deletions SQLToolsConnections.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@
// note the forward slashes (if path is used)
"database": "c:/firebird/examples/empbuild/employee.fdb",
"encoding": "utf-8"
},
"Connection Snowflake": {
"type" : "snowsql",
"database": "database",
// for possible authentication configurations see
// https://docs.snowflake.net/manuals/user-guide/snowsql-start.html#authenticator
// if using "snowflake", need to set SNOWSQL_PWD environment variable
"user" : "[email protected]",
"account" : "account_name",
"auth": : "snowflake | externalbrowser | <okta-url>"
}
*/
},
Expand Down

0 comments on commit eae14b1

Please sign in to comment.