Skip to content

Commit

Permalink
truncating blobs when pretty printing
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik Johansson committed Jun 17, 2019
1 parent 0a6c4e6 commit 0f94161
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ func (st SimpleType) CQLPretty(query string, value []interface{}) (string, int)
replacement = fmt.Sprintf("'%s'", value[0])
case TYPE_BLOB:
if v, ok := value[0].(string); ok {
if len(v) > 100 {
v = v[:100]
}
replacement = "textasblob('" + v + "')"
}
case TYPE_BIGINT, TYPE_INT, TYPE_SMALLINT, TYPE_TINYINT:
Expand Down

0 comments on commit 0f94161

Please sign in to comment.