package
3.11.0+incompatible
Repository: https://github.com/meshwalker/pop.git
Documentation: pkg.go.dev

# README

github.com/markbates/pop/nulls

This package should be used in place of the built-in null types in the sql package.

The real benefit of this packages comes in its implementation of MarshalJSON and UnmarshalJSON to properly encode/decode null values.

Installation

$ go get github.com/markbates/pop/nulls

Supported Datatypes

  • string (nulls.String) - Replaces sql.NullString
  • int64 (nulls.Int64) - Replaces sql.NullInt64
  • float64 (nulls.Float64) - Replaces sql.NullFloat64
  • bool (nulls.Bool) - Replaces sql.NullBool
  • []byte (nulls.ByteSlice)
  • float32 (nulls.Float32)
  • int (nulls.Int)
  • int32 (nulls.Int32)
  • uint32 (nulls.UInt32)
  • time.Time (nulls.Time)

# Functions

NewBool returns a new, properly instantiated Boll object.
NewByteSlice returns a new, properly instantiated ByteSlice object.
NewFloat32 returns a new, properly instantiated Float32 object.
NewFloat64 returns a new, properly instantiated Float64 object.
NewInt returns a new, properly instantiated Int object.
NewInt32 returns a new, properly instantiated Int object.
NewInt64 returns a new, properly instantiated Int64 object.
NewString returns a new, properly instantiated String object.
NewTime returns a new, properly instantiated Time object.
NewUInt32 returns a new, properly instantiated Int object.

# Structs

Bool replaces sql.NullBool with an implementation that supports proper JSON encoding/decoding.
ByteSlice adds an implementation for []byte that supports proper JSON encoding/decoding.
Float32 adds an implementation for float32 that supports proper JSON encoding/decoding.
Int adds an implementation for int that supports proper JSON encoding/decoding.
Int32 adds an implementation for int32 that supports proper JSON encoding/decoding.
Time replaces sql.NullTime with an implementation that supports proper JSON encoding/decoding.
UInt32 adds an implementation for int that supports proper JSON encoding/decoding.

# Type aliases

Float64 replaces sql.NullFloat64 with an implementation that supports proper JSON encoding/decoding.
Int64 replaces sql.Int64 with an implementation that supports proper JSON encoding/decoding.
String replaces sql.NullString with an implementation that supports proper JSON encoding/decoding.