Browse Source

Merge pull request #451 from johnweldon/master

Implement stringer interface for the Query type
Chris Bannister 10 years ago
parent
commit
9d122d6cee
2 changed files with 6 additions and 0 deletions
  1. 1 0
      AUTHORS
  2. 5 0
      session.go

+ 1 - 0
AUTHORS

@@ -52,3 +52,4 @@ Baptiste Fontaine <b@ptistefontaine.fr>
 Matt Heath <matt@mattheath.com>
 Jamie Cuthill <jamie.cuthill@gmail.com>
 Adrian Casajus <adriancasajus@gmail.com>
+John Weldon <johnweldon4@gmail.com>

+ 5 - 0
session.go

@@ -434,6 +434,11 @@ type Query struct {
 	defaultTimestamp bool
 }
 
+// String implements the stringer interface.
+func (q Query) String() string {
+	return fmt.Sprintf("[query statement=%q values=%+v consistency=%s]", q.stmt, q.values, q.cons)
+}
+
 //Attempts returns the number of times the query was executed.
 func (q *Query) Attempts() int {
 	return q.attempts