tengu-alt commented on code in PR #1764:
URL:
https://github.com/apache/cassandra-gocql-driver/pull/1764#discussion_r1832246571
##########
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:
I kept the `session.NewBatch` and marked it as deprecated according to your
suggestion.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]