sqltypes

package
v1.0.62 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

README

sqltypes

Nullable SQL types for hand-written or generated Go models. Each type wraps a value with a Valid flag and implements database/sql.Scanner, driver.Valuer, encoding/json, gopkg.in/yaml.v3, and encoding/xml marshalling — so a single struct field can be scanned from a database row, round-tripped through JSON/YAML/XML, and written back to the database without any per-format glue code.

This package is what the bun and gorm writers emit when generating models with --types sqltypes (see pkg/writers/bun and pkg/writers/gorm). It can also be imported directly in hand-written models.

Import

import sql_types "git.warky.dev/wdevs/relspecgo/pkg/sqltypes"

Scalar types

All scalar types are instantiations of the generic SqlNull[T]:

Type Underlying Typical SQL type
SqlInt16 int16 smallint
SqlInt32 int32 integer
SqlInt64 int64 bigint
SqlFloat32 float32 real, float4
SqlFloat64 float64 double precision, numeric, decimal, money
SqlBool bool boolean
SqlString string text, varchar, char, citext, inet, cidr, macaddr
SqlByteArray []byte bytea (base64-encoded in JSON/YAML/XML)
SqlUUID uuid.UUID (github.com/google/uuid) uuid

You can also instantiate SqlNull[T] directly for any type not covered above, e.g. SqlNull[MyEnum].

Date/time types

Plain time.Time doesn't distinguish date-only, time-only, and timestamp semantics, and its zero value marshals to a confusing 0001-01-01T00:00:00Z. These wrapper types fix both problems:

Type Format Notes
SqlTimeStamp 2006-01-02T15:04:05 Full timestamp
SqlDate 2006-01-02 Date only
SqlTime 15:04:05 Time only

Zero/pre-epoch values (time.Time{} or anything before 0002-01-01) marshal to null and Value() returns nil, instead of leaking Go's zero-time sentinel into the database or API responses.

JSON types
Type Underlying Notes
SqlJSONB []byte Raw JSON bytes; MarshalYAML decodes to native YAML mappings/sequences instead of an embedded JSON string
SqlJSON = SqlJSONB Alias — PostgreSQL's json and jsonb share the same Go representation

SqlJSONB has AsMap() / AsSlice() helpers for pulling out map[string]any / []any without a separate json.Unmarshal call.

Vector type (pgvector)

SqlVector wraps []float32 for the vector column type (pgvector), scanning/writing the [1,2,3] literal format pgvector uses over the wire.

Array types

PostgreSQL array columns (text[], integer[], …) map to SqlXxxArray types, each wrapping Val []T + Valid bool and handling PostgreSQL's {a,b,c} array literal format on Scan/Value:

SqlStringArray, SqlInt16Array, SqlInt32Array, SqlInt64Array, SqlFloat32Array, SqlFloat64Array, SqlBoolArray, SqlUUIDArray.

Constructing values

Every type has a NewSqlXxx(v) constructor that sets Valid: true:

name := sql_types.NewSqlString("Ada Lovelace")
age  := sql_types.NewSqlInt32(36)
tags := sql_types.NewSqlStringArray([]string{"engineer", "mathematician"})

The zero value of any type (sql_types.SqlString{}) is null/invalid — use it directly for a NULL field instead of a separate constructor.

Generic helpers:

sql_types.Null(v, valid)      // SqlNull[T]{Val: v, Valid: valid}
sql_types.NewSql[T](anyValue) // best-effort conversion from any Go value

Reading values back

Each scalar type has typed accessors that return the zero value instead of panicking when Valid is false:

n.Int64()   // SqlInt16/32/64, SqlFloat32/64, SqlBool, SqlString → int64
n.Float64() // → float64
n.Bool()    // → bool
n.Time()    // SqlNull[time.Time]-based types → time.Time
n.UUID()    // SqlUUID → uuid.UUID
n.String()  // fmt.Stringer — empty string when invalid

Example

type User struct {
    ID        sql_types.SqlUUID        `json:"id"`
    Name      sql_types.SqlString      `json:"name"`
    Tags      sql_types.SqlStringArray `json:"tags"`
    Metadata  sql_types.SqlJSONB       `json:"metadata"`
    CreatedAt sql_types.SqlTimeStamp   `json:"created_at"`
}

u := User{
    ID:        sql_types.NewSqlUUID(uuid.New()),
    Name:      sql_types.NewSqlString("Ada Lovelace"),
    Tags:      sql_types.NewSqlStringArray([]string{"engineer"}),
    CreatedAt: sql_types.SqlTimeStampNow(),
}
// Metadata left as the zero value → serializes as null, scans as NULL.

Every type implements sql.Scanner and driver.Valuer, so these fields can be used directly as struct fields with database/sql, bun, or gorm without additional tags or hooks.

Documentation

Overview

Package sqltypes provides nullable SQL types with automatic casting and conversion methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToJSONDT

func ToJSONDT(dt time.Time) string

ToJSONDT formats a time.Time to RFC3339 string.

func TryIfInt64

func TryIfInt64(v any, def int64) int64

TryIfInt64 tries to parse any value to int64 with default.

Types

type SqlBool

type SqlBool = SqlNull[bool]

Type aliases for common types.

func NewSqlBool

func NewSqlBool(v bool) SqlBool

type SqlBoolArray

type SqlBoolArray struct {
	Val   []bool
	Valid bool
}

func NewSqlBoolArray

func NewSqlBoolArray(v []bool) SqlBoolArray

func (SqlBoolArray) MarshalJSON

func (a SqlBoolArray) MarshalJSON() ([]byte, error)

func (SqlBoolArray) MarshalXML

func (a SqlBoolArray) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlBoolArray) MarshalYAML

func (a SqlBoolArray) MarshalYAML() (any, error)

func (*SqlBoolArray) Scan

func (a *SqlBoolArray) Scan(value any) error

func (*SqlBoolArray) UnmarshalJSON

func (a *SqlBoolArray) UnmarshalJSON(b []byte) error

func (*SqlBoolArray) UnmarshalXML

func (a *SqlBoolArray) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SqlBoolArray) UnmarshalYAML

func (a *SqlBoolArray) UnmarshalYAML(value *yaml.Node) error

func (SqlBoolArray) Value

func (a SqlBoolArray) Value() (driver.Value, error)

type SqlByteArray

type SqlByteArray = SqlNull[[]byte]

Type aliases for common types.

func NewSqlByteArray

func NewSqlByteArray(v []byte) SqlByteArray

type SqlDate

type SqlDate struct{ SqlNull[time.Time] }

SqlDate - Date only (YYYY-MM-DD).

func NewSqlDate

func NewSqlDate(v time.Time) SqlDate

func SqlDateNow

func SqlDateNow() SqlDate

func (SqlDate) MarshalJSON

func (d SqlDate) MarshalJSON() ([]byte, error)

func (SqlDate) MarshalXML

func (d SqlDate) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlDate) MarshalYAML

func (d SqlDate) MarshalYAML() (any, error)

func (SqlDate) String

func (d SqlDate) String() string

func (*SqlDate) UnmarshalJSON

func (d *SqlDate) UnmarshalJSON(b []byte) error

func (*SqlDate) UnmarshalXML

func (d *SqlDate) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

func (*SqlDate) UnmarshalYAML

func (d *SqlDate) UnmarshalYAML(value *yaml.Node) error

func (SqlDate) Value

func (d SqlDate) Value() (driver.Value, error)

type SqlFloat32

type SqlFloat32 = SqlNull[float32]

Type aliases for common types.

func NewSqlFloat32

func NewSqlFloat32(v float32) SqlFloat32

type SqlFloat32Array

type SqlFloat32Array struct {
	Val   []float32
	Valid bool
}

func NewSqlFloat32Array

func NewSqlFloat32Array(v []float32) SqlFloat32Array

func (SqlFloat32Array) MarshalJSON

func (a SqlFloat32Array) MarshalJSON() ([]byte, error)

func (SqlFloat32Array) MarshalXML

func (a SqlFloat32Array) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlFloat32Array) MarshalYAML

func (a SqlFloat32Array) MarshalYAML() (any, error)

func (*SqlFloat32Array) Scan

func (a *SqlFloat32Array) Scan(value any) error

func (*SqlFloat32Array) UnmarshalJSON

func (a *SqlFloat32Array) UnmarshalJSON(b []byte) error

func (*SqlFloat32Array) UnmarshalXML

func (a *SqlFloat32Array) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SqlFloat32Array) UnmarshalYAML

func (a *SqlFloat32Array) UnmarshalYAML(value *yaml.Node) error

func (SqlFloat32Array) Value

func (a SqlFloat32Array) Value() (driver.Value, error)

type SqlFloat64

type SqlFloat64 = SqlNull[float64]

Type aliases for common types.

func NewSqlFloat64

func NewSqlFloat64(v float64) SqlFloat64

type SqlFloat64Array

type SqlFloat64Array struct {
	Val   []float64
	Valid bool
}

func NewSqlFloat64Array

func NewSqlFloat64Array(v []float64) SqlFloat64Array

func (SqlFloat64Array) MarshalJSON

func (a SqlFloat64Array) MarshalJSON() ([]byte, error)

func (SqlFloat64Array) MarshalXML

func (a SqlFloat64Array) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlFloat64Array) MarshalYAML

func (a SqlFloat64Array) MarshalYAML() (any, error)

func (*SqlFloat64Array) Scan

func (a *SqlFloat64Array) Scan(value any) error

func (*SqlFloat64Array) UnmarshalJSON

func (a *SqlFloat64Array) UnmarshalJSON(b []byte) error

func (*SqlFloat64Array) UnmarshalXML

func (a *SqlFloat64Array) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SqlFloat64Array) UnmarshalYAML

func (a *SqlFloat64Array) UnmarshalYAML(value *yaml.Node) error

func (SqlFloat64Array) Value

func (a SqlFloat64Array) Value() (driver.Value, error)

type SqlInt16

type SqlInt16 = SqlNull[int16]

Type aliases for common types.

func NewSqlInt16

func NewSqlInt16(v int16) SqlInt16

type SqlInt16Array

type SqlInt16Array struct {
	Val   []int16
	Valid bool
}

func NewSqlInt16Array

func NewSqlInt16Array(v []int16) SqlInt16Array

func (SqlInt16Array) MarshalJSON

func (a SqlInt16Array) MarshalJSON() ([]byte, error)

func (SqlInt16Array) MarshalXML

func (a SqlInt16Array) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlInt16Array) MarshalYAML

func (a SqlInt16Array) MarshalYAML() (any, error)

func (*SqlInt16Array) Scan

func (a *SqlInt16Array) Scan(value any) error

func (*SqlInt16Array) UnmarshalJSON

func (a *SqlInt16Array) UnmarshalJSON(b []byte) error

func (*SqlInt16Array) UnmarshalXML

func (a *SqlInt16Array) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SqlInt16Array) UnmarshalYAML

func (a *SqlInt16Array) UnmarshalYAML(value *yaml.Node) error

func (SqlInt16Array) Value

func (a SqlInt16Array) Value() (driver.Value, error)

type SqlInt32

type SqlInt32 = SqlNull[int32]

Type aliases for common types.

func NewSqlInt32

func NewSqlInt32(v int32) SqlInt32

type SqlInt32Array

type SqlInt32Array struct {
	Val   []int32
	Valid bool
}

func NewSqlInt32Array

func NewSqlInt32Array(v []int32) SqlInt32Array

func (SqlInt32Array) MarshalJSON

func (a SqlInt32Array) MarshalJSON() ([]byte, error)

func (SqlInt32Array) MarshalXML

func (a SqlInt32Array) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlInt32Array) MarshalYAML

func (a SqlInt32Array) MarshalYAML() (any, error)

func (*SqlInt32Array) Scan

func (a *SqlInt32Array) Scan(value any) error

func (*SqlInt32Array) UnmarshalJSON

func (a *SqlInt32Array) UnmarshalJSON(b []byte) error

func (*SqlInt32Array) UnmarshalXML

func (a *SqlInt32Array) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SqlInt32Array) UnmarshalYAML

func (a *SqlInt32Array) UnmarshalYAML(value *yaml.Node) error

func (SqlInt32Array) Value

func (a SqlInt32Array) Value() (driver.Value, error)

type SqlInt64

type SqlInt64 = SqlNull[int64]

Type aliases for common types.

func NewSqlInt64

func NewSqlInt64(v int64) SqlInt64

type SqlInt64Array

type SqlInt64Array struct {
	Val   []int64
	Valid bool
}

func NewSqlInt64Array

func NewSqlInt64Array(v []int64) SqlInt64Array

func (SqlInt64Array) MarshalJSON

func (a SqlInt64Array) MarshalJSON() ([]byte, error)

func (SqlInt64Array) MarshalXML

func (a SqlInt64Array) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlInt64Array) MarshalYAML

func (a SqlInt64Array) MarshalYAML() (any, error)

func (*SqlInt64Array) Scan

func (a *SqlInt64Array) Scan(value any) error

func (*SqlInt64Array) UnmarshalJSON

func (a *SqlInt64Array) UnmarshalJSON(b []byte) error

func (*SqlInt64Array) UnmarshalXML

func (a *SqlInt64Array) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SqlInt64Array) UnmarshalYAML

func (a *SqlInt64Array) UnmarshalYAML(value *yaml.Node) error

func (SqlInt64Array) Value

func (a SqlInt64Array) Value() (driver.Value, error)

type SqlJSON

type SqlJSON = SqlJSONB

SqlJSON - Nullable JSON as []byte. PostgreSQL's json and jsonb types share the same textual representation and Go marshalling behavior, differing only in server-side storage, so SqlJSON is an alias of SqlJSONB.

type SqlJSONB

type SqlJSONB []byte

SqlJSONB - Nullable JSONB as []byte.

func (SqlJSONB) AsMap

func (n SqlJSONB) AsMap() (map[string]any, error)

func (SqlJSONB) AsSlice

func (n SqlJSONB) AsSlice() ([]any, error)

func (SqlJSONB) MarshalJSON

func (n SqlJSONB) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (SqlJSONB) MarshalXML

func (n SqlJSONB) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML implements xml.Marshaler. JSON has no clean structural mapping to XML, so the raw JSON text is emitted as the element's text content.

func (SqlJSONB) MarshalYAML

func (n SqlJSONB) MarshalYAML() (any, error)

MarshalYAML implements yaml.Marshaler. The underlying JSON is decoded into a generic value first so it renders as native YAML mappings/sequences rather than an embedded JSON string.

func (*SqlJSONB) Scan

func (n *SqlJSONB) Scan(value any) error

Scan implements sql.Scanner.

func (*SqlJSONB) UnmarshalJSON

func (n *SqlJSONB) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*SqlJSONB) UnmarshalXML

func (n *SqlJSONB) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML implements xml.Unmarshaler, reading back the raw JSON text written by MarshalXML.

func (*SqlJSONB) UnmarshalYAML

func (n *SqlJSONB) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (SqlJSONB) Value

func (n SqlJSONB) Value() (driver.Value, error)

Value implements driver.Valuer.

type SqlNull

type SqlNull[T any] struct {
	Val   T
	Valid bool
}

SqlNull is a generic nullable type that behaves like sql.NullXXX with auto-casting.

