dbutil

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Int        = "INT"
	BigInt     = "BIGINT"
	Varchar    = "VARCHAR"
	Date       = "DATE"
	DateTime   = "DATETIME"
	Time       = "TIME"
	TimeStamp  = "TIMESTAMP"
	TimeStampz = "TIMESTAMPZ"
)

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 TakeDollarPlaceHolder

func TakeDollarPlaceHolder(sql, placeHolder string, count int, fromIndex int) string

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, timeZone *time.Location) *TimeProp

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