Make WordPress Core

Opened 8 years ago

Last modified 18 months ago

#46287 new feature request

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

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

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 8 years ago.

Download all attachments as: .zip

Change History (5)

#1 @pento
8 years ago

  • Version trunk

#2 @jondaley
2 years ago

  • Version → 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
2 years 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).

#4 @johnbillion
18 months ago

  • Version trunk
Note: See TracTickets for help on using tickets.