messages

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OidBool              = 16
	OidBytea             = 17
	OidChar              = 18
	OidName              = 19
	OidInt8              = 20
	OidInt2              = 21
	OidInt2Vector        = 22
	OidInt4              = 23
	OidRegproc           = 24
	OidText              = 25
	OidOid               = 26
	OidTid               = 27
	OidXid               = 28
	OidCid               = 29
	OidOidVector         = 30
	OidPgType            = 71
	OidPgAttribute       = 75
	OidPgProc            = 81
	OidPgClass           = 83
	OidJson              = 114
	OidXml               = 142
	OidXmlArray          = 143
	OidPgNodeTree        = 194
	OidPgNodeTreeArray   = 195
	OidJsonArray         = 199
	OidSmgr              = 210
	OidIndexAm           = 261
	OidPoint             = 600
	OidLseg              = 601
	OidPath              = 602
	OidBox               = 603
	OidPolygon           = 604
	OidLine              = 628
	OidCidr              = 650
	OidCidrArray         = 651
	OidFloat4            = 700
	OidFloat8            = 701
	OidAbstime           = 702
	OidReltime           = 703
	OidTinterval         = 704
	OidUnknown           = 705
	OidCircle            = 718
	OidCash              = 790
	OidMacaddr           = 829
	OidInet              = 869
	OidByteaArray        = 1001
	OidInt2Array         = 1005
	OidInt4Array         = 1007
	OidTextArray         = 1009
	OidVarcharArray      = 1015
	OidInt8Array         = 1016
	OidPointArray        = 1017
	OidFloat4Array       = 1021
	OidFloat8Array       = 1022
	OidAclitem           = 1033
	OidAclitemArray      = 1034
	OidInetArray         = 1041
	OidVarchar           = 1043
	OidDate              = 1082
	OidTime              = 1083
	OidTimestamp         = 1114
	OidTimestampArray    = 1115
	OidDateArray         = 1182
	OidTimeArray         = 1183
	OidInterval          = 1186
	OidIntervalArray     = 1187
	OidNumeric           = 1700
	OidRefcursor         = 1790
	OidRegprocedure      = 2202
	OidRegoper           = 2203
	OidRegoperator       = 2204
	OidRegclass          = 2205
	OidRegtype           = 2206
	OidRegrole           = 4096
	OidRegnamespace      = 4097
	OidRegnamespaceArray = 4098
	OidRegclassArray     = 4099
	OidRegRoleArray      = 4090
)

Variables

This section is empty.

Functions

func ReturnsRow added in v0.7.5

func ReturnsRow(tag string) bool

ReturnsRow returns whether the query returns set of rows such as SELECT and FETCH statements.

func VitessFieldToDataTypeModifier

func VitessFieldToDataTypeModifier(field *query.Field) (int32, error)

VitessFieldToDataTypeModifier returns the field's data type modifier as defined by Postgres.

func VitessFieldToDataTypeObjectID

func VitessFieldToDataTypeObjectID(field *query.Field) (int32, error)

VitessFieldToDataTypeObjectID returns the type of a vitess Field into a type as defined by Postgres. OIDs can be obtained with the following query: `SELECT oid, typname FROM pg_type ORDER BY 1;`

func VitessFieldToDataTypeSize

func VitessFieldToDataTypeSize(field *query.Field) (int16, error)

VitessFieldToDataTypeSize returns the type's size, as defined by Vitess, into the size as defined by Postgres.

func VitessTypeToObjectID added in v0.4.0

func VitessTypeToObjectID(typ query.Type) (int32, error)

VitessFieldToDataTypeObjectID returns a type, as defined by Vitess, into a type as defined by Postgres. OIDs can be obtained with the following query: `SELECT oid, typname FROM pg_type ORDER BY 1;`

Types

type AuthenticationCleartextPassword

type AuthenticationCleartextPassword struct{}

AuthenticationCleartextPassword represents a PostgreSQL message.

func (AuthenticationCleartextPassword) Decode

Decode implements the interface connection.Message.

func (AuthenticationCleartextPassword) DefaultMessage

DefaultMessage implements the interface connection.Message.

func (AuthenticationCleartextPassword) Encode

Encode implements the interface connection.Message.

type AuthenticationGSS

type AuthenticationGSS struct{}

AuthenticationGSS represents a PostgreSQL message.

func (AuthenticationGSS) Decode

Decode implements the interface connection.Message.

func (AuthenticationGSS) DefaultMessage

func (m AuthenticationGSS) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (AuthenticationGSS) Encode

