bmessages

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticationCleartextPassword

func AuthenticationCleartextPassword() []byte

func AuthenticationOk

func AuthenticationOk() []byte

func BindComplete added in v1.0.5

func BindComplete() []byte

func CommandComplete

func CommandComplete(msg []byte) []byte

func DataRow

func DataRow(rows []*schema.Row, colNumb int, ResultColumnFormatCodes []int16) []byte

DataRow if ResultColumnFormatCodes is nil default text format is used

func EmptyQueryResponse

func EmptyQueryResponse() []byte

func ErrorResponse

func ErrorResponse(setters ...Option) *errorResp

func ParameterDescription added in v1.0.5

func ParameterDescription(cols []*schema.Column) []byte

Byte1('t') Identifies the message as a parameter description.

Int32 Length of message contents in bytes, including self.

Int16 The number of parameters used by the statement (can be zero).

Then, for each parameter, there is the following:

Int32 Specifies the object ID of the parameter data type. ParameterDescription send a parameter description message. Cols need to be lexicographically ordered by selector

func ParameterStatus

func ParameterStatus(pname, pval []byte) []byte

func ParseComplete added in v1.0.5

func ParseComplete() []byte

func ReadyForQuery

func ReadyForQuery() []byte

func RowDescription

func RowDescription(cols []*schema.Column, formatCodes []int16) []byte

Types

type ErrorResp

type ErrorResp interface {
	Encode() []byte
	ToString() string
}

type Option

type Option func(s *errorResp)

func Code

func Code(value string) Option

Code the SQLSTATE code for the error (see Appendix A). Not localizable. Always present.

func ColumnName

func ColumnName(value string) Option

ColumnName if the error was associated with a specific table column, the name of the column. (Refer to the schema and table name fields to identify the table.)

func ConstraintName

func ConstraintName(value string) Option

ConstraintName if the error was associated with a specific constraint, the name of the constraint. Refer to fields listed above for the associated table or domain. (For this purpose, indexes are treated as constraints, even if they weren't created with constraint syntax.)

func DataTypeName

func DataTypeName(value string) Option

DataTypeName if the error was associated with a specific data type, the name of the data type. (Refer to the schema name field for the name of the data type's schema.)

func Detail

func Detail(value string) Option

Detail an optional secondary error message carrying more detail about the problem. Might run to multiple lines.

func File

func File(value string) Option

File the file name of the source-code location where the error was reported.

func Hint

func Hint(value string) Option

Hint an optional suggestion what to do about the problem. This is intended to differ from Detail in that it offers advice (potentially inappropriate) rather than hard facts. Might run to multiple lines.

func InternalPosition

func InternalPosition(value string) Option

InternalPosition this is defined the same as the P field, but it is used when the cursor position refers to an internally generated command rather than the one submitted by the client. The q field will always appear when this field appears.

func InternalQuery

func InternalQuery(value string) Option

InternalQuery the text of a failed internally-generated command. This could be, for example, a SQL query issued by a PL/pgSQL function.

func Line

func Line(value string) Option

Line the line number of the source-code location where the error was reported.

func Message

func Message(value string) Option

Message the primary human-readable error message. This should be accurate but terse (typically one line). Always present.

func Position

func Position(value string) Option

Position the field value is a decimal ASCII integer, indicating an error cursor position as an index into the original query string. The first character has index 1, and positions are measured in characters not bytes.

func Routine

func Routine(value string) Option

Routine the name of the source-code routine reporting the error.

func SchemaName

func SchemaName(value string) Option

SchemaName if the error was associated with a specific database object, the name of the schema containing that object, if any.

func Severity

func Severity(value string) Option

Severity the field contents are ERROR, FATAL, or PANIC (in an error message), or WARNING, NOTICE, DEBUG, INFO, or LOG (in a notice message), or a localized translation of one of these. Always present.

func SeverityNotLoc

func SeverityNotLoc(value string) Option

Severity the field contents are ERROR, FATAL, or PANIC (in an error message), or WARNING, NOTICE, DEBUG, INFO, or LOG (in a notice message). This is identical to the S field except that the contents are never localized. This is present only in messages generated by PostgreSQL versions 9.6 and later.

func TableName

func TableName(value string) Option

TableName if the error was associated with a specific table, the name of the table. (Refer to the schema name field for the name of the table's schema.)

func Where

func Where(value string) Option

Where an indication of the context in which the error occurred. Presently this includes a call stack traceback of active procedural language functions and internally-generated queries. The trace is one entry per line, most recent first.

Jump to

Keyboard shortcuts

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