custom_row2struct

package
v0.0.0-...-9ee81a8 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupCustomStructScanTargets

func SetupCustomStructScanTargets(receiver any, nsf *NamedStructFieldsWithCustomTarget, customTargetVals ...any) ([]any, error)

Types

type CustomScanField

type CustomScanField struct {
	// 扫描目标在DB返回的row中的列索引,所有自定义扫描目标的插入位置将会作为最终 fields []structRowField 位置的排除项
	Pos int
	// 扫描值接收器位置
	Ord int
}

CustomScanField 表示结构外的自定义扫描目标

type CustomScanFromRow

type CustomScanFromRow struct {
	RowField string
	// 扫描值接收器位置
	Ord int
}

type NamedStructFieldsWithCustomTarget

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

func LookupNamedStructFields

func LookupNamedStructFields(
	fldDescs []pgconn.FieldDescription,
	t reflect.Type,
	customScanTargets []CustomScanFromRow,
) (*NamedStructFieldsWithCustomTarget, error)

func (*NamedStructFieldsWithCustomTarget) RequireStructFieldsInRows

func (n *NamedStructFieldsWithCustomTarget) RequireStructFieldsInRows() error

Jump to

Keyboard shortcuts

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