Make WordPress Core

Opened 6 years ago

Last modified 3 months ago

#46287 new feature request

Add insert_ignore() method to wpdb to avoid unecessary boilerplate code

Reported by: lev0's profile lev0 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: trunk
Component: Database Keywords: has-patch
Focuses: Cc:

Description

It's a very useful query, and easy to add to the core. Its usage would be less error prone, and code a lot DRYer if it were officially supported.

Attachments (1)

wp-db-insert-ignore.patch (2.7 KB) - added by lev0 6 years ago.

Download all attachments as: .zip

Change History (4)

#1 @pento
6 years ago

  • Version trunk deleted

#2 @jondaley
3 months ago

  • Version set to trunk

I see no one has replied to this in 6 years. I came here looking for the same thing. Obviously, this can be done with custom queries, but it seems like an easy thing to add to me as well.

Is there a reason to not add it?

#3 @lev0
3 months ago

I think it's only because WP itself doesn't use them. Odd considering it's supposed to be so extensible but is missing a couple of basic query types that site & plugin developers could really use (this one and upsert).

Note: See TracTickets for help on using tickets.