MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / pgwireFormatStringInArray

Function pgwireFormatStringInArray

pkg/sql/sem/tree/pgwire_encode.go:161–179  ·  view source on GitHub ↗
(buf *bytes.Buffer, in string)

Source from the content-addressed store, hash-verified

159}
160
161func pgwireFormatStringInArray(buf *bytes.Buffer, in string) {
162 quote := pgwireQuoteStringInArray(in)
163 if quote {
164 buf.WriteByte('"')
165 }
166 // Loop through each unicode code point.
167 for _, r := range in {
168 if r == '"' || r == '\\' {
169 // Strings in arrays escape " and \.
170 buf.WriteByte('\\')
171 buf.WriteByte(byte(r))
172 } else {
173 buf.WriteRune(r)
174 }
175 }
176 if quote {
177 buf.WriteByte('"')
178 }
179}
180
181// From: https://github.com/golang/go/blob/master/src/strings/strings.go
182

Callers 1

pgwireFormatMethod · 0.85

Calls 1

pgwireQuoteStringInArrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…