simplesql

package
v0.3.32 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNullInt32FromInt32Ptr added in v0.3.20

func NewNullInt32FromInt32Ptr(source *int32) (result sql.NullInt32)

NewNullInt32FromInt32Ptr 根据 *int32 创建 sql.NullInt32

func NewNullInt64FromInt64Ptr added in v0.3.20

func NewNullInt64FromInt64Ptr(source *int64) (result sql.NullInt64)

NewNullInt64FromInt64Ptr 根据 *int64 创建 sql.NullInt64

func NewNullTimeFromTimestampPB added in v0.3.19

func NewNullTimeFromTimestampPB(source *timestamppb.Timestamp) (result sql.NullTime)

NewNullTimeFromTimestampPB 根据 *timestamppb.Timestamp 创建 sql.NullTime

func ToNullTime

func ToNullTime(t time.Time) sql.NullTime

ToNullTime 根据 time 类型快速生成 sql.NullTime

Types

type NullInt64 added in v0.3.5

type NullInt64 struct {
	sql.NullInt64
}

NullInt64 封装 sql.NullInt64 类型

func NewNullInt64 added in v0.3.5

func NewNullInt64(Int64 int64, Valid bool) *NullInt64

NewNullInt64 构造函数

func (NullInt64) MarshalJSON added in v0.3.5

func (n NullInt64) MarshalJSON() (data []byte, err error)

MarshalJSON json 序列化接口

func (*NullInt64) UnmarshalJSON added in v0.3.5

func (n *NullInt64) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON json 反序列化接口

type SecondNullTime

type SecondNullTime struct {
	sql.NullTime
}

SecondNullTime 精确到秒

func ToSecondNullTime

func ToSecondNullTime(t time.Time) SecondNullTime

ToNullTime 根据 time类型快速生成 SecondNullTime

func (*SecondNullTime) MarshalJSON

func (s *SecondNullTime) MarshalJSON() (data []byte, err error)

MarshalJSON json 序列化接口

func (*SecondNullTime) UnmarshalJSON

func (s *SecondNullTime) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON json 反序列化接口

Jump to

Keyboard shortcuts

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