joao-r-reis commented on code in PR #1764: URL: https://github.com/apache/cassandra-gocql-driver/pull/1764#discussion_r1833019052
########## session.go: ########## @@ -1781,6 +1790,28 @@ func (s *Session) NewBatch(typ BatchType) *Batch { return batch } +// Batch creates a new batch operation using defaults defined in the cluster +func (s *Session) Batch(typ BatchType) *Batch { + s.mu.RLock() + batch := &Batch{ + Type: typ, + rt: s.cfg.RetryPolicy, + serialCons: s.cfg.SerialConsistency, + trace: s.trace, + observer: s.batchObserver, + session: s, + Cons: s.cons, + defaultTimestamp: s.cfg.DefaultTimestamp, + keyspace: s.cfg.Keyspace, + metrics: &queryMetrics{m: make(map[string]*hostMetrics)}, + spec: &NonSpeculativeExecution{}, + routingInfo: &queryRoutingInfo{}, + } + Review Comment: Yes thanks but please create a private function or make one of them call the other so we don't have the duplicate code. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org