Documentation
¶
Overview ¶
Package pgtypes provides GORM-compatible custom PostgreSQL types.
Package pgtypes provides GORM-compatible custom PostgreSQL types.
Package pgtypes provides GORM-compatible custom PostgreSQL types.
Package pgtypes provides GORM-compatible custom PostgreSQL types.
Package pgtypes provides GORM-compatible custom PostgreSQL types.
Package pgtypes provides GORM-compatible custom PostgreSQL types.
Package pgtypes provides GORM-compatible custom PostgreSQL types.
Package pgtypes provides GORM-compatible custom PostgreSQL types.
Package pgtypes provides GORM-compatible custom PostgreSQL types.
Package pgtypes provides GORM-compatible custom PostgreSQL types.
Index ¶
- Variables
- type BoolArray
- func (a BoolArray) Append(vals ...bool) BoolArray
- func (a BoolArray) AsSlice() []bool
- func (a BoolArray) Contains(val bool) bool
- func (a BoolArray) Equals(b BoolArray) bool
- func (a BoolArray) Filter(f func(bool) bool) BoolArray
- func (BoolArray) FromSlice(s []bool) BoolArray
- func (BoolArray) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (BoolArray) GormDataType() string
- func (a BoolArray) IndexOf(val bool) int
- func (a BoolArray) IsEmpty() bool
- func (a BoolArray) Len() int
- func (a BoolArray) Less(i, j int) bool
- func (a BoolArray) MarshalJSON() ([]byte, error)
- func (a BoolArray) MarshalText() ([]byte, error)
- func (a *BoolArray) Scan(src any) error
- func (a BoolArray) String() string
- func (a BoolArray) Swap(i, j int)
- func (a BoolArray) Unique() BoolArray
- func (a *BoolArray) UnmarshalJSON(data []byte) error
- func (a *BoolArray) UnmarshalText(data []byte) error
- func (a BoolArray) Value() (driver.Value, error)
- type Duration
- func (d Duration) AsDuration() time.Duration
- func (d Duration) Equals(other Duration) bool
- func (Duration) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (Duration) GormDataType() string
- func (d Duration) MarshalJSON() ([]byte, error)
- func (d Duration) MarshalText() ([]byte, error)
- func (d *Duration) Scan(src any) error
- func (d Duration) String() string
- func (d *Duration) UnmarshalJSON(data []byte) error
- func (d *Duration) UnmarshalText(data []byte) error
- func (d Duration) Value() (driver.Value, error)
- type DurationArray
- func (a DurationArray) Append(vals ...time.Duration) DurationArray
- func (a DurationArray) AsSlice() []time.Duration
- func (a DurationArray) Contains(val time.Duration) bool
- func (a DurationArray) Equals(b DurationArray) bool
- func (a DurationArray) Filter(f func(time.Duration) bool) DurationArray
- func (DurationArray) FromSlice(s []time.Duration) DurationArray
- func (DurationArray) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (DurationArray) GormDataType() string
- func (a DurationArray) IndexOf(val time.Duration) int
- func (a DurationArray) IsEmpty() bool
- func (a DurationArray) Len() int
- func (a DurationArray) Less(i, j int) bool
- func (a DurationArray) MarshalJSON() ([]byte, error)
- func (a DurationArray) MarshalText() ([]byte, error)
- func (a *DurationArray) Scan(src any) error
- func (a DurationArray) String() string
- func (a DurationArray) Swap(i, j int)
- func (a DurationArray) Unique() DurationArray
- func (a *DurationArray) UnmarshalJSON(data []byte) error
- func (a *DurationArray) UnmarshalText(data []byte) error
- func (a DurationArray) Value() (driver.Value, error)
- type Float64Array
- func (a Float64Array) Append(vals ...float64) Float64Array
- func (a Float64Array) AsSlice() []float64
- func (a Float64Array) Contains(val float64) bool
- func (a Float64Array) Equals(b Float64Array) bool
- func (a Float64Array) Filter(f func(float64) bool) Float64Array
- func (Float64Array) FromSlice(s []float64) Float64Array
- func (Float64Array) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (Float64Array) GormDataType() string
- func (a Float64Array) IndexOf(val float64) int
- func (a Float64Array) IsEmpty() bool
- func (a Float64Array) Len() int
- func (a Float64Array) Less(i, j int) bool
- func (a Float64Array) MarshalJSON() ([]byte, error)
- func (a Float64Array) MarshalText() ([]byte, error)
- func (a *Float64Array) Scan(src any) error
- func (a Float64Array) String() string
- func (a Float64Array) Swap(i, j int)
- func (a Float64Array) Unique() Float64Array
- func (a *Float64Array) UnmarshalJSON(data []byte) error
- func (a *Float64Array) UnmarshalText(data []byte) error
- func (a Float64Array) Value() (driver.Value, error)
- type Int32Array
- func (a Int32Array) Append(vals ...int32) Int32Array
- func (a Int32Array) AsSlice() []int32
- func (a Int32Array) Contains(val int32) bool
- func (a Int32Array) Equals(b Int32Array) bool
- func (a Int32Array) Filter(f func(int32) bool) Int32Array
- func (Int32Array) FromSlice(s []int32) Int32Array
- func (Int32Array) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (Int32Array) GormDataType() string
- func (a Int32Array) IndexOf(val int32) int
- func (a Int32Array) IsEmpty() bool
- func (a Int32Array) Len() int
- func (a Int32Array) Less(i, j int) bool
- func (a Int32Array) MarshalJSON() ([]byte, error)
- func (a Int32Array) MarshalText() ([]byte, error)
- func (a *Int32Array) Scan(src any) error
- func (a Int32Array) String() string
- func (a Int32Array) Swap(i, j int)
- func (a Int32Array) Unique() Int32Array
- func (a *Int32Array) UnmarshalJSON(data []byte) error
- func (a *Int32Array) UnmarshalText(data []byte) error
- func (a Int32Array) Value() (driver.Value, error)
- type Int64Array
- func (a Int64Array) Append(vals ...int64) Int64Array
- func (a Int64Array) AsSlice() []int64
- func (a Int64Array) Contains(val int64) bool
- func (a Int64Array) Equals(b Int64Array) bool
- func (a Int64Array) Filter(f func(int64) bool) Int64Array
- func (Int64Array) FromSlice(s []int64) Int64Array
- func (Int64Array) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (Int64Array) GormDataType() string
- func (a Int64Array) IndexOf(val int64) int
- func (a Int64Array) IsEmpty() bool
- func (a Int64Array) Len() int
- func (a Int64Array) Less(i, j int) bool
- func (a Int64Array) MarshalJSON() ([]byte, error)
- func (a Int64Array) MarshalText() ([]byte, error)
- func (a *Int64Array) Scan(src any) error
- func (a Int64Array) String() string
- func (a Int64Array) Swap(i, j int)
- func (a Int64Array) Unique() Int64Array
- func (a *Int64Array) UnmarshalJSON(data []byte) error
- func (a *Int64Array) UnmarshalText(data []byte) error
- func (a Int64Array) Value() (driver.Value, error)
- type StringArray
- func (a StringArray) Append(vals ...string) StringArray
- func (a StringArray) AsStringSlice() []string
- func (a StringArray) Contains(val string) bool
- func (a StringArray) Equals(b StringArray) bool
- func (a StringArray) Filter(f func(string) bool) StringArray
- func (StringArray) FromSlice(s []string) StringArray
- func (StringArray) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (StringArray) GormDataType() string
- func (a StringArray) IndexOf(val string) int
- func (a StringArray) IsEmpty() bool
- func (a StringArray) Len() int
- func (a StringArray) Less(i, j int) bool
- func (a StringArray) MarshalJSON() ([]byte, error)
- func (a StringArray) MarshalText() ([]byte, error)
- func (a *StringArray) Scan(src any) error
- func (a StringArray) String() string
- func (a StringArray) Swap(i, j int)
- func (a StringArray) Unique() StringArray
- func (a *StringArray) UnmarshalJSON(data []byte) error
- func (a *StringArray) UnmarshalText(data []byte) error
- func (a StringArray) Value() (driver.Value, error)
- type TimeArray
- func (a TimeArray) Append(vals ...time.Time) TimeArray
- func (a TimeArray) AsSlice() []time.Time
- func (a TimeArray) Contains(val time.Time) bool
- func (a TimeArray) Equals(b TimeArray) bool
- func (a TimeArray) Filter(f func(time.Time) bool) TimeArray
- func (TimeArray) FromSlice(s []time.Time) TimeArray
- func (TimeArray) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (TimeArray) GormDataType() string
- func (a TimeArray) IndexOf(val time.Time) int
- func (a TimeArray) IsEmpty() bool
- func (a TimeArray) Len() int
- func (a TimeArray) Less(i, j int) bool
- func (a TimeArray) MarshalJSON() ([]byte, error)
- func (a TimeArray) MarshalText() ([]byte, error)
- func (a *TimeArray) Scan(src any) error
- func (a TimeArray) String() string
- func (a TimeArray) Swap(i, j int)
- func (a TimeArray) Unique() TimeArray
- func (a *TimeArray) UnmarshalJSON(data []byte) error
- func (a *TimeArray) UnmarshalText(data []byte) error
- func (a TimeArray) Value() (driver.Value, error)
- type UUIDArray
- func (a UUIDArray) Append(vals ...uuid.UUID) UUIDArray
- func (a UUIDArray) AsSlice() []uuid.UUID
- func (a UUIDArray) Contains(val uuid.UUID) bool
- func (a UUIDArray) Equals(b UUIDArray) bool
- func (a UUIDArray) Filter(f func(uuid.UUID) bool) UUIDArray
- func (UUIDArray) FromSlice(s []uuid.UUID) UUIDArray
- func (UUIDArray) GormDBDataType(db *gorm.DB, _ *schema.Field) string
- func (UUIDArray) GormDataType() string
- func (a UUIDArray) IndexOf(val uuid.UUID) int
- func (a UUIDArray) IsEmpty() bool
- func (a UUIDArray) Len() int
- func (a UUIDArray) Less(i, j int) bool
- func (a UUIDArray) MarshalJSON() ([]byte, error)
- func (a UUIDArray) MarshalText() ([]byte, error)
- func (a *UUIDArray) Scan(src any) error
- func (a UUIDArray) String() string
- func (a UUIDArray) Swap(i, j int)
- func (a UUIDArray) Unique() UUIDArray
- func (a *UUIDArray) UnmarshalJSON(data []byte) error
- func (a *UUIDArray) UnmarshalText(data []byte) error
- func (a UUIDArray) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
var PgTypeMap = map[string]string{
"text[]": "pgtypes.StringArray",
"varchar[]": "pgtypes.StringArray",
"integer[]": "pgtypes.Int32Array",
"int4[]": "pgtypes.Int32Array",
"int8[]": "pgtypes.Int64Array",
"bigint[]": "pgtypes.Int64Array",
"bool[]": "pgtypes.BoolArray",
"boolean[]": "pgtypes.BoolArray",
"uuid[]": "pgtypes.UUIDArray",
"float8[]": "pgtypes.Float64Array",
"double precision[]": "pgtypes.Float64Array",
"timestamptz[]": "pgtypes.TimeArray",
"timestamp[]": "pgtypes.TimeArray",
"timestamp with time zone[]": "pgtypes.TimeArray",
"timestamp without time zone[]": "pgtypes.TimeArray",
"interval": "pgtypes.Duration",
"interval[]": "pgtypes.DurationArray",
"bool": "bool",
"int2": "int16",
"int4": "int32",
"int8": "int64",
"float4": "float32",
"float8": "float64",
"numeric": "string",
"text": "string",
"varchar": "string",
"bpchar": "string",
"char": "string",
"name": "string",
"bytea": "[]byte",
"uuid": "uuid.UUID",
"json": "json.RawMessage",
"jsonb": "json.RawMessage",
"xml": "string",
"date": "time.Time",
"timestamp": "time.Time",
"timestamptz": "time.Time",
"time": "string",
"timetz": "string",
"inet": "net.IPNet",
"cidr": "net.IPNet",
"macaddr": "net.HardwareAddr",
"macaddr8": "net.HardwareAddr",
"bit": "string",
"varbit": "string",
"tsvector": "string",
"tsquery": "string",
"vector": "string",
"vector(384)": "string",
"halfvec": "string",
"sparsevec": "string",
"oid": "uint32",
"regclass": "uint32",
"regproc": "uint32",
"regprocedure": "uint32",
"regtype": "uint32",
"regrole": "uint32",
"regnamespace": "uint32",
"regconfig": "uint32",
"regdictionary": "uint32",
"pg_lsn": "string",
"txid_snapshot": "string",
"point": "string",
"line": "string",
"lseg": "string",
"box": "string",
"path": "string",
"polygon": "string",
"circle": "string",
"int4range": "string",
"int8range": "string",
"numrange": "string",
"tsrange": "string",
"tstzrange": "string",
"daterange": "string",
"int4multirange": "string",
"int8multirange": "string",
"nummultirange": "string",
"tsmultirange": "string",
"tstzmultirange": "string",
"datemultirange": "string",
"money": "string",
}
PgTypeMap maps PostgreSQL data types to their corresponding Go types as strings. This map is used during code generation to determine the field types of the generated structs.
Functions ¶
This section is empty.
Types ¶
type BoolArray ¶
type BoolArray []bool
BoolArray is a slice of booleans that supports PostgreSQL's boolean array type.
func (BoolArray) Filter ¶
Filter returns a new BoolArray containing only elements that satisfy the given predicate.
func (BoolArray) GormDBDataType ¶
GormDBDataType implements the gorm.DBDataTypeInterface.
func (BoolArray) GormDataType ¶
GormDataType implements the gorm.DataTypeInterface.
func (BoolArray) IndexOf ¶
IndexOf returns the index of the first occurrence of the given value, or -1 if not found.
func (BoolArray) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (BoolArray) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*BoolArray) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*BoolArray) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Duration ¶
Duration is a wrapper around time.Duration that supports PostgreSQL's interval type.
func FromDuration ¶
FromDuration converts a time.Duration to a Duration.
func (Duration) AsDuration ¶
AsDuration converts the Duration to a time.Duration.
func (Duration) GormDBDataType ¶
GormDBDataType implements the gorm.DBDataTypeInterface.
func (Duration) GormDataType ¶
GormDataType implements the gorm.DataTypeInterface.
func (Duration) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (Duration) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Duration) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type DurationArray ¶
type DurationArray []Duration
DurationArray is a slice of Durations that supports PostgreSQL's interval array type.
func (DurationArray) Append ¶
func (a DurationArray) Append(vals ...time.Duration) DurationArray
Append returns a new DurationArray with the given values appended.
func (DurationArray) AsSlice ¶
func (a DurationArray) AsSlice() []time.Duration
AsSlice converts the DurationArray to a time.Duration slice.
func (DurationArray) Contains ¶
func (a DurationArray) Contains(val time.Duration) bool
Contains returns true if the DurationArray contains the given value.
func (DurationArray) Equals ¶
func (a DurationArray) Equals(b DurationArray) bool
Equals returns true if the DurationArray is equal to another DurationArray.
func (DurationArray) Filter ¶
func (a DurationArray) Filter(f func(time.Duration) bool) DurationArray
Filter returns a new DurationArray containing only elements that satisfy the given predicate.
func (DurationArray) FromSlice ¶
func (DurationArray) FromSlice(s []time.Duration) DurationArray
FromSlice converts a time.Duration slice to a DurationArray.
func (DurationArray) GormDBDataType ¶
GormDBDataType implements the gorm.DBDataTypeInterface.
func (DurationArray) GormDataType ¶
func (DurationArray) GormDataType() string
GormDataType implements the gorm.DataTypeInterface.
func (DurationArray) IndexOf ¶
func (a DurationArray) IndexOf(val time.Duration) int
IndexOf returns the index of the first occurrence of the given value, or -1 if not found.
func (DurationArray) IsEmpty ¶
func (a DurationArray) IsEmpty() bool
IsEmpty returns true if the DurationArray is empty.
func (DurationArray) Less ¶
func (a DurationArray) Less(i, j int) bool
Less implements sort.Interface.
func (DurationArray) MarshalJSON ¶
func (a DurationArray) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (DurationArray) MarshalText ¶
func (a DurationArray) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*DurationArray) Scan ¶
func (a *DurationArray) Scan(src any) error
Scan implements the sql.Scanner interface.
func (DurationArray) String ¶
func (a DurationArray) String() string
String returns the string representation of the DurationArray.
func (DurationArray) Unique ¶
func (a DurationArray) Unique() DurationArray
Unique returns a new DurationArray with duplicate values removed.
func (*DurationArray) UnmarshalJSON ¶
func (a *DurationArray) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*DurationArray) UnmarshalText ¶
func (a *DurationArray) UnmarshalText(data []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Float64Array ¶
type Float64Array []float64
Float64Array represents a PostgreSQL double precision array ([]double precision).
func (Float64Array) Append ¶
func (a Float64Array) Append(vals ...float64) Float64Array
Append returns a new Float64Array with the specified values added.
func (Float64Array) AsSlice ¶
func (a Float64Array) AsSlice() []float64
AsSlice converts the Float64Array to a float64 slice.
func (Float64Array) Contains ¶
func (a Float64Array) Contains(val float64) bool
Contains returns true if the value exists in the array.
func (Float64Array) Equals ¶
func (a Float64Array) Equals(b Float64Array) bool
Equals returns true if the other Float64Array has the same values in order.
func (Float64Array) Filter ¶
func (a Float64Array) Filter(f func(float64) bool) Float64Array
Filter returns a new Float64Array with elements matching the filter.
func (Float64Array) FromSlice ¶
func (Float64Array) FromSlice(s []float64) Float64Array
FromSlice converts a float64 slice to a Float64Array.
func (Float64Array) GormDBDataType ¶
GormDBDataType implements the gorm.DBDataTypeInterface.
func (Float64Array) GormDataType ¶
func (Float64Array) GormDataType() string
GormDataType implements the gorm.DataTypeInterface.
func (Float64Array) IndexOf ¶
func (a Float64Array) IndexOf(val float64) int
IndexOf returns the index of the value, or -1 if not found.
func (Float64Array) IsEmpty ¶
func (a Float64Array) IsEmpty() bool
IsEmpty returns true if the array has no elements.
func (Float64Array) Less ¶
func (a Float64Array) Less(i, j int) bool
Less implements sort.Interface.
func (Float64Array) MarshalJSON ¶
func (a Float64Array) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (Float64Array) MarshalText ¶
func (a Float64Array) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*Float64Array) Scan ¶
func (a *Float64Array) Scan(src any) error
Scan implements the sql.Scanner interface.
func (Float64Array) String ¶
func (a Float64Array) String() string
String returns the string representation of the Float64Array.
func (Float64Array) Unique ¶
func (a Float64Array) Unique() Float64Array
Unique returns a new Float64Array with duplicate values removed.
func (*Float64Array) UnmarshalJSON ¶
func (a *Float64Array) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Float64Array) UnmarshalText ¶
func (a *Float64Array) UnmarshalText(data []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Int32Array ¶
type Int32Array []int32
Int32Array represents a PostgreSQL integer array ([]integer).
func (Int32Array) Append ¶
func (a Int32Array) Append(vals ...int32) Int32Array
Append returns a new Int32Array with the specified values added.
func (Int32Array) AsSlice ¶
func (a Int32Array) AsSlice() []int32
AsSlice converts the Int32Array to an int32 slice.
func (Int32Array) Contains ¶
func (a Int32Array) Contains(val int32) bool
Contains returns true if the value exists in the array.
func (Int32Array) Equals ¶
func (a Int32Array) Equals(b Int32Array) bool
Equals returns true if the other Int32Array has the same values in order.
func (Int32Array) Filter ¶
func (a Int32Array) Filter(f func(int32) bool) Int32Array
Filter returns a new Int32Array with elements matching the filter.
func (Int32Array) FromSlice ¶
func (Int32Array) FromSlice(s []int32) Int32Array
FromSlice converts an int32 slice to an Int32Array.
func (Int32Array) GormDBDataType ¶
GormDBDataType implements the gorm.DBDataTypeInterface.
func (Int32Array) GormDataType ¶
func (Int32Array) GormDataType() string
GormDataType implements the gorm.DataTypeInterface.
func (Int32Array) IndexOf ¶
func (a Int32Array) IndexOf(val int32) int
IndexOf returns the index of the value, or -1 if not found.
func (Int32Array) IsEmpty ¶
func (a Int32Array) IsEmpty() bool
IsEmpty returns true if the array has no elements.
func (Int32Array) MarshalJSON ¶
func (a Int32Array) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (Int32Array) MarshalText ¶
func (a Int32Array) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*Int32Array) Scan ¶
func (a *Int32Array) Scan(src any) error
Scan implements the sql.Scanner interface.
func (Int32Array) String ¶
func (a Int32Array) String() string
String returns the string representation of the Int32Array.
func (Int32Array) Unique ¶
func (a Int32Array) Unique() Int32Array
Unique returns a new Int32Array with duplicate values removed.
func (*Int32Array) UnmarshalJSON ¶
func (a *Int32Array) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Int32Array) UnmarshalText ¶
func (a *Int32Array) UnmarshalText(data []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Int64Array ¶
type Int64Array []int64
Int64Array represents a PostgreSQL bigint array ([]bigint).
func (Int64Array) Append ¶
func (a Int64Array) Append(vals ...int64) Int64Array
Append returns a new Int64Array with the specified values added.
func (Int64Array) AsSlice ¶
func (a Int64Array) AsSlice() []int64
AsSlice converts the Int64Array to an int64 slice.
func (Int64Array) Contains ¶
func (a Int64Array) Contains(val int64) bool
Contains returns true if the value exists in the array.
func (Int64Array) Equals ¶
func (a Int64Array) Equals(b Int64Array) bool
Equals returns true if the other Int64Array has the same values in order.
func (Int64Array) Filter ¶
func (a Int64Array) Filter(f func(int64) bool) Int64Array
Filter returns a new Int64Array with elements matching the filter.
func (Int64Array) FromSlice ¶
func (Int64Array) FromSlice(s []int64) Int64Array
FromSlice converts an int64 slice to an Int64Array.
func (Int64Array) GormDBDataType ¶
GormDBDataType implements the gorm.DBDataTypeInterface.
func (Int64Array) GormDataType ¶
func (Int64Array) GormDataType() string
GormDataType implements the gorm.DataTypeInterface.
func (Int64Array) IndexOf ¶
func (a Int64Array) IndexOf(val int64) int
IndexOf returns the index of the value, or -1 if not found.
func (Int64Array) IsEmpty ¶
func (a Int64Array) IsEmpty() bool
IsEmpty returns true if the array has no elements.
func (Int64Array) MarshalJSON ¶
func (a Int64Array) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (Int64Array) MarshalText ¶
func (a Int64Array) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*Int64Array) Scan ¶
func (a *Int64Array) Scan(src any) error
Scan implements the sql.Scanner interface.
func (Int64Array) String ¶
func (a Int64Array) String() string
String returns the string representation of the Int64Array.
func (Int64Array) Unique ¶
func (a Int64Array) Unique() Int64Array
Unique returns a new Int64Array with duplicate values removed.
func (*Int64Array) UnmarshalJSON ¶
func (a *Int64Array) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Int64Array) UnmarshalText ¶
func (a *Int64Array) UnmarshalText(data []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface.
type StringArray ¶
type StringArray []string
StringArray represents a PostgreSQL text array ([]text).
func (StringArray) Append ¶
func (a StringArray) Append(vals ...string) StringArray
Append returns a new StringArray with the specified values added
func (StringArray) AsStringSlice ¶
func (a StringArray) AsStringSlice() []string
AsStringSlice returns the StringArray as a []string
func (StringArray) Contains ¶
func (a StringArray) Contains(val string) bool
Contains returns true if the value exists in the array.
func (StringArray) Equals ¶
func (a StringArray) Equals(b StringArray) bool
Equals returns true if the other StringArray has the same values in order.
func (StringArray) Filter ¶
func (a StringArray) Filter(f func(string) bool) StringArray
Filter returns a new StringArray with elements matching the filter
func (StringArray) FromSlice ¶
func (StringArray) FromSlice(s []string) StringArray
FromSlice creates a new StringArray from a []string
func (StringArray) GormDBDataType ¶
GormDBDataType returns the database data type for a specific dialect
func (StringArray) GormDataType ¶
func (StringArray) GormDataType() string
GormDataType returns the general data type
func (StringArray) IndexOf ¶
func (a StringArray) IndexOf(val string) int
IndexOf returns the index of the value, or -1 if not found.
func (StringArray) IsEmpty ¶
func (a StringArray) IsEmpty() bool
IsEmpty returns true if the array has no elements
func (StringArray) MarshalJSON ¶
func (a StringArray) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (StringArray) MarshalText ¶
func (a StringArray) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler
func (*StringArray) Scan ¶
func (a *StringArray) Scan(src any) error
Scan implements the sql.Scanner interface.
func (StringArray) Unique ¶
func (a StringArray) Unique() StringArray
Unique returns a new StringArray with duplicate values removed
func (*StringArray) UnmarshalJSON ¶
func (a *StringArray) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler
func (*StringArray) UnmarshalText ¶
func (a *StringArray) UnmarshalText(data []byte) error
UnmarshalText implements encoding.TextUnmarshaler
type TimeArray ¶
TimeArray represents a PostgreSQL timestamp with time zone array ([]timestamptz).
func (TimeArray) GormDBDataType ¶
GormDBDataType implements the gorm.DBDataTypeInterface.
func (TimeArray) GormDataType ¶
GormDataType implements the gorm.DataTypeInterface.
func (TimeArray) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (TimeArray) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*TimeArray) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*TimeArray) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type UUIDArray ¶
UUIDArray represents a PostgreSQL uuid array ([]uuid).
func (UUIDArray) GormDBDataType ¶
GormDBDataType implements the gorm.DBDataTypeInterface.
func (UUIDArray) GormDataType ¶
GormDataType implements the gorm.DataTypeInterface.
func (UUIDArray) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (UUIDArray) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*UUIDArray) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*UUIDArray) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.