sqls

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecContext

func ExecContext(query string, args ...interface{}) (data sql.Result, err error)

func OnInit

func OnInit(s core.IService, opt ...Option) (err error)

func QueryContext

func QueryContext(query string, args ...interface{}) (data *sql.Rows, err error)

Types

type Option

type Option func(*Options)

func SetSqlUrl

func SetSqlUrl(v string) Option

func SetTimeOut

func SetTimeOut(v time.Duration) Option

type Options

type Options struct {
	SqlUrl  string
	TimeOut time.Duration
}

type SqlServer

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

func (*SqlServer) ExecContext

func (this *SqlServer) ExecContext(query string, args ...interface{}) (data sql.Result, err error)

func (*SqlServer) GetContext

func (this *SqlServer) GetContext(dest interface{}, query string, args ...interface{}) error

func (*SqlServer) QueryContext

func (this *SqlServer) QueryContext(query string, args ...interface{}) (data *sql.Rows, err error)

func (*SqlServer) QueryRowContext

func (this *SqlServer) QueryRowContext(query string, args ...interface{}) (data *sql.Row)

func (*SqlServer) QueryxContext

func (this *SqlServer) QueryxContext(query string, args ...interface{}) (data *sqlx.Rows, err error)

func (*SqlServer) SelectContext

func (this *SqlServer) SelectContext(dest interface{}, query string, args ...interface{}) error

Jump to

Keyboard shortcuts

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