Encode implements the interface connection.Message.

type AuthenticationGSSContinue

type AuthenticationGSSContinue struct {
	Data []byte
}

AuthenticationGSSContinue represents a PostgreSQL message.

func (AuthenticationGSSContinue) Decode

Decode implements the interface connection.Message.

func (AuthenticationGSSContinue) DefaultMessage

DefaultMessage implements the interface connection.Message.

func (AuthenticationGSSContinue) Encode

Encode implements the interface connection.Message.

type AuthenticationKerberosV5

type AuthenticationKerberosV5 struct{}

AuthenticationKerberosV5 represents a PostgreSQL message.

func (AuthenticationKerberosV5) Decode

Decode implements the interface connection.Message.

func (AuthenticationKerberosV5) DefaultMessage

DefaultMessage implements the interface connection.Message.

func (AuthenticationKerberosV5) Encode

Encode implements the interface connection.Message.

type AuthenticationMD5Password

type AuthenticationMD5Password struct {
	Salt int32
}

AuthenticationMD5Password represents a PostgreSQL message.

func (AuthenticationMD5Password) Decode

Decode implements the interface connection.Message.

func (AuthenticationMD5Password) DefaultMessage

DefaultMessage implements the interface connection.Message.

func (AuthenticationMD5Password) Encode

Encode implements the interface connection.Message.

type AuthenticationOk

type AuthenticationOk struct{}

AuthenticationOk tells the client that authentication was successful.

func (AuthenticationOk) Decode

Decode implements the interface connection.Message.

func (AuthenticationOk) DefaultMessage

func (m AuthenticationOk) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (AuthenticationOk) Encode

Encode implements the interface connection.Message.

type AuthenticationSASL

type AuthenticationSASL struct {
	Mechanisms []string
}

AuthenticationSASL represents a PostgreSQL message.

func (AuthenticationSASL) Decode

Decode implements the interface connection.Message.

func (AuthenticationSASL) DefaultMessage

func (m AuthenticationSASL) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (AuthenticationSASL) Encode

Encode implements the interface connection.Message.

type AuthenticationSASLContinue

type AuthenticationSASLContinue struct {
	Data []byte
}

AuthenticationSASLContinue represents a PostgreSQL message.

func (AuthenticationSASLContinue) Decode

Decode implements the interface connection.Message.

func (AuthenticationSASLContinue) DefaultMessage

DefaultMessage implements the interface connection.Message.

func (AuthenticationSASLContinue) Encode

Encode implements the interface connection.Message.

type AuthenticationSASLFinal

type AuthenticationSASLFinal struct {
	AdditionalData []byte
}

AuthenticationSASLFinal represents a PostgreSQL message.

func (AuthenticationSASLFinal) Decode

Decode implements the interface connection.Message.

func (AuthenticationSASLFinal) DefaultMessage

func (m AuthenticationSASLFinal) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (AuthenticationSASLFinal) Encode

Encode implements the interface connection.Message.

type AuthenticationSCMCredential

type AuthenticationSCMCredential struct{}

AuthenticationSCMCredential represents a PostgreSQL message.

func (AuthenticationSCMCredential) Decode

Decode implements the interface connection.Message.

func (AuthenticationSCMCredential) DefaultMessage

DefaultMessage implements the interface connection.Message.

func (AuthenticationSCMCredential) Encode

Encode implements the interface connection.Message.

type AuthenticationSSPI

type AuthenticationSSPI struct{}

AuthenticationSSPI represents a PostgreSQL message.

func (AuthenticationSSPI) Decode

Decode implements the interface connection.Message.

func (AuthenticationSSPI) DefaultMessage

func (m AuthenticationSSPI) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (AuthenticationSSPI) Encode

Encode implements the interface connection.Message.

type BackendKeyData

type BackendKeyData struct {
	ProcessID int32
	SecretKey int32
}

BackendKeyData provides the client with information about the server.

func (BackendKeyData) Decode

Decode implements the interface connection.Message.

func (BackendKeyData) DefaultMessage

func (m BackendKeyData) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (BackendKeyData) Encode

Encode implements the interface connection.Message.

type Bind

type Bind struct {
	DestinationPortal       string
	SourcePreparedStatement string
	ParameterFormatCodes    []int32
	ParameterValues         []BindParameterValue
	ResultFormatCodes       []int32
}

Bind represents a PostgreSQL message.

func (Bind) DebugString added in v0.2.0

func (m Bind) DebugString() string

