On Saturday, January 24, 2015 at 3:03:45 PM UTC-8, ronak banka wrote:
>
> 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.
>
You should be able to do:
db.pool.connection_validation_timeout =
db.opts[:connection_validation_timeout]
And add connection_validation_timeout: 1 to your yml file.
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.