[wp-trac] [WordPress Trac] #54042: Extending wpdb::prepare() to support table/field names, and IN() operator

WordPress Trac noreply at wordpress.org
Tue May 10 18:17:07 UTC 2022


#54042: Extending wpdb::prepare() to support table/field names, and IN() operator
-------------------------------------------------+-------------------------
 Reporter:  craigfrancis                         |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Database                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback needs-        |     Focuses:
  testing early has-unit-tests                   |
-------------------------------------------------+-------------------------

Comment (by craigfrancis):

 Replying to [comment:32 apokalyptik]:
 > This is why I felt that `%,d` fit better than `%...d`.

 Some of this is going to be about taste and familiarity... but if I was to
 try and move towards data, the bit I worry about is future compatibility.
 Even though printf is ''very'' unlikely to change now, if it was to be
 expanded, I would expect printf to use another single character (where I
 worry that a comma would be quite likely); in contrast, and as you've
 noted, it's already using `.` for precision, so I ''think'' `...` is less
 likely to be used.

 > I'm suggesting that a single array in the format of something like
 `$index[ $arg_id ] = array( $boolVariadic, $boolIdentifier[, ...] );`

 I've had a quick attempt at this, updating the structure of `$args`, but
 it seems to be turning into a bigger change than I was hoping. Maybe I've
 missed something obvious, but considering 6 people have already reviewed
 [https://github.com/WordPress/wordpress-develop/pull/2192 PR 2192], all
 the unit tests pass, the performance tests are doing very well, and I'm
 hoping to get it merged soon (the branch for 6.1 was last week), maybe we
 can try this different array structure later, as a separate task?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54042#comment:33>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list