Description Usage Arguments See Also
This function lets users define DB connection settings from sources other
than the database.yml config. This is useful for DB setups where a master
node maintains a dynamic list of DB nodes. This function only lets you define
the connection settings. The actual connection will be open by a subsequent
db('my-custom-con1', 'select 1')
call. This function doesn't check or validate the input, the caller is responsible
for making sure that the list has the correct format, otherwise the
connection (i.e. the db
call) would fail.
1 | register.connections(db.config, strict = TRUE)
|
db.config |
is a list of format: list( my-custom-con1=list( database='db1', username='analytics', password='', host='db-1', port=5432, application_name='rport' ), my-custom-con2=list( database='db2', username='analytics', password='', host='db-2', port=5432, application_name='rport' ) ) Note, that if a list with multiple definitions for the same connection name is given, there'll be an error. |
strict |
default TRUE. If strict is TRUE, no connection definitions
cannot be overwritten and if you try to add a connection name that already
exists - either from an earlier |
reload.db.config, list.connections
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.