forcedotcom/phoenix — pull request #212 by colorant (2013-05-22 02:48:17+00:00)
Title: Increment show case.

this is just for anyone who is interested to check out mu tweak on UPSERT to support atomic INCREASE

A few usage show case :

CREATE TABLE test_table
(row varchar not null, col_int integer, col_long bigint, col_long2 bigint
CONSTRAINT pk PRIMARY KEY (row));

// increase on existing row.
UPSERT INTO test_table(row, col_int, col_long, col_long2) VALUES('row1', 1, 1, 1);
UPSERT INTO test_table(row, col_long, col_long2) INCREASE VALUES('row1', -100, 1000);

// increase on non existing row.
UPSERT INTO test_table(row, col_long, col_long2) INCREASE VALUES('row2', 100, 1000);