DebugString returns a debug representation of the Bind message.

func (Bind) Decode

Decode implements the interface connection.Message.

func (Bind) DefaultMessage

func (m Bind) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (Bind) Encode

func (m Bind) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type BindComplete

type BindComplete struct{}

BindComplete represents a PostgreSQL message.

func (BindComplete) Decode

Decode implements the interface connection.Message.

func (BindComplete) DefaultMessage

func (m BindComplete) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (BindComplete) Encode

Encode implements the interface connection.Message.

type BindParameterValue

type BindParameterValue struct {
	Data   []byte
	IsNull bool
}

BindParameterValue are parameter values for the Bind message.

type CancelRequest

type CancelRequest struct {
	ProcessID int32
	SecretKey int32
}

CancelRequest represents a PostgreSQL message.

func (CancelRequest) Decode

Decode implements the interface connection.Message.

func (CancelRequest) DefaultMessage

func (m CancelRequest) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (CancelRequest) Encode

Encode implements the interface connection.Message.

type Close

type Close struct {
	ClosingPreparedStatement bool   // ClosingPreparedStatement: If true, closing a prepared statement. If false, closing a portal.
	Target                   string // Target is the name of whatever we are closing.
}

Close represents a PostgreSQL message.

func (Close) Decode

Decode implements the interface connection.Message.

func (Close) DefaultMessage

func (m Close) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (Close) Encode

func (m Close) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type CloseComplete

type CloseComplete struct{}

CloseComplete represents a PostgreSQL message.

func (CloseComplete) Decode

Decode implements the interface connection.Message.

func (CloseComplete) DefaultMessage

func (m CloseComplete) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (CloseComplete) Encode

Encode implements the interface connection.Message.

type CommandComplete

type CommandComplete struct {
	Query string
	Rows  int32
	Tag   string
}

CommandComplete tells the client that the command has completed.

func (CommandComplete) Decode

Decode implements the interface connection.Message.

func (CommandComplete) DefaultMessage

func (m CommandComplete) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (CommandComplete) Encode

Encode implements the interface connection.Message.

func (CommandComplete) IsIUD

func (m CommandComplete) IsIUD() bool

IsIUD returns whether the query is either an INSERT, UPDATE, or DELETE query.

type CopyBothResponse

type CopyBothResponse struct {
	IsTextual   bool // IsTextual states whether the copy is textual or binary.
	FormatCodes []int32
}

CopyBothResponse represents a PostgreSQL message.

func (CopyBothResponse) Decode

Decode implements the interface connection.Message.

func (CopyBothResponse) DefaultMessage

