gocql/gocql — pull request #132 by phillipCouto (2014-03-20 11:36:36+00:00)
Title: Added code to make working with batches a tad easier

Hey guys its been a while since I have contributed but I am slowly getting more free time :)

In this request I am adding some conviences to the usage of batch statements.

I have added a Size() function so the user can see how many statements they have in their statement. Also I have moved the batch entry limit from being a hard coded value to being an exported constant.

This way a user can break a large batch statement up by matching sure the batch statement is <= to the BatchSizeMaximum.

Example:
```go
b := session.NewBatch(gocql.LoggedBatch)
for {
...
if b.Size() == gocql.BatchSizeMaximum {
sess.ExecuteBatch(b)
b = session.NewBatch(gocql.LoggedBatch)
time.Sleep(5 * time.Seconds) //Sleep to allow cassandra to write changes to disk.
}
...
}
```

This is a crude example but I hope it illustrates my point :)