Documentation ¶
Index ¶
- Constants
- func AsFieldLength(typ PgType, modifiers int) (int, bool)
- func EnhancedArrayTextCodecFactory[V any](typeMap *pgtype.Map, typ PgType) pgtype.Codec
- func ParseXlogData(data []byte, lastTransactionId *uint32) (pglogrepl.Message, error)
- type BeginMessage
- type BoxArrayCodec
- func (c *BoxArrayCodec) DecodeDatabaseSQLValue(m *pgtype.Map, oid uint32, format int16, src []byte) (driver.Value, error)
- func (c *BoxArrayCodec) DecodeValue(m *pgtype.Map, oid uint32, format int16, src []byte) (any, error)
- func (c *BoxArrayCodec) FormatSupported(format int16) bool
- func (c *BoxArrayCodec) PlanEncode(m *pgtype.Map, oid uint32, format int16, value any) pgtype.EncodePlan
- func (c *BoxArrayCodec) PlanScan(m *pgtype.Map, oid uint32, format int16, target any) pgtype.ScanPlan
- func (c *BoxArrayCodec) PreferredFormat() int16
- type CommitMessage
- type CompositeColumn
- type CompositeColumnFactory
- type DeleteMessage
- type EnhancedArrayTextCodec
- func (c *EnhancedArrayTextCodec[V]) DecodeDatabaseSQLValue(m *pgtype.Map, oid uint32, format int16, src []byte) (driver.Value, error)
- func (c *EnhancedArrayTextCodec[V]) DecodeValue(m *pgtype.Map, oid uint32, format int16, src []byte) (any, error)
- func (c *EnhancedArrayTextCodec[V]) FormatSupported(format int16) bool
- func (c *EnhancedArrayTextCodec[V]) PlanEncode(m *pgtype.Map, oid uint32, format int16, value any) pgtype.EncodePlan
- func (c *EnhancedArrayTextCodec[V]) PlanScan(m *pgtype.Map, oid uint32, format int16, target any) pgtype.ScanPlan
- func (c *EnhancedArrayTextCodec[V]) PreferredFormat() int16
- type Geography
- func (g Geography) MarshalJSON() ([]byte, error)
- func (g Geography) New(v geom.T) Geography
- func (g Geography) PostGisValue() (Geography, error)
- func (g *Geography) Scan(src any) error
- func (g *Geography) ScanPostGisValue(v Geography) error
- func (g *Geography) UnmarshalJSON(b []byte) error
- func (g Geography) Value() (driver.Value, error)
- type Geometry
- func (g Geometry) MarshalJSON() ([]byte, error)
- func (g Geometry) New(v geom.T) Geometry
- func (g Geometry) PostGisValue() (Geometry, error)
- func (g *Geometry) Scan(src any) error
- func (g *Geometry) ScanPostGisValue(v Geometry) error
- func (g *Geometry) UnmarshalJSON(b []byte) error
- func (g Geometry) Value() (driver.Value, error)
- type InsertMessage
- type LSN
- type LogicalReplicationMessage
- func (m *LogicalReplicationMessage) Decode(src []byte) (err error)
- func (m *LogicalReplicationMessage) IsTransactional() bool
- func (m *LogicalReplicationMessage) SetType(t pglogrepl.MessageType)
- func (m *LogicalReplicationMessage) String() string
- func (m *LogicalReplicationMessage) Type() pglogrepl.MessageType
- type Ltree
- type LtreeCodec
- func (c LtreeCodec) DecodeDatabaseSQLValue(m *pgtype.Map, oid uint32, format int16, src []byte) (driver.Value, error)
- func (c LtreeCodec) DecodeValue(m *pgtype.Map, oid uint32, format int16, src []byte) (any, error)
- func (LtreeCodec) FormatSupported(format int16) bool
- func (LtreeCodec) PlanEncode(_ *pgtype.Map, _ uint32, format int16, value any) pgtype.EncodePlan
- func (LtreeCodec) PlanScan(_ *pgtype.Map, _ uint32, format int16, target any) pgtype.ScanPlan
- func (LtreeCodec) PreferredFormat() int16
- type LtreeScanner
- type LtreeValuer
- type OriginMessage
- type PgCategory
- type PgKind
- type PgType
- type PostGisCodec
- func (c PostGisCodec[V, S, E]) DecodeDatabaseSQLValue(m *pgtype.Map, oid uint32, format int16, src []byte) (driver.Value, error)
- func (c PostGisCodec[V, S, E]) DecodeValue(m *pgtype.Map, oid uint32, format int16, src []byte) (any, error)
- func (PostGisCodec[V, S, E]) FormatSupported(format int16) bool
- func (PostGisCodec[V, S, E]) PlanEncode(_ *pgtype.Map, _ uint32, format int16, value any) pgtype.EncodePlan
- func (PostGisCodec[V, S, E]) PlanScan(_ *pgtype.Map, _ uint32, format int16, target any) pgtype.ScanPlan
- func (PostGisCodec[V, S, E]) PreferredFormat() int16
- type PostGisScanner
- type PostGisValuer
- type RelationMessage
- type ReplicaIdentity
- type RowDecoder
- type RowDecoderFactory
- type Timetz
- type TimetzCodec
- func (c TimetzCodec) DecodeDatabaseSQLValue(m *pgtype.Map, oid uint32, format int16, src []byte) (driver.Value, error)
- func (c TimetzCodec) DecodeValue(m *pgtype.Map, oid uint32, format int16, src []byte) (any, error)
- func (TimetzCodec) FormatSupported(format int16) bool
- func (TimetzCodec) PlanEncode(_ *pgtype.Map, _ uint32, format int16, value any) pgtype.EncodePlan
- func (TimetzCodec) PlanScan(_ *pgtype.Map, _ uint32, format int16, target any) pgtype.ScanPlan
- func (TimetzCodec) PreferredFormat() int16
- type TimetzScanner
- type TimetzValuer
- type TruncateMessage
- type TupleDecoderPlan
- type TypeConverter
- type TypeFactory
- type TypeManager
- type TypeMessage
- type UpdateMessage
- type XLogData
- type Xml
- type XmlCodec
- func (c XmlCodec) DecodeDatabaseSQLValue(m *pgtype.Map, oid uint32, format int16, src []byte) (driver.Value, error)
- func (c XmlCodec) DecodeValue(m *pgtype.Map, oid uint32, format int16, src []byte) (any, error)
- func (XmlCodec) FormatSupported(format int16) bool
- func (XmlCodec) PlanEncode(_ *pgtype.Map, _ uint32, format int16, value any) pgtype.EncodePlan
- func (XmlCodec) PlanScan(_ *pgtype.Map, _ uint32, format int16, target any) pgtype.ScanPlan
- func (XmlCodec) PreferredFormat() int16
- type XmlScanner
- type XmlValuer
Constants ¶
const ( MacAddr8OID uint32 = 774 MacAddrArray8OID uint32 = 775 TimeTZOID uint32 = 1266 TimeTZArrayOID uint32 = 1270 XmlOID uint32 = 142 XmlArrayOID uint32 = 143 )
const (
MessageTypeLogicalDecodingMessage pglogrepl.MessageType = 'M'
)
Variables ¶
This section is empty.
Functions ¶
func EnhancedArrayTextCodecFactory ¶ added in v0.9.0
Types ¶
type BeginMessage ¶
type BeginMessage pglogrepl.BeginMessage
func (BeginMessage) String ¶ added in v0.0.12
func (m BeginMessage) String() string
type BoxArrayCodec ¶ added in v0.5.0
type BoxArrayCodec struct {
PgxArrayCodec *pgtype.ArrayCodec
}
BoxArrayCodec is a wrapper codec for box[] which isn't handled gracefully in the pgx base source code (at least in PG < 14 without binary wire protocol support) due to the way the text protocol sends back the value of a box item.
func (*BoxArrayCodec) DecodeDatabaseSQLValue ¶ added in v0.5.0
func (*BoxArrayCodec) DecodeValue ¶ added in v0.5.0
func (*BoxArrayCodec) FormatSupported ¶ added in v0.5.0
func (c *BoxArrayCodec) FormatSupported( format int16, ) bool
func (*BoxArrayCodec) PlanEncode ¶ added in v0.5.0
func (c *BoxArrayCodec) PlanEncode( m *pgtype.Map, oid uint32, format int16, value any, ) pgtype.EncodePlan
func (*BoxArrayCodec) PreferredFormat ¶ added in v0.5.0
func (c *BoxArrayCodec) PreferredFormat() int16
type CommitMessage ¶
type CommitMessage pglogrepl.CommitMessage
func (CommitMessage) String ¶ added in v0.0.12
func (m CommitMessage) String() string
type CompositeColumn ¶ added in v0.5.0
type CompositeColumnFactory ¶ added in v0.5.0
type DeleteMessage ¶
type DeleteMessage struct { *pglogrepl.DeleteMessage OldValues map[string]any }
func (DeleteMessage) String ¶ added in v0.0.12
func (m DeleteMessage) String() string
type EnhancedArrayTextCodec ¶ added in v0.9.0
type EnhancedArrayTextCodec[V any] struct { PgxArrayCodec *pgtype.ArrayCodec // contains filtered or unexported fields }
EnhancedArrayTextCodec is an enhanced array codec utilizing the typdelim field from pg_type as a separator of the text value representing the array in the PG wire protocol. The pgx internal implementation always expects the delimiter to be a comma (,) which isn't true for all types, such as box, and PostGIS types.
This special version only implements text format, binary is forwarded to the original array codec, as it doesn't have the same issue, since it's a text parsing issue only.
func (*EnhancedArrayTextCodec[V]) DecodeDatabaseSQLValue ¶ added in v0.9.0
func (*EnhancedArrayTextCodec[V]) DecodeValue ¶ added in v0.9.0
func (*EnhancedArrayTextCodec[V]) FormatSupported ¶ added in v0.9.0
func (c *EnhancedArrayTextCodec[V]) FormatSupported( format int16, ) bool
func (*EnhancedArrayTextCodec[V]) PlanEncode ¶ added in v0.9.0
func (c *EnhancedArrayTextCodec[V]) PlanEncode( m *pgtype.Map, oid uint32, format int16, value any, ) pgtype.EncodePlan
func (*EnhancedArrayTextCodec[V]) PreferredFormat ¶ added in v0.9.0
func (c *EnhancedArrayTextCodec[V]) PreferredFormat() int16
type Geography ¶ added in v0.9.0
type Geography struct { Geography geom.T Valid bool }
func (Geography) MarshalJSON ¶ added in v0.9.0
func (Geography) PostGisValue ¶ added in v0.9.0
func (*Geography) ScanPostGisValue ¶ added in v0.9.0
func (*Geography) UnmarshalJSON ¶ added in v0.9.0
type Geometry ¶ added in v0.9.0
type Geometry struct { Geometry geom.T Valid bool }
func (Geometry) MarshalJSON ¶ added in v0.9.0
func (Geometry) PostGisValue ¶ added in v0.9.0
func (*Geometry) ScanPostGisValue ¶ added in v0.9.0
func (*Geometry) UnmarshalJSON ¶ added in v0.9.0
type InsertMessage ¶
type InsertMessage struct { *pglogrepl.InsertMessage NewValues map[string]any }
func (InsertMessage) String ¶ added in v0.0.12
func (m InsertMessage) String() string
type LogicalReplicationMessage ¶
type LogicalReplicationMessage struct { // Flags is either 0 (non-transactional) or 1 (transactional) Flags uint8 // Xid is the transaction id (if transactional logical replication message) Xid *uint32 // LSN is the LSN of the logical replication message LSN pglogrepl.LSN // Prefix is the prefix of the logical replication message Prefix string // Content is the content of the logical replication message Content []byte // contains filtered or unexported fields }
LogicalReplicationMessage is a logical replication message.
func (*LogicalReplicationMessage) Decode ¶
func (m *LogicalReplicationMessage) Decode( src []byte, ) (err error)
func (*LogicalReplicationMessage) IsTransactional ¶
func (m *LogicalReplicationMessage) IsTransactional() bool
func (*LogicalReplicationMessage) SetType ¶
func (m *LogicalReplicationMessage) SetType( t pglogrepl.MessageType, )
func (*LogicalReplicationMessage) String ¶ added in v0.0.12
func (m *LogicalReplicationMessage) String() string
func (*LogicalReplicationMessage) Type ¶
func (m *LogicalReplicationMessage) Type() pglogrepl.MessageType
Type returns message type.
type Ltree ¶ added in v0.3.1
func (Ltree) LtreeValue ¶ added in v0.3.1
func (Ltree) MarshalJSON ¶ added in v0.3.1
func (*Ltree) UnmarshalJSON ¶ added in v0.3.1
type LtreeCodec ¶ added in v0.3.1
type LtreeCodec struct{}
func (LtreeCodec) DecodeDatabaseSQLValue ¶ added in v0.3.1
func (LtreeCodec) DecodeValue ¶ added in v0.3.1
func (LtreeCodec) FormatSupported ¶ added in v0.3.1
func (LtreeCodec) FormatSupported( format int16, ) bool
func (LtreeCodec) PlanEncode ¶ added in v0.3.1
func (LtreeCodec) PlanEncode( _ *pgtype.Map, _ uint32, format int16, value any, ) pgtype.EncodePlan
func (LtreeCodec) PreferredFormat ¶ added in v0.3.1
func (LtreeCodec) PreferredFormat() int16
type LtreeScanner ¶ added in v0.3.1
type LtreeValuer ¶ added in v0.3.1
type OriginMessage ¶
type OriginMessage pglogrepl.OriginMessage
func (OriginMessage) String ¶ added in v0.0.12
func (m OriginMessage) String() string
type PgCategory ¶ added in v0.3.1
type PgCategory string
const ( Array PgCategory = "A" Boolean PgCategory = "B" Composite PgCategory = "C" DateTime PgCategory = "D" Enum PgCategory = "E" Geometric PgCategory = "G" Network PgCategory = "I" Numeric PgCategory = "N" Pseudo PgCategory = "P" Range PgCategory = "R" String PgCategory = "S" Timespan PgCategory = "T" UserDefined PgCategory = "D" BitString PgCategory = "V" Unknown PgCategory = "X" InternalUse PgCategory = "Z" )
type PgType ¶ added in v0.3.1
type PgType interface { schema.Buildable Namespace() string Name() string Kind() PgKind Oid() uint32 Category() PgCategory IsArray() bool IsRecord() bool ArrayType() PgType ElementType() PgType BaseType() PgType OidArray() uint32 OidElement() uint32 OidBase() uint32 Modifiers() int EnumValues() []string Delimiter() string CompositeColumns() ([]CompositeColumn, error) SchemaType() schema.Type Format() string Equal( other PgType, ) bool }
type PostGisCodec ¶ added in v0.9.0
type PostGisCodec[V valuer, S PostGisScanner[V], E PostGisValuer[V]] struct{}
func (PostGisCodec[V, S, E]) DecodeDatabaseSQLValue ¶ added in v0.9.0
func (PostGisCodec[V, S, E]) DecodeValue ¶ added in v0.9.0
func (PostGisCodec[V, S, E]) FormatSupported ¶ added in v0.9.0
func (PostGisCodec[V, S, E]) FormatSupported( format int16, ) bool
func (PostGisCodec[V, S, E]) PlanEncode ¶ added in v0.9.0
func (PostGisCodec[V, S, E]) PlanEncode( _ *pgtype.Map, _ uint32, format int16, value any, ) pgtype.EncodePlan
func (PostGisCodec[V, S, E]) PreferredFormat ¶ added in v0.9.0
func (PostGisCodec[V, S, E]) PreferredFormat() int16
type PostGisScanner ¶ added in v0.9.0
type PostGisValuer ¶ added in v0.9.0
type PostGisValuer[T valuer] interface {
PostGisValue() (T, error)
}
type RelationMessage ¶
type RelationMessage pglogrepl.RelationMessage
func (RelationMessage) String ¶ added in v0.0.12
func (m RelationMessage) String() string
type ReplicaIdentity ¶
type ReplicaIdentity string
const ( NOTHING ReplicaIdentity = "n" FULL ReplicaIdentity = "f" DEFAULT ReplicaIdentity = "d" INDEX ReplicaIdentity = "i" UNKNOWN ReplicaIdentity = "" )
func AsReplicaIdentity ¶
func AsReplicaIdentity( val string, ) ReplicaIdentity
func (ReplicaIdentity) Description ¶
func (ri ReplicaIdentity) Description() string
Description returns a description of this REPLICA IDENTITY Values are in sync with debezium project: debezium-connector-postgres/src/main/java/io/debezium/connector/postgresql/connection/ServerInfo.java
func (ReplicaIdentity) Name ¶ added in v0.11.0
func (ri ReplicaIdentity) Name() string
func (*ReplicaIdentity) Scan ¶
func (ri *ReplicaIdentity) Scan( src interface{}, ) error
type RowDecoder ¶ added in v0.3.1
type RowDecoder interface { DecodeRowsMapAndSink( rows pgx.Rows, sink func(values map[string]any) error, ) error DecodeRowsAndSink( rows pgx.Rows, sink func(values []any) error, ) error Decode( rawRow [][]byte, ) ([]any, error) DecodeAndSink( rawRow [][]byte, sink func(values []any) error, ) error DecodeMapAndSink( rawRow [][]byte, sink func(values map[string]any) error, ) error }
type RowDecoderFactory ¶ added in v0.4.0
type RowDecoderFactory = func(fields []pgconn.FieldDescription) (RowDecoder, error)
type Timetz ¶ added in v0.3.1
func (Timetz) MarshalJSON ¶ added in v0.3.1
func (*Timetz) ScanTimetz ¶ added in v0.3.1
func (Timetz) TimetzValue ¶ added in v0.3.1
func (*Timetz) UnmarshalJSON ¶ added in v0.3.1
type TimetzCodec ¶ added in v0.3.1
type TimetzCodec struct{}
func (TimetzCodec) DecodeDatabaseSQLValue ¶ added in v0.3.1
func (TimetzCodec) DecodeValue ¶ added in v0.3.1
func (TimetzCodec) FormatSupported ¶ added in v0.3.1
func (TimetzCodec) FormatSupported( format int16, ) bool
func (TimetzCodec) PlanEncode ¶ added in v0.3.1
func (TimetzCodec) PlanEncode( _ *pgtype.Map, _ uint32, format int16, value any, ) pgtype.EncodePlan
func (TimetzCodec) PreferredFormat ¶ added in v0.3.1
func (TimetzCodec) PreferredFormat() int16
type TimetzScanner ¶ added in v0.3.1
type TimetzValuer ¶ added in v0.3.1
type TruncateMessage ¶
type TruncateMessage pglogrepl.TruncateMessage
func (TruncateMessage) String ¶ added in v0.0.12
func (m TruncateMessage) String() string
type TupleDecoderPlan ¶ added in v0.4.0
type TypeConverter ¶ added in v0.4.0
TypeConverter represents a conversion function to convert from a PostgreSQL internal OID number and value to a value according to the stream definition
type TypeFactory ¶ added in v0.3.1
type TypeManager ¶ added in v0.3.1
type TypeManager interface { ResolveDataType( oid uint32, ) (PgType, error) ResolveTypeConverter( oid uint32, ) (TypeConverter, error) NumKnownTypes() int DecodeTuples( relation *RelationMessage, tupleData *pglogrepl.TupleData, ) (map[string]any, error) GetOrPlanTupleDecoder(relation *RelationMessage) (TupleDecoderPlan, error) GetOrPlanRowDecoder(fields []pgconn.FieldDescription) (RowDecoder, error) RegisterColumnType(column schema.ColumnAlike) error }
type TypeMessage ¶
type TypeMessage pglogrepl.TypeMessage
func (TypeMessage) String ¶ added in v0.0.12
func (m TypeMessage) String() string
type UpdateMessage ¶
type UpdateMessage struct { *pglogrepl.UpdateMessage OldValues map[string]any NewValues map[string]any }
func (UpdateMessage) String ¶ added in v0.0.12
func (m UpdateMessage) String() string
type Xml ¶ added in v0.3.1
func (Xml) MarshalJSON ¶ added in v0.3.1
func (*Xml) UnmarshalJSON ¶ added in v0.3.1
type XmlCodec ¶ added in v0.3.1
type XmlCodec struct{}
func (XmlCodec) DecodeDatabaseSQLValue ¶ added in v0.3.1
func (XmlCodec) DecodeValue ¶ added in v0.3.1
func (XmlCodec) FormatSupported ¶ added in v0.3.1
func (XmlCodec) PlanEncode ¶ added in v0.3.1
func (XmlCodec) PreferredFormat ¶ added in v0.3.1
type XmlScanner ¶ added in v0.3.1
Source Files ¶
- basemessage.go
- boxarray_codec.go
- compositecolumn.go
- decoderplan.go
- enhanced_array_text_codec.go
- fieldlength.go
- geography.go
- geometry.go
- logicalreplicationmessage.go
- ltree.go
- oids.go
- pgtype.go
- pgtype_mock.go
- pgtypeadapters.go
- postgis_codec.go
- replicaidentity.go
- rowdecoder.go
- timetz.go
- typemanager.go
- xlogdecoder.go
- xml.go