1
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?

VSCODEからPostgreSQLを使う

Last updated at Posted at 2024-12-20

インストールする拡張機能

https://marketplace.visualstudio.com/items?itemName=ckolkman.vscode-postgres
image.png

データベースとのリンク

①接続情報入力画面を開く。

拡張機能のインストールが終わるとサイドバーにPostgreSQLアイコンが表示されるので、それをクリック。
ヘッダーのPOSTGRESQL ....横の+をクリック。
image.png

②接続情報を入力

以下が求められるので入力する。

  • ホスト
  • ユーザID
  • パスワード
  • ポート番号
  • セキュアかスタンダード(スタンダードを選択)
  • 接続名(なんでもOK)

ローカルのSQLファイルを実行する

実行したSQLファイルを開き、Select Postgress Serverをクリック。
image.png

登録した接続名のリストが出てくるので選択し、対象のDBを選択する。
Select Postgress Serverの部分が対象のDB名になれば接続状態。
image.png

実行したいクエリ部分を選択状態にして、右クリックし、Run Queryを実行。
image.png

F5を押しても異なるショートカットアクションが起動してしまう。

1
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
1
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?