LoginSignup
53
53

More than 5 years have passed since last update.

railsで作ったDBの中身を確認する

Last updated at Posted at 2018-04-15

ターミナルで

terminal
rails dbconsole

と打つと、

terminal
sqlite>

となるので、

terminal
sqlite>.headers on

として、カラム名の表示をONにして、SQL文を打つと見られる。

terminal
sqlite> select * from users;
id|name|email|created_at|updated_at
1|Kohei!!|kishimotogmail@gmail.com|2018-04-15 15:45:22.055691|2018-04-15 15:45:45.757233

exitでターミナル終了

terminai
sqlite> exit
53
53
2

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