diff --git a/qb/batch.go b/qb/batch.go index 4e14fec..4fa8bd5 100644 --- a/qb/batch.go +++ b/qb/batch.go @@ -23,6 +23,13 @@ type BatchBuilder struct { } // Batch returns a new BatchBuilder. +// BatchBuilder encapsulates batch cqls as one ordinary gocql.Query for convenience. +// Below are the limitations of encapsulating batch cqls based on gocql.Query instead of gocql.Batch: +// * gocql.Batch has some more batch specific check, such as BatchSize(65535). +// * gocql.Batch use BatchObserver instead of QueryObserver. +// * gocql.Batch has cancelBatch call back. +// * gocql.Batch prepares the included statements separately, which is more efficient. +// In contrast, gocqlx.qb.BatchBuilder, which is based on gocql.Query, prepares the whole batch statements as one ordinary query. // // Deprecated: Please use gocql.Session.NewBatch() instead. func Batch() *BatchBuilder {