Request that will allow SublimeREPL to have sqlcmd for use with Microsoft SQL Server #153

wants to merge 2 commits into


None yet

2 participants



I love this plugin! Thank you for creating it! This will get me to finally buy a Sublime licence. I've been waiting to figure out a solution to running my database queries and getting results back into Sublime in a seamless way.

My changes add sqlcmd as a repl. This is for use with Microsoft SQL Server. The change is rather small. Aside from my minor edit and addition of a new repl config folder The user will also need to create a TSQL language for Sublime. All I did was copied the existing SQL folder that comes with Sublime named it TSQL and updated all references to .sql to .tsql within the SQL files. I did this because I plan on creating repl for Oracle SQLPlus and PostgreSQL psql tools in the future and couldn't see any other way to make sure the correct repl is used. Please let me know if you have any questions. I feel this will be a useful addition to those of us who have come to love Sublime and want to use it for database related work. Attached is an example of the change be put to use(database bliss).


Thanks again,

Bob Henkel added some commits Apr 6, 2013
Bob Henkel Add SQLCMD support.
ENCH: Add the ability to send Microsoft SQL Server queries to a sqlcmd
Bob Henkel Add repl config for sqlcmd.
Because a database user typically works on many different servers and
databases I don't see a way to handle this except to create a config for
each server that you want to connect too. This is within reason as you
set it up once and can create a new sqlcmd REPL for the given server. I
have included a local host config that points to a database on the
localhost. Anyone wanting to use this will need to update the config to
match there server and database name.

It looks like my version I made the change to was a bit out of date from your head version. My only intended change to was this.

def tsql_sender(repl, text, file_name=None):
code = text
payload = code + "GO" + '\n'
return default_sender(repl, payload, file_name)

@wuub wuub was assigned Apr 12, 2013
wuub commented Apr 12, 2013

Hi Bob,

  1. please reapply this on current master fixing changes
  2. if you can, rename the package to be simply called 'SQL' and command SQL - MS SQL Server (or something similar)
  3. Include TSQL langiage in SublimeREPL/config/SQL/TSQL.tmLanguage (I know we didn't do it this way in the past, but I recently decided that we will include necessary tmLanguages from now on).
  4. Make sure that running REPL from command palette works, right now it is referencing wrong folder in run_existing_window_command.

I will gladly merge this back into master once above issues are fixed :)

wuub commented May 20, 2013

Bob, since you have not updated this pull request in a while, I'm forced to close it.
If you ever find a way to update it to work with current version of SublimeREPL I will gladly take another look.

@wuub wuub closed this May 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment