dbutil

package
v0.0.0-...-82d63aa Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatColumnTime

func FormatColumnTime(fmtTimeStampz string, defaultTimeZone *time.Location, prop *TimeProp, t time.Time) (v interface{})

func FormatTime

func FormatTime(fmtTimeStampz string, sqlTypeName string, t time.Time) (v interface{})

FormatTime format time as column type

func IsErrParamIsEmpty

func IsErrParamIsEmpty(err error) bool

func NewErrParamIsEmpty

func NewErrParamIsEmpty(param string) error

func ParseStruct

func ParseStruct(src interface{}, bean interface{}) error

func Struct2String

func Struct2String(v interface{}) (string, error)

func TakePlaceHolder

func TakePlaceHolder(sql, placeHolder string, count int) string

Types

type BlobReadWriter

type BlobReadWriter interface {
	Read([]byte) error
	Write() ([]byte, error)
}

type ErrParamIsEmpty

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

ErrParamIsEmpty SQL 的 in 参数是空时返回的错误

func (*ErrParamIsEmpty) Error

func (e *ErrParamIsEmpty) Error() string

type NullTime

type NullTime time.Time

func (*NullTime) Scan

func (ns *NullTime) Scan(value interface{}) error

func (*NullTime) Time

func (ns *NullTime) Time() time.Time

func (NullTime) Value

func (ns NullTime) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type TimeProp

type TimeProp struct {
	TypeName string
	Nullable bool
	TimeZone *time.Location
}

func NewTimeProp

func NewTimeProp(typeName string, nullable bool, timeZoneName string) (*TimeProp, error)

type TimePropDesc

type TimePropDesc struct {
	TypeName string
	Nullable bool
	TimeZone string
}

Jump to

Keyboard shortcuts

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