null

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2020 License: GPL-3.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package null provides some clean helpers for sql NULL value handling

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b interface{}) sql.NullBool

Bool safely converts b to a sql.NullBool

func Int64

func Int64(i interface{}) sql.NullInt64

Int64 safely converts i to a sql.NullInt64

func JSON

func JSON(j interface{}) types.NullJSONText

JSON safely convers or marshals to a sql.NullJSONText Failure to marshal results in an error object

func String

func String(s interface{}) sql.NullString

String safely converts s to a sql.NullString

func Time

func Time(tm interface{}) sql.NullTime

Time safely converts tm to a sql.NullTime

Types

type Timer

type Timer interface {
	Time() time.Time
}

Timer is time interface

type UUID

type UUID struct {
	UUID  uuid.UUID
	Valid bool // Valid is true if UUID is not NULL
}

UUID represents a uuid that may be null.

func MakeUUID

func MakeUUID(u interface{}) UUID

MakeUUID safely converts s to a null.UUID

func (*UUID) Scan

func (u *UUID) Scan(value interface{}) error

Scan implements the Scanner interface.

func (UUID) Value

func (u UUID) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL