2015-11-09 15 views
6

database.yml dosyasında reconnect: true yapılandırma seçeneğinin mümkün olduğunu keşfettim. Diğer olası yapılandırma seçenekleri nelerdir? Tüm seçenekler için tam bir referans var mı?Veritabanı için gerekli tüm anahtarlar şunlardır:

bilinen anahtar örnekler:

default: &default 
    adapter: mysql2 
    encoding: utf8 
    pool: 5 
    username: foo 
    password: bar 
    reconnect: true 
    socket: /var/sock/thing.sock 

development: 
    <<: *default 
    database: app_development 

cevap

8

Orada sadece onları listeler herhangi bir yerde ama ActiveRecord en ConnectionAdapaters kontrol sanmıyorum. Seçeneklerin kullandığınız veritabanını değiştirdiğini, ancak bunun MySQL bağlantı bağdaştırıcısında listelendiğini unutmayın. MySQL

:host - Defaults to "localhost". 
:port - Defaults to 3306. 
:socket - Defaults to "/tmp/mysql.sock". 
:username - Defaults to "root" 
:password - Defaults to nothing. 
:database - The name of the database. No default, must be provided. 
:encoding - (Optional) Sets the client encoding by executing "SET NAMES <encoding>" after connection. 
:reconnect - Defaults to false (See MySQL documentation: http://dev.mysql.com/doc/refman/5.7/en/auto-reconnect.html). 
:strict - Defaults to true. Enable STRICT_ALL_TABLES. (See MySQL documentation: http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html) 
:variables - (Optional) A hash session variables to send as SET @@SESSION.key = value on each database connection. Use the value +:default+ to set a variable to its DEFAULT value. (See MySQL documentation: http://dev.mysql.com/doc/refman/5.7/en/set-statement.html). 
:sslca - Necessary to use MySQL with an SSL connection. 
:sslkey - Necessary to use MySQL with an SSL connection. 
:sslcert - Necessary to use MySQL with an SSL connection. 
:sslcapath - Necessary to use MySQL with an SSL connection. 
:sslcipher - Necessary to use MySQL with an SSL connection. 

Raylar ActiveRecord adaptörleri için github için Seçenekler

Liste, https://github.com/rails/rails/tree/master/activerecord/lib/active_record/connection_adapters

İlgili konular