func (m CopyBothResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (CopyBothResponse) Encode

Encode implements the interface connection.Message.

type CopyData

type CopyData struct {
	Data []byte
}

CopyData represents a PostgreSQL message.

func (CopyData) Decode

Decode implements the interface connection.Message.

func (CopyData) DefaultMessage

func (m CopyData) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (CopyData) Encode

func (m CopyData) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type CopyDone

type CopyDone struct{}

CopyDone represents a PostgreSQL message.

func (CopyDone) Decode

Decode implements the interface connection.Message.

func (CopyDone) DefaultMessage

func (m CopyDone) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (CopyDone) Encode

func (m CopyDone) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type CopyFail

type CopyFail struct {
	ErrorMessage string
}

CopyFail represents a PostgreSQL message.

func (CopyFail) Decode

Decode implements the interface connection.Message.

func (CopyFail) DefaultMessage

func (m CopyFail) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (CopyFail) Encode

func (m CopyFail) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type CopyInResponse

type CopyInResponse struct {
	IsTextual   bool // IsTextual states whether the copy is textual or binary.
	FormatCodes []int32
}

CopyInResponse represents a PostgreSQL message.

func (CopyInResponse) Decode

Decode implements the interface connection.Message.

func (CopyInResponse) DefaultMessage

func (m CopyInResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (CopyInResponse) Encode

Encode implements the interface connection.Message.

type CopyOutResponse

type CopyOutResponse struct {
	IsTextual   bool // IsTextual states whether the copy is textual or binary.
	FormatCodes []int32
}

CopyOutResponse represents a PostgreSQL message.

func (CopyOutResponse) Decode

Decode implements the interface connection.Message.

func (CopyOutResponse) DefaultMessage

func (m CopyOutResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (CopyOutResponse) Encode

Encode implements the interface connection.Message.

type DataRow

type DataRow struct {
	Values []sqltypes.Value
}

DataRow represents a row of data.

func (DataRow) Decode

Decode implements the interface connection.Message.

func (DataRow) DefaultMessage

func (m DataRow) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (DataRow) Encode

func (m DataRow) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type Describe

type Describe struct {
	IsPrepared bool // IsPrepared states whether we're describing a prepared statement or a portal.
	Target     string
}

Describe represents a PostgreSQL message.

func (Describe) DebugString added in v0.2.0

func (m Describe) DebugString() string

func (Describe) Decode

Decode implements the interface connection.Message.

func (Describe) DefaultMessage

func (m Describe) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (Describe) Encode

func (m Describe) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type EmptyQueryResponse

type EmptyQueryResponse struct{}

EmptyQueryResponse represents a PostgreSQL message.

func (EmptyQueryResponse) Decode

Decode implements the interface connection.Message.

func (EmptyQueryResponse) DefaultMessage

func (m EmptyQueryResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (EmptyQueryResponse) Encode

Encode implements the interface connection.Message.

type ErrorResponse

type ErrorResponse struct {
	Severity     ErrorResponseSeverity
	SqlStateCode string
	Message      string
	Optional     ErrorResponseOptionalFields
}

ErrorResponse represents a server-side error that should be returned to the client. The Optional fields do not need to be set, but may give additional context for the error.

func (ErrorResponse) Decode

Decode implements the interface connection.Message.

func (ErrorResponse) DefaultMessage

func (m ErrorResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (ErrorResponse) Encode

Encode implements the interface connection.Message.

type ErrorResponseOptionalFields

type ErrorResponseOptionalFields struct {
	Schema     string
	Table      string
	Column     string
	Constraint string
	Routine    string
}

ErrorResponseOptionalFields are optional fields that will not be sent if their values are empty strings.

type ErrorResponseSeverity

type ErrorResponseSeverity string

ErrorResponseSeverity represents the severity of an ErrorResponse message.

const (
	ErrorResponseSeverity_Error   ErrorResponseSeverity = "ERROR"
	ErrorResponseSeverity_Fatal   ErrorResponseSeverity = "FATAL"
	ErrorResponseSeverity_Panic   ErrorResponseSeverity = "PANIC"
	ErrorResponseSeverity_Warning ErrorResponseSeverity = "WARNING"
	ErrorResponseSeverity_Notice  ErrorResponseSeverity = "NOTICE"
	ErrorResponseSeverity_Debug   ErrorResponseSeverity = "DEBUG"
	ErrorResponseSeverity_Info    ErrorResponseSeverity = "INFO"
	ErrorResponseSeverity_Log     ErrorResponseSeverity = "LOG"
)

type Execute

type Execute struct {
	Portal string
	RowMax int32
}

Execute represents a PostgreSQL message.

func (Execute) DebugString added in v0.2.0

func (m Execute) DebugString() string

func (Execute) Decode

Decode implements the interface connection.Message.

func (Execute) DefaultMessage

func (m Execute) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (Execute) Encode

func (m Execute) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type Flush

type Flush struct{}

Flush represents a PostgreSQL message.

func (Flush) Decode

Decode implements the interface connection.Message.

func (Flush) DefaultMessage

func (m Flush) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (Flush) Encode

func (m Flush) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type FunctionCall

type FunctionCall struct {
	ObjectID            int32
	ArgumentFormatCodes []int32
	Arguments           []FunctionCallArgument
	ResultFormatCode    int32
}

FunctionCall represents a PostgreSQL message.

func (FunctionCall) Decode

Decode implements the interface connection.Message.

func (FunctionCall) DefaultMessage

func (m FunctionCall) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (FunctionCall) Encode

Encode implements the interface connection.Message.

type FunctionCallArgument

type FunctionCallArgument struct {
	Data   []byte
	IsNull bool
}

FunctionCallArgument are arguments for the FunctionCall message.

type FunctionCallResponse

type FunctionCallResponse struct {
	IsResultNull bool
	ResultValue  []byte
}

FunctionCallResponse represents a PostgreSQL message.

func (FunctionCallResponse) Decode

Decode implements the interface connection.Message.

func (FunctionCallResponse) DefaultMessage

func (m FunctionCallResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (FunctionCallResponse) Encode

Encode implements the interface connection.Message.

type GSSENCRequest

type GSSENCRequest struct{}

GSSENCRequest represents a PostgreSQL message.

func (GSSENCRequest) Decode

Decode implements the interface connection.Message.

func (GSSENCRequest) DefaultMessage

func (m GSSENCRequest) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (GSSENCRequest) Encode

Encode implements the interface connection.Message.

type GSSENCResponse

type GSSENCResponse struct {
	SupportsGSSAPI bool
}

GSSENCResponse tells the client whether GSSAPI is supported. This is not a "true" PostgreSQL message, as it is not defined by the documentation as a message. However, clients expect to receive a response, so that response is encoded as a message.

func (GSSENCResponse) Decode

Decode implements the interface connection.Message.

func (GSSENCResponse) DefaultMessage

func (m GSSENCResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (GSSENCResponse) Encode

Encode implements the interface connection.Message.

type GSSResponse

type GSSResponse struct {
	Data []byte
}

GSSResponse represents a PostgreSQL message.

func (GSSResponse) Decode

Decode implements the interface connection.Message.

func (GSSResponse) DefaultMessage

func (m GSSResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (GSSResponse) Encode

func (m GSSResponse) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type NegotiateProtocolVersion

type NegotiateProtocolVersion struct {
	NewestMinorProtocol int32
	UnrecognizedOptions []string
}

NegotiateProtocolVersion represents a PostgreSQL message.

func (NegotiateProtocolVersion) Decode

Decode implements the interface connection.Message.

func (NegotiateProtocolVersion) DefaultMessage

DefaultMessage implements the interface connection.Message.

func (NegotiateProtocolVersion) Encode

Encode implements the interface connection.Message.

type NoData

type NoData struct{}

NoData represents a PostgreSQL message.

func (NoData) Decode

Decode implements the interface connection.Message.

func (NoData) DefaultMessage

func (m NoData) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (NoData) Encode

func (m NoData) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type NoticeResponse

type NoticeResponse struct {
	Fields []NoticeResponseField
}

NoticeResponse represents a PostgreSQL message.

func (NoticeResponse) Decode

Decode implements the interface connection.Message.

func (NoticeResponse) DefaultMessage

func (m NoticeResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (NoticeResponse) Encode

Encode implements the interface connection.Message.

type NoticeResponseField

type NoticeResponseField struct {
	Code  int32
	Value string
}

NoticeResponseField are the fields to an NoticeResponse message.

type NotificationResponse

type NotificationResponse struct {
	ProcessID int32
	Channel   string
	Payload   string
}

NotificationResponse represents a PostgreSQL message.

func (NotificationResponse) Decode

Decode implements the interface connection.Message.

func (NotificationResponse) DefaultMessage

func (m NotificationResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (NotificationResponse) Encode

Encode implements the interface connection.Message.

type ParameterDescription

type ParameterDescription struct {
	ObjectIDs []int32
}

ParameterDescription represents a PostgreSQL message.

func (ParameterDescription) Decode

Decode implements the interface connection.Message.

func (ParameterDescription) DefaultMessage

func (m ParameterDescription) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (ParameterDescription) Encode

Encode implements the interface connection.Message.

type ParameterStatus

type ParameterStatus struct {
	Name  string
	Value string
}

ParameterStatus reports various parameters to the client.

func (ParameterStatus) Decode

Decode implements the interface connection.Message.

func (ParameterStatus) DefaultMessage

func (m ParameterStatus) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (ParameterStatus) Encode

Encode implements the interface connection.Message.

type Parse

type Parse struct {
	Name               string
	Query              string
	ParameterObjectIDs []int32
}

Parse represents a PostgreSQL message.

func (Parse) DebugString added in v0.2.0

func (m Parse) DebugString() string

DebugString returns a debug representation of the Parse message.

func (Parse) Decode

Decode implements the interface connection.Message.

func (Parse) DefaultMessage

func (m Parse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (Parse) Encode

func (m Parse) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type ParseComplete

type ParseComplete struct{}

ParseComplete represents a PostgreSQL message.

func (ParseComplete) Decode

Decode implements the interface connection.Message.

func (ParseComplete) DefaultMessage

func (m ParseComplete) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (ParseComplete) Encode

Encode implements the interface connection.Message.

type PasswordMessage

type PasswordMessage struct {
	Password string
}

PasswordMessage represents a PostgreSQL message.

func (PasswordMessage) Decode

Decode implements the interface connection.Message.

func (PasswordMessage) DefaultMessage

func (m PasswordMessage) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (PasswordMessage) Encode

Encode implements the interface connection.Message.

type PortalSuspended

type PortalSuspended struct {
	Integer int32
	String  string
}

PortalSuspended represents a PostgreSQL message.

func (PortalSuspended) Decode

Decode implements the interface connection.Message.

func (PortalSuspended) DefaultMessage

func (m PortalSuspended) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (PortalSuspended) Encode

Encode implements the interface connection.Message.

type Query

type Query struct {
	String string
}

Query contains a query given by the client.

func (Query) DebugString added in v0.2.0

func (m Query) DebugString() string

func (Query) Decode

Decode implements the interface connection.Message.

func (Query) DefaultMessage

func (m Query) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (Query) Encode

func (m Query) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type ReadyForQuery

type ReadyForQuery struct {
	Indicator ReadyForQueryTransactionIndicator
}

ReadyForQuery tells the client that the server is ready for a new query cycle.

func (ReadyForQuery) Decode

Decode implements the interface connection.Message.

func (ReadyForQuery) DefaultMessage

func (m ReadyForQuery) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (ReadyForQuery) Encode

Encode implements the interface connection.Message.

type ReadyForQueryTransactionIndicator

type ReadyForQueryTransactionIndicator byte

ReadyForQueryTransactionIndicator indicates the state of the transaction related to the query.

const (
	ReadyForQueryTransactionIndicator_Idle                   ReadyForQueryTransactionIndicator = 'I'
	ReadyForQueryTransactionIndicator_TransactionBlock       ReadyForQueryTransactionIndicator = 'T'
	ReadyForQueryTransactionIndicator_FailedTransactionBlock ReadyForQueryTransactionIndicator = 'E'
)

type RowDescription

type RowDescription struct {
	Fields []*query.Field
}

RowDescription represents a RowDescription message intended for the client.

func (RowDescription) Decode

Decode implements the interface connection.Message.

func (RowDescription) DefaultMessage

func (m RowDescription) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (RowDescription) Encode

Encode implements the interface connection.Message.

type SASLInitialResponse

type SASLInitialResponse struct {
	Name     string
	Response []byte
}

SASLInitialResponse represents a PostgreSQL message.

func (SASLInitialResponse) Decode

Decode implements the interface connection.Message.

func (SASLInitialResponse) DefaultMessage

func (m SASLInitialResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (SASLInitialResponse) Encode

Encode implements the interface connection.Message.

type SASLResponse

type SASLResponse struct {
	Data []byte
}

SASLResponse represents a PostgreSQL message.

func (SASLResponse) Decode

Decode implements the interface connection.Message.

func (SASLResponse) DefaultMessage

func (m SASLResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (SASLResponse) Encode

Encode implements the interface connection.Message.

type SSLRequest

type SSLRequest struct{}

SSLRequest represents a PostgreSQL message.

func (SSLRequest) Decode

Decode implements the interface connection.Message.

func (SSLRequest) DefaultMessage

func (m SSLRequest) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (SSLRequest) Encode

func (m SSLRequest) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type SSLResponse

type SSLResponse struct {
	SupportsSSL bool
}

SSLResponse tells the client whether SSL is supported. This is not a "true" PostgreSQL message, as it is not defined by the documentation as a message. However, clients expect to receive a response, so that response is encoded as a message.

func (SSLResponse) Decode

Decode implements the interface connection.Message.

func (SSLResponse) DefaultMessage

func (m SSLResponse) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (SSLResponse) Encode

func (m SSLResponse) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type StartupMessage

type StartupMessage struct {
	ProtocolMajorVersion int
	ProtocolMinorVersion int
	Parameters           map[string]string
}

StartupMessage is returned by the client upon connecting to the server, providing details about the client.

func (StartupMessage) Decode

Decode implements the interface connection.Message.

func (StartupMessage) DefaultMessage

func (m StartupMessage) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (StartupMessage) Encode

Encode implements the interface connection.Message.

type Sync

type Sync struct{}

Sync represents a PostgreSQL message.

func (Sync) DebugString added in v0.2.0

func (m Sync) DebugString() string

func (Sync) Decode

Decode implements the interface connection.Message.

func (Sync) DefaultMessage

func (m Sync) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (Sync) Encode

func (m Sync) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

type Terminate

type Terminate struct{}

Terminate tells the server to close the connection.

func (Terminate) Decode

Decode implements the interface connection.Message.

func (Terminate) DefaultMessage

func (m Terminate) DefaultMessage() *connection.MessageFormat

DefaultMessage implements the interface connection.Message.

func (Terminate) Encode

func (m Terminate) Encode() (connection.MessageFormat, error)

Encode implements the interface connection.Message.

Jump to

Keyboard shortcuts

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