Re: [Proposal] Add `savepoint()` method to PDO
| From: | Saki Takamachi | Date: | Mon, 05 Feb 2024 01:28:27 +0000 |
| Subject: | Re: [Proposal] Add `savepoint()` method to PDO | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122280@lists.php.net to get a copy of this message | ||
Hi Kamil,
> Why does this have to be done in PHP? Why can this not be done in SQL?
Of course, we can also do it with SQL. Indeed, many frameworks do that. However, if we think about
it from that perspective, functions such as
beginTransaction() and
commit() can also be executed with SQL, except for some drivers.
Savepoint can still be used using SQL, but I'm thinking about adding it as a method for
convenience.
> Also, I am not sure that mysqli implements this properly. It’s probably not the best
> extension to take an example of.
Since there was already an implementation in mysqli, I thought it would be natural to implement it
in PDO as well, but based on what you mentioned, I may need to think about this a little more.
Regards.
Saki