package
4.18.2+incompatible
Repository: https://github.com/ec2-software/pop.git
Documentation: pkg.go.dev

# README

github.com/gobuffalo/pop/nulls

DEPRECATED: use github.com/gobuffalo/nulls instead.

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/gobuffalo/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

New returns a wrapper called nulls for the interface passed as a param.

# Variables

NewBool returns a new, properly instantiated Bool 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.
NewUUID returns a new, properly instantiated UUID object.
RegisterWithSchema allows for the nulls package to be used with http://www.gorillatoolkit.org/pkg/schema#Converter.

# Structs

Nulls a generic nulls type.

# Type aliases

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.
Float64 replaces sql.NullFloat64 with an implementation 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.
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.
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.
UUID can be used with the standard sql package to represent a UUID value that can be NULL in the database Deprecated: use github.com/gobuffalo/nulls#UUID instead.