Serialize binary bytea cols into hex/base64 (#537)

- Adds binary serialization into hex/base64
- Default codec is base64
- Codec can be changed via `--binary-codec` CLI option
This commit is contained in:
Dan Sosedoff
2021-12-29 11:03:50 -06:00
committed by GitHub
parent 1323012cff
commit 706caa44bf
8 changed files with 159 additions and 32 deletions

View File

@@ -31,3 +31,15 @@ func containsRestrictedKeywords(str string) bool {
return reRestrictedKeywords.MatchString(str)
}
func hasBinary(data string, checkLen int) bool {
for idx, chr := range data {
if int(chr) < 32 || int(chr) > 126 {
return true
}
if idx >= checkLen {
break
}
}
return false
}