internal

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMismatchedJSONObjectFields = errors.New("mismatched JSON object key/value count")

Functions

func AssembleJSONObjectWithMarshaledKeys added in v0.3.0

func AssembleJSONObjectWithMarshaledKeys(keys [][]byte, values []string) (string, error)

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

func AssembleResolvedJSONObject(columnNames []string, values []string) (string, error)

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

func DecodeBase64Wire(wire string) ([]byte, error)

DecodeBase64Wire decodes a Spanner BYTES/PROTO base64 wire string. The returned slice is owned by the caller (not pooled).

func EscapeRune added in v0.1.8

func EscapeRune(r rune, isString bool, quote rune) string

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

func MarshalJSONObjectKeys(columnNames []string) ([][]byte, error)

MarshalJSONObjectKeys marshals JSON object keys once for reuse across rows.

func Pointers

func Pointers[T any, E ~[]T](e E) iter.Seq[*T]

func ReadableBytesString added in v0.4.2

func ReadableBytesString(b []byte) string

ReadableBytesString formats raw bytes for Simple-style output (no b" quotes).

func ReadableStringFromBase64Wire added in v0.4.2

func ReadableStringFromBase64Wire(wire string) (string, error)

ReadableStringFromBase64Wire decodes a Spanner BYTES/PROTO base64 wire string and formats the payload with ReadableBytesString.

func ResolveColumnNames added in v0.3.0

func ResolveColumnNames(columnNames []string, namer func(int) string) ([]string, error)

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

func ResolveColumnNamesInPlace(names []string, namer func(int) string) ([]string, error)

ResolveColumnNamesInPlace resolves unnamed columns in names directly. If namer is nil the input slice is returned unchanged.

func ToAny

func ToAny[T any](seq iter.Seq[T]) iter.Seq[any]

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL