fielddef

package
v0.0.0-...-7de2c07 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Insert

func Insert(ctx context.Context, db Executable, table string, fieldOrder []string, def map[string]FieldDefinition) error

func Scan

func Scan(row Scannable, fieldOrder []string, def map[string]FieldDefinition) error

Types

type BytesFieldDef

type BytesFieldDef struct {
	Marshalled []byte
	F          *SqlBytes
}

func (*BytesFieldDef) FieldPtr

func (fd *BytesFieldDef) FieldPtr() interface{}

func (*BytesFieldDef) Marshall

func (fd *BytesFieldDef) Marshall() (interface{}, error)

func (*BytesFieldDef) Unmarshall

func (fd *BytesFieldDef) Unmarshall() error

type CidFieldDef

type CidFieldDef struct {
	Marshalled []byte
	F          *cid.Cid
}

func (*CidFieldDef) FieldPtr

func (fd *CidFieldDef) FieldPtr() interface{}

func (*CidFieldDef) Marshall

func (fd *CidFieldDef) Marshall() (interface{}, error)

func (*CidFieldDef) Unmarshall

func (fd *CidFieldDef) Unmarshall() error

type Executable

type Executable interface {
	ExecContext(context.Context, string, ...any) (sql.Result, error)
}

type FieldDef

type FieldDef struct {
	F interface{}
}

func (*FieldDef) FieldPtr

func (fd *FieldDef) FieldPtr() interface{}

func (*FieldDef) Marshall

func (fd *FieldDef) Marshall() (interface{}, error)

func (*FieldDef) Unmarshall

func (fd *FieldDef) Unmarshall() error

type FieldDefinition

type FieldDefinition interface {
	FieldPtr() interface{}
	Marshall() (interface{}, error)
	Unmarshall() error
}

type Scannable

type Scannable interface {
	Scan(dest ...interface{}) error
}

type SqlBytes

type SqlBytes []byte

func (SqlBytes) Bytes

func (m SqlBytes) Bytes() []byte

Jump to

Keyboard shortcuts

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