pgcopy

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCopyDelimiter = '\t'

Variables

View Source
var DefaultCopyTerminationSeq = []byte("\\.")
View Source
var DefaultNullSeq = []byte("\\N")
View Source
var ErrIndexOutOfRage = errors.New("wrong column idx: index out of range")

Functions

func DecodeAttr

func DecodeAttr(raw []byte, buf []byte) *toolkit.RawValue

func EncodeAttr

func EncodeAttr(v *toolkit.RawValue, buf []byte) []byte

EncodeAttr - encode from UTF-8 slice to transfer representation (escaped byte[])

Types

type Row

type Row struct {
	// contains filtered or unexported fields
}

Row - the row driver that works with vanilla COPY format

func NewRow

func NewRow(tupleSize int) *Row

func (*Row) Clean

func (r *Row) Clean()

func (*Row) Decode

func (r *Row) Decode(raw []byte) error

func (*Row) Encode

func (r *Row) Encode() ([]byte, error)

Encode - return encoded bytes from golang representation to COPY format. if SetColumn has never been called than original raw data will be returned

func (*Row) GetColumn

func (r *Row) GetColumn(idx int) (*toolkit.RawValue, error)

GetColumn - find raw data and encode it using DecodeAttr

func (*Row) Length

func (r *Row) Length() int

func (*Row) SetColumn

func (r *Row) SetColumn(idx int, v *toolkit.RawValue) error

SetColumn - set column (replace original) value and decode it later

Jump to

Keyboard shortcuts

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