'Database management tasks definition for multiple db in a remote connection context
This section of the rails guides states:
If you would like to connect to an external database without any database management tasks such as schema management, migrations, seeds, etc. [...]
database_tasks: false
is unclear to this reader.
On one extreme this means reading is connecting without managing the db.
On the other: migrations, seeding (and probably tests) are not.
But in the middle, writing to a database could be subjectively debated as being database management.
While I understand Rails sets out to manage main databases for writing and replicas for reading
connects_to database: { writing: :mains, reading: :mains_replica }
What about the use case of having an application that is distributed, but needs a centralised database servicing, say users, and this need to connect to read, write remotely and thus setting up in database.yml a
host: some-remote-db.domain.com
for that purpose? or is mutiple databases hard-wired for replicas (while the rails guide is somewhat opaque about this, I do not believe so as that would negate the need for a section on automated role switching)
Thus:
- does
database_tasks: falseallow creating or editing records - how are the
database_tasksspecifically defined?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
