blue workbench

Ruby and Rails

【PostgreSQL】pgcliを導入する

インストールする

$ brew install pgcli

軽く触ってみる

twitter_copy_development というDBがある前提。

$ pgcli twitter_copy_development
Server: PostgreSQL 12.2
Version: 3.0.0
Chat: https://gitter.im/dbcli/pgcli
Home: http://pgcli.com
twitter_copy_development> select * from tweets;
+------+-----------+--------+----------------------------+----------------------------+
| id   | user_id   | body   | created_at                 | updated_at                 |
|------+-----------+--------+----------------------------+----------------------------|
| 1    | 1         | あいう | 2020-04-19 10:18:05.864627 | 2020-04-19 10:18:05.864627 |
+------+-----------+--------+----------------------------+----------------------------+
SELECT 1
Time: 0.018s

自動保管がすごく便利です。

MySQL版もある

ちなみにmycliというMySQL版もあります。

$ brew install mycli

参考