Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SqlPrepare ¶
func SqlPrepare(x interface{}) interface{}
TODO add sanitizing function to make it even more safer see https://github.com/jackc/pgx
Types ¶
type JSONText ¶
type JSONText json.RawMessage
JSONText is a json.RawMessage, which is a []byte underneath. Value() validates the json format in the source, and returns an error if the json is not valid. Scan does no validation. JSONText additionally implements `Unmarshal`, which unmarshals the json within to an interface{}
func (JSONText) MarshalJSON ¶
MarshalJSON returns the *j as the JSON encoding of j.
func (*JSONText) UnmarshalJSON ¶
UnmarshalJSON sets *j to a copy of data
type NullBool ¶
NullBool is an alias for sql.NullBool data type
func (NullBool) MarshalJSON ¶
func (*NullBool) UnmarshalJSON ¶
type NullBoolString ¶
TODO depricate
func SetStrBool ¶
func SetStrBool(s string) *NullBoolString
func (NullBoolString) MarshalJSON ¶
func (ns NullBoolString) MarshalJSON() ([]byte, error)
func (*NullBoolString) Scan ¶
func (ns *NullBoolString) Scan(value interface{}) error
func (*NullBoolString) UnmarshalJSON ¶
func (ns *NullBoolString) UnmarshalJSON(b []byte) error
type NullFloat64 ¶
func (NullFloat64) MarshalJSON ¶
func (ns NullFloat64) MarshalJSON() ([]byte, error)
func (*NullFloat64) Scan ¶
func (n *NullFloat64) Scan(value interface{}) error
type NullInt64 ¶
NullInt64 can accept string or interger from UnmarshalJSON
func SetInt64FromStr ¶
func (NullInt64) MarshalJSON ¶
func (*NullInt64) UnmarshalJSON ¶
type NullJSONText ¶
NullJSONText represents a JSONText that may be null. NullJSONText implements the scanner interface so it can be used as a scan destination, similar to NullString.
func SetEmptyJson ¶
func SetEmptyJson() (*NullJSONText, error)
func (*NullJSONText) Scan ¶
func (n *NullJSONText) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullString ¶
NullString MarshalJSON ignores ""
func SetStr ¶
func SetStr(s string) *NullString
func SetStrFromInt64 ¶
func SetStrFromInt64(i int64) *NullString
func (NullString) MarshalJSON ¶
func (ns NullString) MarshalJSON() ([]byte, error)
func (*NullString) Scan ¶
func (ns *NullString) Scan(value interface{}) error
func (*NullString) UnmarshalJSON ¶
func (ns *NullString) UnmarshalJSON(b []byte) error
type NullTime ¶
NullTime MarshalJSON ignores ZeroTime