pgconv

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package pgconv holds small Go-value <-> pgtype conversion helpers that were duplicated verbatim across the gtd, decision, session, workspace, vision, and proposal store.go files. Consolidated here so future backend changes (e.g. NULL-handling semantics) only need to happen in one place.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToText

func ToText(v string) pgtype.Text

ToText converts a Go string into a pgtype.Text, treating the empty string as NULL (Valid: false).

func ToTextPtr

func ToTextPtr(v *string) pgtype.Text

ToTextPtr converts an optional *string into a pgtype.Text using presence semantics: nil maps to NULL (Valid: false) — "caller didn't pass this field, preserve whatever is stored". A non-nil pointer — even to "" — maps to that exact string (Valid: true), an explicit value including an explicit clear. Unlike ToText, ToTextPtr does NOT collapse "" into NULL: that collapse is what let "omitted" and "explicitly empty" fold into the same wire value upstream, the root cause behind Ω6 (2026-08-20-mcp-surface-spec.md, sync_repo's clobber-on-omit bug).

func ToTimestamptz

func ToTimestamptz(t *time.Time) pgtype.Timestamptz

ToTimestamptz converts an optional *time.Time into a pgtype.Timestamptz. A nil pointer maps to NULL (Valid: false).

func ToUUID

func ToUUID(id *uuid.UUID) pgtype.UUID

ToUUID converts an optional *uuid.UUID into a pgtype.UUID. A nil pointer maps to NULL (Valid: false).

Types

This section is empty.

Jump to

Keyboard shortcuts

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