I was trying to achieve this :

Loading the db config file to connect to database using a yaml file 

Sample Yaml file :
Something like this 

db:

  adapter: mysql

  database: my_db
  hostname: 127.0.0.1
  username: root
  password: 
  socket: /tmp/mysql.sock
  pool: 5
  timeout: 5000

config  =  YAML.load_file('db.yml')

db = Sequel.connect (config) 
db.extension :connection_validator
db.pool.connection_validation_timeout = -1 <<-- This thing works fine but i 
was asking is possible to change this setting from above yaml file because 
i want to avoid hardcoding the setting. 

On Saturday, January 24, 2015 at 1:45:26 AM UTC+9, Jeremy Evans wrote:
>
> On Friday, January 23, 2015 at 1:19:35 AM UTC-8, ronak banka wrote:
>>
>> Hello,
>>
>> I am trying to use connection validator extension for sequel in my rails 
>> application, but not sure how to load the pool 
>> connection_validation_timeout from my database yaml file?? 
>>
>>
>> http://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/connection_validator_rb.html
>>
>  
> connection_validation_timeout isn't an option you specify, it's a setting 
> you change after loading the extension into the database.  So you should do:
>
>   DB.extension(:connection_validator)
>   DB.pool.connection_validation_timeout = -1
>
> Where DB is your Sequel::Database instance.  If you are not sure what your 
> Sequel::Database instance is, try Sequel::Model.db.
>
> Thanks,
> Jeremy
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to