On Sa, 2017-11-04 at 08:28 +0100, Matteo Beccati wrote:
> Hi,
> 
> On 03/11/2017 21:25, Scott Arciszewski wrote:
> > 
> > MySQL calls it an X Protocol, apparently.
> > 
> > https://dev.mysql.com/doc/internals/en/x-protocol-use-cases-use-cas
> > es.html#x-protocol-use-cases-prepared-statements-with-single-round-
> > trip
> OK, which is something that neither libmysqlclient nor mysqlnd seem
> to support.

The X Protocol is supported via
https://pecl.php.net/package/mysql_xdevapi which adds a complete new
set of APIs with higher level CRUD stuff. We won't put it directly in
mysqlnd or such as it has different semantics in different areas making
the protocol no simple drop-in replacement. It's however based on
Google protobuf, thus it is relatively straight forward to implement
(or one could build upon based on the DevAPI) maybe doing a PDO
prototype might be interesting ...

Aside from that: "true" prepared statements are improved quite a lot in
MySQL 8 (currently in RC), but with the "old" protocol still need the
extra roundtrip.

In general: When doing something in the area one should also look into
more "advanced" abstractions. One thing I often see requested are
"variadic binds" for stuff like "WHERE field IN (?...)" which isn't
supported natively (50% of the way can be done by faking this by
binding to a JSON array) Maybe there are other ideas what can be done
liberating from concepts from the 1970ies. With the X protocol we
(MySQL) have liberties to extend this, which we didn't had before ...
:)

johannes


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to