schema

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Bool is alias for reflect.TypeOf(false)
	Bool = reflect.TypeOf(false)
	// String is alias reflect.TypeOf("")
	String = reflect.TypeOf("")
	// Int is alias for reflect.TypeOf(int(0))
	Int = reflect.TypeOf(int(0))
	// Int8 is alias for reflect.TypeOf(int8(0))
	Int8 = reflect.TypeOf(int8(0))
	// Int16 is alias for reflect.TypeOf(int16(0))
	Int16 = reflect.TypeOf(int16(0))
	// Int32 is alias for reflect.TypeOf(int32(0))
	Int32 = reflect.TypeOf(int32(0))
	// Int64 is alias for reflect.TypeOf(int64(0))
	Int64 = reflect.TypeOf(int64(0))
	// Uint is alias for reflect.TypeOf(uint(0))
	Uint = reflect.TypeOf(uint(0))
	// Uint8 is alias for reflect.TypeOf(uint8(0))
	Uint8 = reflect.TypeOf(uint8(0))
	// Uint16 is alias for reflect.TypeOf(uint16(0))
	Uint16 = reflect.TypeOf(uint16(0))
	// Uint32 is alias for reflect.TypeOf(uint32(0))
	Uint32 = reflect.TypeOf(uint32(0))
	// Uint64 is alias for reflect.TypeOf(uint64(0))
	Uint64 = reflect.TypeOf(uint64(0))
	// Uintptr is alias for reflect.TypeOf(uintptr(0))
	Uintptr = reflect.TypeOf(uintptr(0))
	// Byte is alias for reflect.TypeOf(byte(0))
	Byte = reflect.TypeOf(byte(0))
	// Rune is alias for reflect.TypeOf(rune(' '))
	Rune = reflect.TypeOf(rune(' '))
	// Float32 is alias for reflect.TypeOf(float32(0))
	Float32 = reflect.TypeOf(float32(0))
	// Float64 is alias for reflect.TypeOf(float64(0))
	Float64 = reflect.TypeOf(float64(0))
	// Bytes is alias for reflect.TypeOf([]byte{})
	Bytes = reflect.TypeOf([]byte{})
	// Time is alias for reflect.TypeOf(time.Time{})
	Time = reflect.TypeOf(time.Time{})
)

Functions

func InferAssociation

func InferAssociation(rt reflect.Type, field string) ([]int, []int, string)

InferAssociation from a field in a struct type.

func InferFields

func InferFields(record interface{}) map[string]int

InferFields from a struct.

func InferPrimaryKey

func InferPrimaryKey(record interface{}, returnValue bool) (string, interface{})

InferPrimaryKey from struct.

func InferScanners

func InferScanners(record interface{}, fields []string) []interface{}

InferScanners from struct.

func InferTypes

func InferTypes(record interface{}) []reflect.Type

InferTypes from struct.

func InferValues

func InferValues(record interface{}) []interface{}

InferValues from struct.

func Nullable

func Nullable(dest interface{}) interface{}

Nullable wrap value as a nullable sql.Scanner. If value returned from database is nil, nullable scanner will set dest to zero value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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