pgtypealias

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

package pgtypealias exists to work around sqlc bugs with being able to reference v5 the pgtype package from within a dbsql package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bits

type Bits struct {
	pgtype.Bits
}

type NullBytea added in v0.17.0

type NullBytea []byte //nolint:recvcheck

NullBytea is a custom type for PostgreSQL bytea that returns SQL NULL when the underlying slice is nil or empty. This override takes over for the base type `bytea`, so that when sqlc generates code for arrays of bytea, each element is a NullBytea and properly handles nil values. This is in contrast to the default behavior of pq.Array in this scenario.

See https://github.com/riverqueue/river/issues/650 for more information.

func (*NullBytea) Scan added in v0.17.0

func (nb *NullBytea) Scan(src interface{}) error

Scan implements the sql.Scanner interface.

func (NullBytea) Value added in v0.17.0

func (nb NullBytea) Value() (driver.Value, error)

Value implements the driver.Valuer interface. It returns nil when the underlying slice is nil or empty, ensuring that missing values are sent as SQL NULL.

Jump to

Keyboard shortcuts

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