datastore

package
v0.0.0-...-99ceac5 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB() *sql.DB

Types

type SQLHandler

type SQLHandler struct {
	Conn *sql.DB
}

SQLHandler is a handler responsible for connection to DB.

func NewSQLHandler

func NewSQLHandler(conn *sql.DB) *SQLHandler

NewSQLHandler create a new sqlhandler.

func (*SQLHandler) Exec

func (sqlHandler *SQLHandler) Exec(statiment string, args ...interface{}) (gateway.Result, error)

Exec execute a query that insert or update sql.

func (*SQLHandler) Query

func (sqlHandler *SQLHandler) Query(statement string, args ...interface{}) (gateway.Row, error)

Query exetutes a query that returns rows.

type SQLResult

type SQLResult struct {
	Result sql.Result
}

SQLResult ...

func (SQLResult) LastInsertId

func (r SQLResult) LastInsertId() (int64, error)

LastInsertId ...

func (*SQLResult) RowsAffected

func (r *SQLResult) RowsAffected() (int64, error)

RowsAffected ...

type SQLRow

type SQLRow struct {
	Rows *sql.Rows
}

SQLRow is an implementation of presenters.Row.

func (SQLRow) Close

func (r SQLRow) Close() error

Close ...

func (SQLRow) Next

func (r SQLRow) Next() bool

Next ...

func (SQLRow) Scan

func (r SQLRow) Scan(dest ...interface{}) error

Scan ...

Jump to

Keyboard shortcuts

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