日本語
Docker環境のMySQLを、ファイル上で操作できるようにしたVSCodeのタスク
日本語が入力できなくなる問題を一時的にクエリファイルを生成して読ませて実行させることで回避している
リザルトがクエリを書いたファイルに書き込まれる
- ダウンロード
- VScodeで、導入したいワークスペースを開く
- ルートディレクトリに
.vscode/を作成 - その中に
run_sql.cmdを入れる - 設定の部分を任意に編集
tasks.jsonを更新する or 入れるCTRL+SHIFT+Pでコマンドパレットを開いてウィンドウの再読み込み
- ファイルを生成 (例: debug.sql)
- 一行でクエリを書く
- その行にカーソルを置いたままにする
CTRL+SHIFT+Bでタスクパレットを開く- 実行
- クエリの次の行に結果がコメントアウトで書き込まれます
▼ English
A VSCode task that enables executing MySQL queries directly from a file within a Docker environment.
It works around an issue where Japanese text input fails by temporarily generating a query file and executing it.
The query results are automatically written back into the active file.
- Download the files.
- Open your target workspace in VS Code.
- Create a
.vscode/directory in the root folder. - Place
run_sql.cmdinside.vscode/. - Edit the configuration settings as needed.
- Create or update your
tasks.json. - Press
Ctrl+Shift+Pto open the Command Palette and reload the window.
- Create a file (e.g.,
debug.sql). - Write a single-line SQL query.
- Keep your cursor on that line.
- Press
Ctrl+Shift+Bto open the Build Task menu. - Run the task.
- The query results will be inserted as comments directly below your query line.