func NewSql

func NewSql[T any](value any) SqlNull[T]

func Null

func Null[T any](v T, valid bool) SqlNull[T]

Constructor helpers - clean and fast value creation

func (SqlNull[T]) Bool

func (n SqlNull[T]) Bool() bool

Bool converts to bool or false if invalid.

func (SqlNull[T]) Float64

func (n SqlNull[T]) Float64() float64

Float64 converts to float64 or 0.0 if invalid.

func (*SqlNull[T]) FromString

func (n *SqlNull[T]) FromString(s string) error

func (SqlNull[T]) Int64

func (n SqlNull[T]) Int64() int64

Int64 converts to int64 or 0 if invalid.

func (SqlNull[T]) MarshalJSON

func (n SqlNull[T]) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (SqlNull[T]) MarshalXML

func (n SqlNull[T]) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML implements xml.Marshaler.

func (SqlNull[T]) MarshalYAML

func (n SqlNull[T]) MarshalYAML() (any, error)

MarshalYAML implements yaml.Marshaler.

func (*SqlNull[T]) Scan

func (n *SqlNull[T]) Scan(value any) error

Scan implements sql.Scanner.

func (SqlNull[T]) String

func (n SqlNull[T]) String() string

String implements fmt.Stringer.

func (SqlNull[T]) Time

func (n SqlNull[T]) Time() time.Time

Time converts to time.Time or zero if invalid.

func (SqlNull[T]) UUID

func (n SqlNull[T]) UUID() uuid.UUID

UUID converts to uuid.UUID or Nil if invalid.

func (*SqlNull[T]) UnmarshalJSON

func (n *SqlNull[T]) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*SqlNull[T]) UnmarshalXML

func (n *SqlNull[T]) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML implements xml.Unmarshaler.

XML has no native null representation, so an empty element unmarshals to an invalid (null) value rather than a zero-value-but-valid one.

func (*SqlNull[T]) UnmarshalYAML

func (n *SqlNull[T]) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

func (SqlNull[T]) Value

func (n SqlNull[T]) Value() (driver.Value, error)

Value implements driver.Valuer.

type SqlString

type SqlString = SqlNull[string]

Type aliases for common types.

func NewSqlString

func NewSqlString(v string) SqlString

type SqlStringArray

type SqlStringArray struct {
	Val   []string
	Valid bool
}

SqlStringArray is a nullable PostgreSQL text[] / varchar[] array.

func NewSqlStringArray

func NewSqlStringArray(v []string) SqlStringArray

func (SqlStringArray) MarshalJSON

func (a SqlStringArray) MarshalJSON() ([]byte, error)

func (SqlStringArray) MarshalXML

func (a SqlStringArray) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlStringArray) MarshalYAML

func (a SqlStringArray) MarshalYAML() (any, error)

func (*SqlStringArray) Scan

func (a *SqlStringArray) Scan(value any) error

func (*SqlStringArray) UnmarshalJSON

func (a *SqlStringArray) UnmarshalJSON(b []byte) error

func (*SqlStringArray) UnmarshalXML

func (a *SqlStringArray) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SqlStringArray) UnmarshalYAML

func (a *SqlStringArray) UnmarshalYAML(value *yaml.Node) error

func (SqlStringArray) Value

func (a SqlStringArray) Value() (driver.Value, error)

type SqlTime

type SqlTime struct{ SqlNull[time.Time] }

SqlTime - Time only (HH:MM:SS).

func NewSqlTime

func NewSqlTime(v time.Time) SqlTime

func SqlTimeNow

func SqlTimeNow() SqlTime

func (SqlTime) MarshalJSON

func (t SqlTime) MarshalJSON() ([]byte, error)

func (SqlTime) MarshalXML

func (t SqlTime) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlTime) MarshalYAML

func (t SqlTime) MarshalYAML() (any, error)

func (SqlTime) String

func (t SqlTime) String() string

func (*SqlTime) UnmarshalJSON

