LoginSignup
0
0

Rails:database.ymlの設定項目

Posted at

初期学習用のメモ書きです。
database.ymlの各項目について、簡単にまとめました。

環境ごとの役割

項目名 概要
default 全部に共通
development 開発環境
test テスト環境
production リリース環境

DBアクセスに関する項目

項目名 概要
adapter DBごとのアダプター
SQLite3→sqlite3、MySQL→mysql2、PostgreSQL→postgresql
pool 同時にDBにアクセスできる数
timeout 結果を受け取るまでのタイムアウト
デフォルトは5000(ms)
<<: *default 固定値
defaultに用意した設定をそのまま読み込む
database DBの保存場所とファイル名を指定
host ホスト名
(サーバ型DBの場合)
username アクセスユーザ名
(サーバ型DBの場合)
password アクセスユーザのパスワード
(サーバ型DBの場合)
encoding テキストのエンコーディング名
(サーバ型DBの場合)
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