Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlvalue

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sqlvalue owns lossless SQL driver-value snapshots shared by cursors, model identities and other explicit persistence/transport boundaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeNull

func NormalizeNull(v driver.Value) driver.Value

NormalizeNull maps driver nil byte slices to SQL NULL. Non-nil empty slices remain empty bytes, matching PostgreSQL and the database/sql byte boundary.

Types

type Value

type Value struct {
	Kind string `json:"k"`
	Text string `json:"t,omitempty"`
}

Value retains the driver kind, exact text and owned byte encoding. This is an internal wire representation, not an application model or query API.

func Encode

func Encode(v driver.Value) (Value, error)

Encode snapshots a supported driver value without retaining mutable bytes.

func (Value) Decode

func (v Value) Decode() (driver.Value, error)

Decode restores a driver value and gives each caller its own byte buffer.

Jump to

Keyboard shortcuts

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