Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/cihangir/nisql

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/cihangir/nisql

  • v0.0.0-20150630085131-3b217dbbe434
  • Source
  • Go
  • Socket score

Version published
Created
Source

Build Status GoDoc

nisql

go get -u github.com/cihangir/nisql

Package nisql provides nullable types for database operations with proper json marshalling and unmarshalling

Usage

type NullBool
type NullBool struct {
    sql.NullBool
}

NullBool is a type that can be null or a bool

func Bool
func Bool(b bool) NullBool

Bool creates a valid NullBool

func (*NullBool) Get
func (n *NullBool) Get() *bool

Get returns nil or underlying bool value

func (*NullBool) MarshalJSON
func (n *NullBool) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*NullBool) UnmarshalJSON
func (n *NullBool) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type NullFloat64
type NullFloat64 struct {
    sql.NullFloat64
}

NullFloat64 is a type that can be null or a float64

func Float64
func Float64(f float64) NullFloat64

Float64 creates a valid NullFloat64

func (*NullFloat64) Get
func (n *NullFloat64) Get() *float64

Get returns nil or underlying float64 value

func (*NullFloat64) MarshalJSON
func (n *NullFloat64) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*NullFloat64) UnmarshalJSON
func (n *NullFloat64) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type NullInt64
type NullInt64 struct {
    sql.NullInt64
}

NullInt64 is a type that can be null or an int

func Int64
func Int64(i int64) NullInt64

Int64 creates a valid NullInt64

func (*NullInt64) Get
func (n *NullInt64) Get() *int64

Get returns nil or underlying int64 value

func (*NullInt64) MarshalJSON
func (n *NullInt64) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

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

UnmarshalJSON implements the json.Unmarshaler interface.

type NullString
type NullString struct {
    sql.NullString
}

NullString is a type that can be null or a string

func String
func String(s string) NullString

String creates a valid NullString

func (*NullString) Get
func (n *NullString) Get() *string

Get returns nil or underlying string value

func (*NullString) MarshalJSON
func (n *NullString) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*NullString) UnmarshalJSON
func (n *NullString) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type NullTime
type NullTime struct {
    pq.NullTime
}

NullTime is a type that can be null or a time.Time

func Time
func Time(t time.Time) NullTime

Time creates a valid NullTime

func (*NullTime) Get
func (n *NullTime) Get() *time.Time

Get returns nil or underlying time.Time value

func (*NullTime) MarshalJSON
func (n *NullTime) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*NullTime) UnmarshalJSON
func (n *NullTime) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

FAQs

Package last updated on 30 Jun 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc