From 0f94161288cd86f0d40cb6044bb73c370fbb8642 Mon Sep 17 00:00:00 2001 From: Henrik Johansson Date: Mon, 17 Jun 2019 15:18:26 +0200 Subject: [PATCH] truncating blobs when pretty printing --- types.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types.go b/types.go index 052a68c2..935d51c7 100644 --- a/types.go +++ b/types.go @@ -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: