Documentation
¶
Overview ¶
копия файла из https://github.com/jackc/pgtype/timestamptz.go чтоб не выдавала ошибку на null чтобы дата NULL = time.Time{}
копия файла из https://github.com/jackc/pgtype/interval.go чтоб не выдавала ошибку на null чтобы дата NULL = time.Time{}
копия файла из https://github.com/jackc/pgtype/pgtype.go чтоб не выдавала ошибку на null чтобы дата NULL = time.Time{}
копия файла из https://github.com/jackc/pgtype/pgtype_default.go чтоб не выдавала ошибку на null чтобы дата NULL = time.Time{}
копия файла из https://github.com/jackc/pgtype/timestamptz.go чтоб не выдавала ошибку на null чтобы дата NULL = time.Time{}
копия файла из https://github.com/jackc/pgtype/timestamp.go чтоб не выдавала ошибку на null чтобы дата NULL = time.Time{}
копия файла из https://github.com/jackc/pgtype/timestamptz.go чтоб не выдавала ошибку на null чтобы дата NULL = time.Time{}
Index ¶
- Constants
- func AppendInt16(buf []byte, n int16) []byte
- func AppendInt32(buf []byte, n int32) []byte
- func AppendInt64(buf []byte, n int64) []byte
- func AppendUint16(buf []byte, n uint16) []byte
- func AppendUint32(buf []byte, n uint32) []byte
- func AppendUint64(buf []byte, n uint64) []byte
- func SetInt32(buf []byte, n int32)
- type Date
- type DateCodec
- func (c DateCodec) DecodeDatabaseSQLValue(m *pgtype.Map, oid uint32, format int16, src []byte) (driver.Value, error)
- func (c DateCodec) DecodeValue(m *pgtype.Map, oid uint32, format int16, src []byte) (any, error)
- func (DateCodec) FormatSupported(format int16) bool
- func (DateCodec) PlanEncode(m *pgtype.Map, oid uint32, format int16, value any) pgtype.EncodePlan
- func (DateCodec) PlanScan(m *pgtype.Map, oid uint32, format int16, target any) pgtype.ScanPlan
- func (DateCodec) PreferredFormat() int16
- type Interval
- type IntervalCodec
- func (c IntervalCodec) DecodeDatabaseSQLValue(m *pgtype.Map, oid uint32, format int16, src []byte) (driver.Value, error)
- func (c IntervalCodec) DecodeValue(m *pgtype.Map, oid uint32, format int16, src []byte) (any, error)
- func (IntervalCodec) FormatSupported(format int16) bool
- func (IntervalCodec) PlanEncode(m *pgtype.Map, oid uint32, format int16, value any) pgtype.EncodePlan
- func (IntervalCodec) PlanScan(m *pgtype.Map, oid uint32, format int16, target any) pgtype.ScanPlan
- func (IntervalCodec) PreferredFormat() int16
- type IntervalScanner
- type IntervalValuer
- type Time
- type TimeCodec
- func (c TimeCodec) DecodeDatabaseSQLValue(m *pgtype.Map, oid uint32, format int16, src []byte) (driver.Value, error)
- func (c TimeCodec) DecodeValue(m *pgtype.Map, oid uint32, format int16, src []byte) (any, error)
- func (TimeCodec) FormatSupported(format int16) bool
- func (TimeCodec) PlanEncode(m *pgtype.Map, oid uint32, format int16, value any) pgtype.EncodePlan
- func (TimeCodec) PlanScan(m *pgtype.Map, oid uint32, format int16, target any) pgtype.ScanPlan
- func (TimeCodec) PreferredFormat() int16
- type TimeScanner
- type Timestamp
- func (ts Timestamp) MarshalJSON() ([]byte, error)
- func (ts *Timestamp) Scan(src any) error
- func (ts *Timestamp) ScanTimestamp(v Timestamp) error
- func (ts Timestamp) TimestampValue() (Timestamp, error)
- func (ts *Timestamp) UnmarshalJSON(b []byte) error
- func (ts Timestamp) Value() (driver.Value, error)
- type TimestampCodec
- func (c *TimestampCodec) DecodeDatabaseSQLValue(m *pgtype.Map, oid uint32, format int16, src []byte) (driver.Value, error)
- func (c *TimestampCodec) DecodeValue(m *pgtype.Map, oid uint32, format int16, src []byte) (any, error)
- func (*TimestampCodec) FormatSupported(format int16) bool
- func (*TimestampCodec) PlanEncode(m *pgtype.Map, oid uint32, format int16, value any) pgtype.EncodePlan
- func (c *TimestampCodec) PlanScan(m *pgtype.Map, oid uint32, format int16, target any) pgtype.ScanPlan
- func (*TimestampCodec) PreferredFormat() int16
- type Timestamptz
- func (tstz Timestamptz) MarshalJSON() ([]byte, error)
- func (tstz *Timestamptz) Scan(src any) error
- func (tstz *Timestamptz) ScanTimestamptz(v Timestamptz) error
- func (tstz Timestamptz) TimestamptzValue() (Timestamptz, error)
- func (tstz *Timestamptz) UnmarshalJSON(b []byte) error
- func (tstz Timestamptz) Value() (driver.Value, error)
- type TimestamptzCodec
- func (c *TimestamptzCodec) DecodeDatabaseSQLValue(m *pgtype.Map, oid uint32, format int16, src []byte) (driver.Value, error)
- func (c *TimestamptzCodec) DecodeValue(m *pgtype.Map, oid uint32, format int16, src []byte) (any, error)
- func (*TimestamptzCodec) FormatSupported(format int16) bool
- func (*TimestamptzCodec) PlanEncode(m *pgtype.Map, oid uint32, format int16, value any) pgtype.EncodePlan
- func (c *TimestamptzCodec) PlanScan(m *pgtype.Map, oid uint32, format int16, target any) pgtype.ScanPlan
- func (*TimestamptzCodec) PreferredFormat() int16
Constants ¶
const ( BoolOID = 16 ByteaOID = 17 QCharOID = 18 NameOID = 19 Int8OID = 20 Int2OID = 21 Int4OID = 23 TextOID = 25 OIDOID = 26 TIDOID = 27 XIDOID = 28 CIDOID = 29 JSONOID = 114 XMLOID = 142 XMLArrayOID = 143 JSONArrayOID = 199 XID8ArrayOID = 271 PointOID = 600 LsegOID = 601 PathOID = 602 BoxOID = 603 PolygonOID = 604 LineOID = 628 LineArrayOID = 629 CIDROID = 650 CIDRArrayOID = 651 Float4OID = 700 Float8OID = 701 CircleOID = 718 CircleArrayOID = 719 UnknownOID = 705 Macaddr8OID = 774 MacaddrOID = 829 InetOID = 869 BoolArrayOID = 1000 QCharArrayOID = 1002 NameArrayOID = 1003 Int2ArrayOID = 1005 Int4ArrayOID = 1007 TextArrayOID = 1009 TIDArrayOID = 1010 ByteaArrayOID = 1001 XIDArrayOID = 1011 CIDArrayOID = 1012 BPCharArrayOID = 1014 VarcharArrayOID = 1015 Int8ArrayOID = 1016 PointArrayOID = 1017 LsegArrayOID = 1018 PathArrayOID = 1019 BoxArrayOID = 1020 Float4ArrayOID = 1021 Float8ArrayOID = 1022 PolygonArrayOID = 1027 OIDArrayOID = 1028 ACLItemOID = 1033 ACLItemArrayOID = 1034 MacaddrArrayOID = 1040 InetArrayOID = 1041 BPCharOID = 1042 VarcharOID = 1043 DateOID = 1082 TimeOID = 1083 TimestampOID = 1114 TimestampArrayOID = 1115 DateArrayOID = 1182 TimeArrayOID = 1183 TimestamptzOID = 1184 TimestamptzArrayOID = 1185 IntervalOID = 1186 IntervalArrayOID = 1187 NumericArrayOID = 1231 TimetzOID = 1266 TimetzArrayOID = 1270 BitOID = 1560 BitArrayOID = 1561 VarbitOID = 1562 VarbitArrayOID = 1563 NumericOID = 1700 RecordOID = 2249 RecordArrayOID = 2287 UUIDOID = 2950 UUIDArrayOID = 2951 JSONBOID = 3802 JSONBArrayOID = 3807 DaterangeOID = 3912 DaterangeArrayOID = 3913 Int4rangeOID = 3904 Int4rangeArrayOID = 3905 NumrangeOID = 3906 NumrangeArrayOID = 3907 TsrangeOID = 3908 TsrangeArrayOID = 3909 TstzrangeOID = 3910 TstzrangeArrayOID = 3911 Int8rangeOID = 3926 Int8rangeArrayOID = 3927 JSONPathOID = 4072 JSONPathArrayOID = 4073 Int4multirangeOID = 4451 NummultirangeOID = 4532 TsmultirangeOID = 4533 TstzmultirangeOID = 4534 DatemultirangeOID = 4535 Int8multirangeOID = 4536 XID8OID = 5069 Int4multirangeArrayOID = 6150 NummultirangeArrayOID = 6151 TsmultirangeArrayOID = 6152 TstzmultirangeArrayOID = 6153 DatemultirangeArrayOID = 6155 Int8multirangeArrayOID = 6157 )
PostgreSQL oids for common types
Variables ¶
This section is empty.
Functions ¶
func AppendInt16 ¶
func AppendInt32 ¶
func AppendInt64 ¶
func AppendUint16 ¶
func AppendUint32 ¶
func AppendUint64 ¶
Types ¶
type Date ¶
type Date struct { Time time.Time InfinityModifier pgtype.InfinityModifier Valid bool }
func (Date) MarshalJSON ¶
func (*Date) UnmarshalJSON ¶
type DateCodec ¶
type DateCodec struct{}
func (DateCodec) DecodeDatabaseSQLValue ¶
func (DateCodec) DecodeValue ¶
func (DateCodec) FormatSupported ¶
func (DateCodec) PlanEncode ¶
func (DateCodec) PreferredFormat ¶
type Interval ¶
func (Interval) IntervalValue ¶
func (*Interval) ScanInterval ¶
type IntervalCodec ¶
type IntervalCodec struct{}
func (IntervalCodec) DecodeDatabaseSQLValue ¶
func (IntervalCodec) DecodeValue ¶
func (IntervalCodec) FormatSupported ¶
func (IntervalCodec) FormatSupported(format int16) bool
func (IntervalCodec) PlanEncode ¶
func (IntervalCodec) PlanEncode(m *pgtype.Map, oid uint32, format int16, value any) pgtype.EncodePlan
func (IntervalCodec) PreferredFormat ¶
func (IntervalCodec) PreferredFormat() int16
type IntervalScanner ¶
type IntervalValuer ¶
type Time ¶
Time represents the PostgreSQL time type. The PostgreSQL time is a time of day without time zone.
Time is represented as the number of microseconds since midnight in the same way that PostgreSQL does. Other time and date types in pgtype can use time.Time as the underlying representation. However, pgtype.Time type cannot due to needing to handle 24:00:00. time.Time converts that to 00:00:00 on the following day.
The time with time zone type is not supported. Use of time with time zone is discouraged by the PostgreSQL documentation.
type TimeCodec ¶
type TimeCodec struct{}
func (TimeCodec) DecodeDatabaseSQLValue ¶
func (TimeCodec) DecodeValue ¶
func (TimeCodec) FormatSupported ¶
func (TimeCodec) PlanEncode ¶
func (TimeCodec) PreferredFormat ¶
type TimeScanner ¶ added in v1.0.205
type Timestamp ¶
type Timestamp struct { Time time.Time // Time zone will be ignored when encoding to PostgreSQL. InfinityModifier pgtype.InfinityModifier Valid bool }
Timestamp represents the PostgreSQL timestamp type.
func (Timestamp) MarshalJSON ¶
func (*Timestamp) ScanTimestamp ¶
func (Timestamp) TimestampValue ¶
func (*Timestamp) UnmarshalJSON ¶
type TimestampCodec ¶
type TimestampCodec struct { // ScanLocation is the location that the time is assumed to be in for scanning. This is different from // TimestamptzCodec.ScanLocation in that this setting does change the instant in time that the timestamp represents. ScanLocation *time.Location }
func (*TimestampCodec) DecodeDatabaseSQLValue ¶
func (*TimestampCodec) DecodeValue ¶
func (*TimestampCodec) FormatSupported ¶
func (*TimestampCodec) FormatSupported(format int16) bool
func (*TimestampCodec) PlanEncode ¶
func (*TimestampCodec) PlanEncode(m *pgtype.Map, oid uint32, format int16, value any) pgtype.EncodePlan
func (*TimestampCodec) PreferredFormat ¶
func (*TimestampCodec) PreferredFormat() int16
type Timestamptz ¶
type Timestamptz struct { Time time.Time InfinityModifier pgtype.InfinityModifier Valid bool }
Timestamptz represents the PostgreSQL timestamptz type.
func (Timestamptz) MarshalJSON ¶
func (tstz Timestamptz) MarshalJSON() ([]byte, error)
func (*Timestamptz) Scan ¶
func (tstz *Timestamptz) Scan(src any) error
Scan implements the database/sql Scanner interface.
func (*Timestamptz) ScanTimestamptz ¶
func (tstz *Timestamptz) ScanTimestamptz(v Timestamptz) error
func (Timestamptz) TimestamptzValue ¶
func (tstz Timestamptz) TimestamptzValue() (Timestamptz, error)
func (*Timestamptz) UnmarshalJSON ¶
func (tstz *Timestamptz) UnmarshalJSON(b []byte) error
type TimestamptzCodec ¶
type TimestamptzCodec struct { // ScanLocation is the location to return scanned timestamptz values in. This does not change the instant in time that // the timestamptz represents. ScanLocation *time.Location }
func (*TimestamptzCodec) DecodeDatabaseSQLValue ¶
func (*TimestamptzCodec) DecodeValue ¶
func (*TimestamptzCodec) FormatSupported ¶
func (*TimestamptzCodec) FormatSupported(format int16) bool
func (*TimestamptzCodec) PlanEncode ¶
func (*TimestamptzCodec) PlanEncode(m *pgtype.Map, oid uint32, format int16, value any) pgtype.EncodePlan
func (*TimestamptzCodec) PreferredFormat ¶
func (*TimestamptzCodec) PreferredFormat() int16