client

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	StatementMaps map[string]*Statement // 句柄缓存,交给client管理,方便在断开时释放资源
	Location      *time.Location        // 服务器端的时区

	NotifyChan chan *frame.Notification // 异步消息通道
	Err        *frame.Error             // 业务上最近的错误帧
	IOError    error                    // 底层通信错误
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, dsn dsn.DataSourceName) (c *Client, err error)

NewClient 创建客户端对象

func (*Client) CancelRequest

func (c *Client) CancelRequest() (err error)

CancelRequest 建立新连接,使用PID+口令从新连接中发出指令

func (*Client) Close

func (c *Client) Close() (err error)

func (*Client) CloseParse

func (c *Client) CloseParse(name string) (err error)

func (*Client) IsInTransaction

func (c *Client) IsInTransaction() bool

func (*Client) Parse

func (c *Client) Parse(name, query string) (res Response, err error)

func (*Client) ParseExec

func (c *Client) ParseExec(name string, args []driver.Value) (res Response, err error)

ParseExec BindFrame

func (*Client) ParseQuery

func (c *Client) ParseQuery(name string, args []driver.Value) (res Response, err error)

ParseQuery BindFrame

func (*Client) QueryNoArgs

func (c *Client) QueryNoArgs(query string) (res Response, err error)

func (*Client) Terminate

func (c *Client) Terminate() (err error)

type Response

type Response struct {
	ParameterDescription *frame.ParameterDescription
	Description          *frame.RowDescription
	DataRows             []*frame.DataRow
	Completion           *frame.CommandCompletion
}

Response 业务响应的数据集

type Statement

type Statement struct {
	Id       string
	SQL      string
	Response Response
}

Statement 可缓存的语句

Jump to

Keyboard shortcuts

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