mirror of
https://github.com/jackc/pgx.git
synced 2025-04-27 21:25:53 +00:00
Remove remaining array code
This commit is contained in:
parent
89bcc0670c
commit
c4db9d3547
18
values.go
18
values.go
@ -161,24 +161,6 @@ func (n *NullInt64) EncodeText() (string, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var arrayEl *regexp.Regexp = regexp.MustCompile(`[{,](?:"((?:[^"\\]|\\.)*)"|(NULL)|([^,}]+))`)
|
|
||||||
|
|
||||||
// SplitArrayText is used by array transcoders to split array text into elements
|
|
||||||
func SplitArrayText(text string) (elements []string) {
|
|
||||||
matches := arrayEl.FindAllStringSubmatch(text, -1)
|
|
||||||
elements = make([]string, 0, len(matches))
|
|
||||||
for _, match := range matches {
|
|
||||||
if match[1] != "" {
|
|
||||||
elements = append(elements, match[1])
|
|
||||||
} else if match[2] != "" {
|
|
||||||
elements = append(elements, match[2])
|
|
||||||
} else if match[3] != "" {
|
|
||||||
elements = append(elements, match[3])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func decodeBool(qr *QueryResult, fd *FieldDescription, size int32) bool {
|
func decodeBool(qr *QueryResult, fd *FieldDescription, size int32) bool {
|
||||||
switch fd.FormatCode {
|
switch fd.FormatCode {
|
||||||
case TextFormatCode:
|
case TextFormatCode:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user