func (t *SqlTime) UnmarshalJSON(b []byte) error

func (*SqlTime) UnmarshalXML

func (t *SqlTime) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SqlTime) UnmarshalYAML

func (t *SqlTime) UnmarshalYAML(value *yaml.Node) error

func (SqlTime) Value

func (t SqlTime) Value() (driver.Value, error)

type SqlTimeStamp

type SqlTimeStamp struct{ SqlNull[time.Time] }

SqlTimeStamp - Timestamp with custom formatting (YYYY-MM-DDTHH:MM:SS).

func NewSqlTimeStamp

func NewSqlTimeStamp(v time.Time) SqlTimeStamp

func SqlTimeStampNow

func SqlTimeStampNow() SqlTimeStamp

func (SqlTimeStamp) MarshalJSON

func (t SqlTimeStamp) MarshalJSON() ([]byte, error)

func (SqlTimeStamp) MarshalXML

func (t SqlTimeStamp) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlTimeStamp) MarshalYAML

func (t SqlTimeStamp) MarshalYAML() (any, error)

func (*SqlTimeStamp) UnmarshalJSON

func (t *SqlTimeStamp) UnmarshalJSON(b []byte) error

func (*SqlTimeStamp) UnmarshalXML

func (t *SqlTimeStamp) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SqlTimeStamp) UnmarshalYAML

func (t *SqlTimeStamp) UnmarshalYAML(value *yaml.Node) error

func (SqlTimeStamp) Value

func (t SqlTimeStamp) Value() (driver.Value, error)

type SqlUUID

type SqlUUID = SqlNull[uuid.UUID]

Type aliases for common types.

func NewSqlUUID

func NewSqlUUID(v uuid.UUID) SqlUUID

type SqlUUIDArray

type SqlUUIDArray struct {
	Val   []uuid.UUID
	Valid bool
}

func NewSqlUUIDArray

func NewSqlUUIDArray(v []uuid.UUID) SqlUUIDArray

func (SqlUUIDArray) MarshalJSON

func (a SqlUUIDArray) MarshalJSON() ([]byte, error)

func (SqlUUIDArray) MarshalXML

func (a SqlUUIDArray) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlUUIDArray) MarshalYAML

func (a SqlUUIDArray) MarshalYAML() (any, error)

func (*SqlUUIDArray) Scan

func (a *SqlUUIDArray) Scan(value any) error

func (*SqlUUIDArray) UnmarshalJSON

func (a *SqlUUIDArray) UnmarshalJSON(b []byte) error

func (*SqlUUIDArray) UnmarshalXML

func (a *SqlUUIDArray) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SqlUUIDArray) UnmarshalYAML

func (a *SqlUUIDArray) UnmarshalYAML(value *yaml.Node) error

func (SqlUUIDArray) Value

func (a SqlUUIDArray) Value() (driver.Value, error)

type SqlVector

type SqlVector struct {
	Val   []float32
	Valid bool
}

SqlVector is a nullable pgvector `vector` type backed by []float32. Wire format: `[1.0,2.0,3.0]` (square brackets, comma-separated floats).

func NewSqlVector

func NewSqlVector(val []float32) SqlVector

func (SqlVector) MarshalJSON

func (v SqlVector) MarshalJSON() ([]byte, error)

func (SqlVector) MarshalXML

func (v SqlVector) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SqlVector) MarshalYAML

func (v SqlVector) MarshalYAML() (any, error)

func (*SqlVector) Scan

func (v *SqlVector) Scan(value any) error

func (*SqlVector) UnmarshalJSON

func (v *SqlVector) UnmarshalJSON(b []byte) error

func (*SqlVector) UnmarshalXML

func (v *SqlVector) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SqlVector) UnmarshalYAML

func (v *SqlVector) UnmarshalYAML(value *yaml.Node) error

func (SqlVector) Value

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

Jump to

Keyboard shortcuts

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