client

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr           string
	User           string
	Password       string
	Database       string
	Charset        string
	MaxRetries     int
	MaxOpenConns   int
	MaxIdleConns   int
	ConnectTimeout time.Duration
	WriteTimeout   time.Duration
}

func (*Config) DSN

func (c *Config) DSN() string

type SQLClient

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

func New

func New(cfg *Config) (*SQLClient, error)

func (*SQLClient) Close

func (c *SQLClient) Close() error

func (*SQLClient) Exec

func (c *SQLClient) Exec(ctx context.Context, query string, args ...interface{}) (res sql.Result, err error)

func (*SQLClient) QueryRow

func (c *SQLClient) QueryRow(ctx context.Context, query string, args ...interface{}) *sql.Row

Jump to

Keyboard shortcuts

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