Skip to content

Conversation

@MasterOdin
Copy link
Member

@MasterOdin MasterOdin commented Aug 4, 2024

PR consolidates the insert and bulkInsert implementations between PdoAdapter and PostgresAdapter so that we once again only have the functions implemented in PdoAdapter, while retaining the override behavior added in #2195. Doing this as a precursor to #2297 so that it's easier to fix the bug where only need to change the functions in PdoAdapter and not in other places as well.

@MasterOdin MasterOdin merged commit eae55bc into 0.x Aug 4, 2024
@MasterOdin MasterOdin deleted the refactor-insert branch August 4, 2024 16:58
@phrfpeixoto
Copy link

Docs? What changed for bulk insert?

@MasterOdin
Copy link
Member Author

MasterOdin commented Aug 13, 2024

The change was that previously there was:

  • PdoAdapter::insert
  • PdoAdapter::bulkInsert
  • PostgresAdapter::insert
  • PostgresAdapter::bulkInsert

where the code for the PostgresAdapter variants of the two functions was wholesale copied from the PdoAdapter with a very slight tweak inserted (done in #2195). The PR here gets us to have only:

  • PdoAdapter::insert
  • PdoAdapter::bulkInsert

again, while still having the functionality added in #2195 as done via a new protected method that the PostgresAdapter overrides. This made it easier for me to do #2301 where I only needed to make the change in 2 places (PdoAdapter::insert and PdoAdapter::bulkInsert) as opposed to 4 places (aforementioned and PostgresAdapter::insert and PostgresAdapter::bulkInsert), as well as any other potential future changes made to these two functions.

For end users, nothing practical has changed in how the methods would be used in the adapters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants