sql

package
v1.2.123 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Json added in v1.2.123

type Json[T any] struct {
	Data T // must be set with a pointer to zero value of expect type
}

Json represents an interface that can not be null. Json implements the Scanner interface so it can be used as a scan destination, similar to sql.NullString.

func (*Json[T]) Scan added in v1.2.123

func (nj *Json[T]) Scan(src any) error

Scan implements the sql.Scanner interface.

func (Json[T]) Value added in v1.2.123

func (nj Json[T]) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

type NullJson

type NullJson[T any] struct {
	Data T // must be set with a pointer to zero value of expect type

	Valid bool // Valid is true if Data is not NULL
}

NullJson represents an interface that may be null. NullJson implements the Scanner interface so it can be used as a scan destination, similar to sql.NullString.

func (*NullJson[T]) Scan

func (nj *NullJson[T]) Scan(src any) error

Scan implements the sql.Scanner interface.

func (NullJson[T]) Value

func (nj NullJson[T]) 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