Monday, November 14, 2011

Create + Update = ?

In the world of databases, you can perform what are generally (and amusingly) referred to as CRUD operations -- create, read, update, and delete. Every editor I personally know who's encountered the term CRUD has been moved to ask "Seriously, can we even use this term?" Indeed, we can and, since our audience uses it, we should.

Fun as that is, I'm actually interested today in a term I have run across a few times recently that pertains to just two of these, namely create and update. The standard database command for creating a new database entry is Insert. If you need to update an existing entry, you use (logically) the Update command. Sometimes, tho, you have a situation where you want to update-or-insert — that is, update the item if it exists, or create (insert) it if it doesn't.

Turns out there's actually a term for this: Upsert. Like, a legitimate, definitely-in-use term that gets over 100,000 search hits and that has its own Wikipedia entry.

Like CRUD, this isn't apt to warm the hearts of editors. (It's also not yet in general dictionaries, which is more editorial reason to frown about it.) It's handy, tho, at least for the crowd that deals with CRUD-y stuff all day long. The term has been formalized in at least a few programming frameworks as an actual command (, Oracle). It's hard to imagine that the terms would escape into general usage from its current confines in the world of database folks. But you never know.