Skip to content

Instantiate ConnectionPool with a DatabaseConfig rather than a ConnectionSpecification - #37253

Merged
eileencodes merged 1 commit into
rails:masterfrom
Shopify:connection-pool-db-config
Sep 24, 2019
Merged

eileencodes merged 1 commit into
rails:masterfrom
Shopify:connection-pool-db-config

Conversation

@casperisfine

Copy link
Copy Markdown
Contributor

This goes towards the goal we discussed of getting rid of ConnectionSpecification, the main place it's used is for instantiating ConnectionPool.

Most of this is a very straightforward change, except in a couple places that I'll explain in diff comments.

@eileencodes @seejohnrun @rafaelfranca @matthewd

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main weirdness introduced by this refactor, since the spec_name is only available in ConnectionSpecification I'm forced to go through some inelegant hoops to properly set the connection_specification_name.

However I believe this is a just a temporary hack, and that it will be easy to clean it up once ConnectionSpecification is entirely gone.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this test makes much sense anymore as we're trying to eliminate the "pool name".

@casperisfine
casperisfine force-pushed the connection-pool-db-config branch 2 times, most recently from d0c9333 to 69bd199 Compare September 24, 2019 13:04
@casperisfine
casperisfine force-pushed the connection-pool-db-config branch from 69bd199 to 48c716b Compare September 24, 2019 13:12
@eileencodes
eileencodes merged commit 29be48f into rails:master Sep 24, 2019
@eileencodes

eileencodes commented Sep 24, 2019 •

Copy link
Copy Markdown
Member

This is great 😍 Thanks @casperisfine!

imtayadeway added a commit to imtayadeway/activerecord-import that referenced this pull request Oct 1, 2019
rails/rails#37253 changed the connection pool
to pass in a database config instead of a specification - this updates
the base importer to be compatible with both
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants