tux21b/gocql — pull request #70 by 0x6e6562 (2013-11-24 02:01:44+00:00)
Title: Support for CAS

This patch provides support for CAS operations.

From a client perspective, the API looks like this:

```
func (q *Query) ScanCas(dest ...interface{}) (bool, error)
```

The client must submit a query with `IF NOT EXISTS` in order to tell the server it should issue a CAS statement.

If the CAS operation was applied on the server, the NO results will be send to the client and hence there is nothing to bind. In this case, the `ScanCas` will return true to indicate that the operation was applied.

If the CAS operation was NOT applied on the server, `ScanCas` will return false, and in addition, it will return the values of the bound row from the server. Since this bound row will be prefixed by the `applied` flag, as a matter of convenience to the client, `ScanCas` will not bind the applied field, since it is embodied in the return value of the function.

I added a small test to the existing test suite to demonstrate the behavior.