sqladapter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn added in v0.3.0

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

Conn is the adapter type for sql.Conn connection type

func NewConn added in v0.3.0

func NewConn(conn *sql.Conn) *Conn

NewConn instantiated and returns adapter type for sql.Conn connection type

func (*Conn) Exec added in v0.3.0

func (a *Conn) Exec(ctx context.Context, query string, args ...interface{}) error

Exec runs a query and returns an error if any

func (*Conn) SelectOne added in v0.3.0

func (a *Conn) SelectOne(ctx context.Context, dst interface{}, query string, args ...interface{}) error

SelectOne runs a select query and scans the object into a struct or returns an error

type DB added in v0.3.0

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

DB is the adapter type for sqlx.DB connection type

func New

func New(db *sql.DB) *DB

New instantiates sqlx.DB connection adapter from sql.DB connection

func NewX

func NewX(db *sqlx.DB) *DB

NewX instantiates sqlx.DB connection adapter

func (*DB) Exec added in v0.3.0

func (a *DB) Exec(ctx context.Context, query string, args ...interface{}) error

Exec runs a query and returns an error if any

func (*DB) SelectOne added in v0.3.0

func (a *DB) SelectOne(ctx context.Context, dst interface{}, query string, args ...interface{}) error

SelectOne runs a select query and scans the object into a struct or returns an error

Jump to

Keyboard shortcuts

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