sqlt

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 4 Imported by: 0

README

sqlt: More SQL types for Go

Go Reference CI codecov Go Report Card

Overview

Note: This module should not be used in new code. The generic type database/sql.Null is available in the standard library since Go 1.22.

The sqlt package provides types that implement Go's database/sql.Scanner and database/sql/driver.Valuer interfaces:

Documentation

Overview

Package sqlt provides types that implement the database/sql.Scanner and database/sql/driver.Valuer interfaces.

Note: This module should not be used in new code. The generic type database/sql.Null is available in the standard library since Go 1.22.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NullRawMessage

type NullRawMessage struct {
	RawMessage json.RawMessage
	Valid      bool // Valid is true if RawMessage is not NULL
}

NullRawMessage represents a encoding/json.RawMessage that may be null. NullRawMessage implements the database/sql.Scanner interface so it can be used as a scan destination.

func (*NullRawMessage) Scan

func (nm *NullRawMessage) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface.

func (NullRawMessage) Value

func (nm NullRawMessage) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface.

type NullUUID

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

NullUUID represents a github.com/google/uuid.UUID that may be null. NullUUID implements the database/sql.Scanner interface so it can be used as a scan destination.

Note: This type should not be used in new code. github.com/google/uuid.NullUUID is available since v1.3.0.

func (*NullUUID) Scan

func (nu *NullUUID) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface.

func (NullUUID) Value

func (nu NullUUID) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface.

Jump to

Keyboard shortcuts

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