LoginSignup
2
2

More than 5 years have passed since last update.

SublimeText2 から SQL を実行

Posted at

個別の sublime-project ファイルにビルドシステムを設定しておく。
こんな感じ。

Build.sublime-project
{
    "folders":
    [
        {
            "path": "/Users/xxxx"
        }
    ],
    "build_systems" : [{
        "name": "PostgreSQL",
        "cmd": ["psql", "-U", "username", "dbname", "-f", "$file"],  
        "selector": "source.sql"
    }, {
        "name": "MySQL",
        "cmd": ["mysql", "-u", "user", "-pxxx", "dbname", "--default-character-set=utf8", "-e", "source $file"],
        "selector": "source.sql" 
    }]
}

あとはSQLファイルを開いて Tool->Build System で設定。
すると ⌘+B でSQL実行結果が表示されます。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2