Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
github.com/cihangir/nisql
go get -u github.com/cihangir/nisql
Package nisql provides nullable types for database operations with proper json marshalling and unmarshalling
type NullBool struct {
sql.NullBool
}
NullBool is a type that can be null or a bool
func Bool(b bool) NullBool
Bool creates a valid NullBool
func (n *NullBool) Get() *bool
Get returns nil or underlying bool value
func (n *NullBool) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (n *NullBool) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type NullFloat64 struct {
sql.NullFloat64
}
NullFloat64 is a type that can be null or a float64
func Float64(f float64) NullFloat64
Float64 creates a valid NullFloat64
func (n *NullFloat64) Get() *float64
Get returns nil or underlying float64 value
func (n *NullFloat64) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (n *NullFloat64) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type NullInt64 struct {
sql.NullInt64
}
NullInt64 is a type that can be null or an int
func Int64(i int64) NullInt64
Int64 creates a valid NullInt64
func (n *NullInt64) Get() *int64
Get returns nil or underlying int64 value
func (n *NullInt64) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (n *NullInt64) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type NullString struct {
sql.NullString
}
NullString is a type that can be null or a string
func String(s string) NullString
String creates a valid NullString
func (n *NullString) Get() *string
Get returns nil or underlying string value
func (n *NullString) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (n *NullString) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type NullTime struct {
pq.NullTime
}
NullTime is a type that can be null or a time.Time
func Time(t time.Time) NullTime
Time creates a valid NullTime
func (n *NullTime) Get() *time.Time
Get returns nil or underlying time.Time value
func (n *NullTime) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (n *NullTime) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.