0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Zed】データベースを簡単に扱えるようにする方法

Last updated at Posted at 2025-01-26

dblabをインストール

以下のコマンドを実行してdblabをインストールします。

brew install danvergara/tools/dblab

カレントディレクトリに設定ファイルを作成します。

.dblab.yaml
database:
  - name: "sample"
    host: "localhost"
    port: 5432
    db: "users"
    password: "password"
    user: "postgres"
    driver: "postgres"
    schema: "myschema"
limit: 50

Zedのタスクを作成する

dblabを起動するタスクを作成するためにtasks.jsonに以下を追記します。


 {
    "label": "DBLab",
    "command": "dblab --config",
    "hide": "always",
    "allow_concurrent_runs": false,
    "use_new_terminal": true
  },

タスクにホットキーを設定する

ホットキーでタスクを実行できるようにkeymaps.jsonに以下を追記します。

  {
    "bindings": {
      "alt-d": [
        "task::Spawn",
        {
          "task_name": "DBLab",
          "reveal_target": "center"
        }
      ]
    }
  },

上記のように記述した場合、alt + dを入力すると画像のようにdblabを起動できます。

スクリーンショット 2025-01-26 23.54.24.png

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?