Documentation
¶
Index ¶
- Variables
- func AssembleJSONObjectWithMarshaledKeys(keys [][]byte, values []string) (string, error)
- func AssembleResolvedJSONObject(columnNames []string, values []string) (string, error)
- func DecodeBase64Wire(wire string) ([]byte, error)
- func EscapeRune(r rune, isString bool, quote rune) string
- func Float32ToLiteralPolicy(v float32, policy QuotePolicy) string
- func Float64ToLiteralPolicy(v float64, policy QuotePolicy) string
- func IsNullGenericColumnValue(gcv spanner.GenericColumnValue) bool
- func MarshalJSONObjectKeys(columnNames []string) ([][]byte, error)
- func Pointers[T any, E ~[]T](e E) iter.Seq[*T]
- func ReadableBytesString(b []byte) string
- func ReadableStringFromBase64Wire(wire string) (string, error)
- func ResolveColumnNames(columnNames []string, namer func(int) string) ([]string, error)
- func ResolveColumnNamesInPlace(names []string, namer func(int) string) ([]string, error)
- func ToAny[T any](seq iter.Seq[T]) iter.Seq[any]
- func ToReadableBytesLiteralPolicy(v []byte, policy QuotePolicy) string
- func ToStringLiteralPolicy(s string, policy QuotePolicy) string
- type PreferredQuote
- type QuotePolicy
- type QuoteStrategy
Constants ¶
This section is empty.
Variables ¶
var ErrMismatchedJSONObjectFields = errors.New("mismatched JSON object key/value count")
Functions ¶
func AssembleJSONObjectWithMarshaledKeys ¶ added in v0.3.0
AssembleJSONObjectWithMarshaledKeys combines pre-marshaled JSON object keys and pre-formatted JSON value strings into a single JSON object string.
func AssembleResolvedJSONObject ¶ added in v0.3.0
AssembleResolvedJSONObject combines already-resolved JSON object keys and pre-formatted JSON value strings into a single JSON object string.
func DecodeBase64Wire ¶ added in v0.4.2
DecodeBase64Wire decodes a Spanner BYTES/PROTO base64 wire string. The returned slice is owned by the caller (not pooled).
func Float32ToLiteralPolicy ¶ added in v0.5.1
func Float32ToLiteralPolicy(v float32, policy QuotePolicy) string
func Float64ToLiteralPolicy ¶ added in v0.5.1
func Float64ToLiteralPolicy(v float64, policy QuotePolicy) string
func IsNullGenericColumnValue ¶ added in v0.3.0
func IsNullGenericColumnValue(gcv spanner.GenericColumnValue) bool
IsNullGenericColumnValue reports whether gcv represents SQL NULL. A nil gcv.Value is treated as NULL.
func MarshalJSONObjectKeys ¶ added in v0.3.0
MarshalJSONObjectKeys marshals JSON object keys once for reuse across rows.
func ReadableBytesString ¶ added in v0.4.2
ReadableBytesString formats raw bytes for Simple-style output (no b" quotes).
func ReadableStringFromBase64Wire ¶ added in v0.4.2
ReadableStringFromBase64Wire decodes a Spanner BYTES/PROTO base64 wire string and formats the payload with ReadableBytesString.
func ResolveColumnNames ¶ added in v0.3.0
ResolveColumnNames returns a copy of columnNames with every empty string replaced by a name produced by namer. Already-named columns are preserved. If namer is nil the input slice is returned unchanged without copying.
func ResolveColumnNamesInPlace ¶ added in v0.3.0
ResolveColumnNamesInPlace resolves unnamed columns in names directly. If namer is nil the input slice is returned unchanged.
func ToReadableBytesLiteralPolicy ¶ added in v0.5.1
func ToReadableBytesLiteralPolicy(v []byte, policy QuotePolicy) string
func ToStringLiteralPolicy ¶ added in v0.5.1
func ToStringLiteralPolicy(s string, policy QuotePolicy) string
Types ¶
type PreferredQuote ¶ added in v0.5.1
type PreferredQuote uint8
PreferredQuote is the delimiter used by QuoteStrategyAlways and as tie-breaker for QuoteStrategyMinEscape.
const ( PreferredQuoteDouble PreferredQuote = iota PreferredQuoteSingle )
type QuotePolicy ¶ added in v0.5.1
type QuotePolicy struct {
Strategy QuoteStrategy
Preferred PreferredQuote
}
QuotePolicy configures literal string delimiters. The zero value is legacy adaptive quoting.
type QuoteStrategy ¶ added in v0.5.1
type QuoteStrategy uint8
QuoteStrategy selects how the outer string-literal delimiter is chosen.
const ( QuoteStrategyLegacy QuoteStrategy = iota QuoteStrategyAlways QuoteStrategyMinEscape )