Skip to content

Commit

Permalink
Merge pull request #4175 from morozov/deprecate-primary-replica-conne…
Browse files Browse the repository at this point in the history
…ction-query

Additional deprecation note for PrimaryReplicaConnection::query()
  • Loading branch information
morozov authored Jul 22, 2020
2 parents 8255f4b + 82ce886 commit 8c9e92a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ The usage of the wrapper `Connection` and `Statement` classes as implementations
2. The `query()` method has been deprecated in favor of `executeQuery()`.
3. The `exec()` method has been deprecated in favor of `executeStatement()`.

Note that `PrimaryReplicaConnection::query()` ensures connection to the primary instance while `executeQuery()` doesn't.

Depending on the desired behavior:

- If the statement doesn't have to be executed on the primary instance, use `executeQuery()`.
- If the statement has to be executed on the primary instance and yields rows (e.g. `SELECT`), prepend `executeQuery()` with `ensureConnectedToPrimary()`.
- Otherwise, use `executeStatement()`.

## PDO-related classes outside of the PDO namespace are deprecated

The following PDO-related classes outside of the PDO namespace have been deprecated in favor of their counterparts in the PDO namespace:
Expand Down

0 comments on commit 8c9e92a

Please sign in to comment.