database

package
v0.0.0-...-bf09d72 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCustomType

func ParseCustomType(src, del []byte) (elems [][]byte, err error)

ParseCustomType parses a Postgres custom type retrieved from the database.

func QuoteAndEscapeRecordValue

func QuoteAndEscapeRecordValue(text string) string

QuoteAndEscapeValue wraps escaped double quotes around single composite record values, and escapes specific special runes within the value. Composite record arrays line format looks like: {"(\"val1\",\"val2\")""} Escape code mostly copied from https://github.com/lib/pq/blob/master/encode.go#L160-L196

func QuoteString

func QuoteString(s string) string

QuoteString wraps a string properly for use in a Postgres custom type.

Types

type DBInstrumentTimer

type DBInstrumentTimer interface {
	End() error
}

func StartDBTimer

func StartDBTimer(ctx context.Context, collection, operation, query string) DBInstrumentTimer

StartDBTimer starts a special DB timer and returns something that must be End()-ed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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