pg

package
v0.0.0-...-b1b21d8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: LGPL-3.0 Imports: 8 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 {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, option ClientOption) (*Client, error)

func (*Client) Close

func (obj *Client) Close()

func (*Client) Exec

func (obj *Client) Exec(ctx context.Context, query string, args ...any) (*Result, error)

$1 is args 执行

func (*Client) Finds

func (obj *Client) Finds(ctx context.Context, query string, args ...any) (*Rows, error)

finds $1 is args

func (*Client) Insert

func (obj *Client) Insert(ctx context.Context, table string, datas ...any) error

insert $1 is args

type ClientOption

type ClientOption struct {
	Host string
	Port int
	Usr  string //用户名
	Pwd  string //密码
	Db   string //数据库名称
}

type Result

type Result struct {
	// contains filtered or unexported fields
}

func (*Result) RowsAffected

func (obj *Result) RowsAffected() int64

受影响的行数

func (*Result) String

func (obj *Result) String() string

结果

type Rows

type Rows struct {
	// contains filtered or unexported fields
}

func (*Rows) Close

func (obj *Rows) Close()

关闭游标

func (*Rows) Data

func (obj *Rows) Data() (map[string]any, error)

返回游标的数据

func (*Rows) Json

func (obj *Rows) Json() (gjson.Result, error)

返回游标的数据

func (*Rows) Next

func (obj *Rows) Next() bool

是否有下一个数据

Jump to

Keyboard shortcuts

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