Skip to content

Commit

Permalink
Add MSSQL support by using native sqlcmd CLI
Browse files Browse the repository at this point in the history
So far tested only on Windows.
Related to mtxr#120 mtxr#52
  • Loading branch information
tkopets committed Aug 30, 2017
1 parent bb8a39c commit 83c112e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
25 changes: 25 additions & 0 deletions SQLTools.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"mysql" : "mysql",
"pgsql" : "psql",
"oracle" : "sqlplus",
"mssql" : "sqlcmd",
"vertica" : "vsql",
"sqsh" : "sqsh",
"firebird": "isql",
Expand Down Expand Up @@ -185,6 +186,30 @@
}
}
},
"mssql": {
"options": [],
"before": [],
"args": "-d \"{database}\"",
"args_optional": ["-S \"{host},{port}\"", "-S \"{host}\\{instance}\"", "-U \"{username}\"", "-P \"{password}\""],
"queries": {
"desc": {
"query": "set nocount on; select concat(table_schema, '.', table_name) from information_schema.tables order by table_name;",
"options": ["-h", "-1"]
},
"columns": {
"query": "set nocount on; select concat(table_name, '.', column_name) from information_schema.columns order by table_name, ordinal_position;",
"options": ["-h", "-1"]
},
"desc table": {
"query": "exec sp_help \"%s\";",
"options": []
},
"show records": {
"query": "select top {1} * from {0};",
"options": []
}
}
},
"vertica": {
"options": [],
"before" : [],
Expand Down
13 changes: 13 additions & 0 deletions SQLToolsConnections.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@
"service" : "servicename",
"encoding": "utf-8"
},
"Connection MSSQL": {
"type" : "mssql",
// use either ("host", "port") and remove "instance"
// or ("host", "instance") and remove "port"
"host" : "localhost",
"instance": "SQLEXPRESS",
// "port" : 1433,
// "username" and "password" are optional (remove if not needed)
"username": "sa",
"password": "password",
"database": "sample",
"encoding": "utf-8"
}
"Connection SQLite": {
"type" : "sqlite",
"database": "d:/sqlite/sample_db/chinook.db", // note the forward slashes in path
Expand Down

0 comments on commit 83c112e

Please sign in to comment.