Search code examples
mysqlsublimetext2sublimetext3sublimetextsublime-text-plugin

Sublime Text MySQL Build System variable substitution issue


I'm trying to configure Sublime text to do MySQL build, following is the script:

{
    "cmd": ["mysql", "--default-character-set=utf8", "-uuser", "-ppwd", "-hlocalhost", "-v", "db_mine", "-e source main.sql"],
    "selector": "source.sql"
}

As it is, it works for file main.sql, as presented in the script. Obviously that should be changed, I see people using $file there.

The problem is that here (Windows 7) it's not working.

If I change it to $file, then I get:

ERROR at line 1: Unknown command '\U'.

Any suggestion?


Solution

  • The following works on macOS:

    {
        "cmd": ["/usr/local/mysql/bin/mysql", "-u", "root", "-e", "source $file", "-t"],
        "selector": "source.sql"
    }