You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for read only transactions. Currently you can start a transaction with beginTransaction. The proposal would add a beginReadOnlyTransaction method that starts a read-only transaction.
Q
A
Proposed Version
2.21.0
BC Break?
No
Goal
Provide a method to start a read-only transaction. The proposed name for the method is beginReadOnlyTransaction.
Background
I experienced a use case where I needed a read-only transaction. While it is easy enough to do it with the existing library. We can make it easier with a ready-to-use method that is well tested.
Considerations
There is no required preparation for laminas-db users. The change does not break anything.
Proposal(s)
Users will use the method beginReadOnlyTransaction when wanting to start a read-only transaction. Everything else stays the same.
Appendix
First, add the method beginReadOnlyTransaction to Laminas\Db\Adapter\Driver\ConnectionInterface.
Then implement the method in each driver.
Finally, make sure the new code is covered with tests.
I welcome all questions and feedback on the proposal.
The text was updated successfully, but these errors were encountered:
I see it supports MySQL, SQLite, Oracle, Sql Server, PostgreSQL and IBM Db2. My understanding is that as long as transactions are supported, then read-only transactions are supported for each database. So if you can do beginTransaction you should be able to do something like beginReadOnlyTransaction.
I cannot be sure yet without trying. I could give it a go and if it just does not work, then I leave it.
RFC
Add support for read only transactions. Currently you can start a transaction with
beginTransaction
. The proposal would add abeginReadOnlyTransaction
method that starts a read-only transaction.Goal
Provide a method to start a read-only transaction. The proposed name for the method is
beginReadOnlyTransaction
.Background
I experienced a use case where I needed a read-only transaction. While it is easy enough to do it with the existing library. We can make it easier with a ready-to-use method that is well tested.
Considerations
There is no required preparation for
laminas-db
users. The change does not break anything.Proposal(s)
Users will use the method
beginReadOnlyTransaction
when wanting to start a read-only transaction. Everything else stays the same.Appendix
First, add the method
beginReadOnlyTransaction
toLaminas\Db\Adapter\Driver\ConnectionInterface
.Then implement the method in each driver.
Finally, make sure the new code is covered with tests.
I welcome all questions and feedback on the proposal.
The text was updated successfully, but these errors were encountered: