database

package
v0.0.0-...-4e4318b Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConnection

func GetConnection() *sql.DB

func GetMockDB

func GetMockDB(t *testing.T) sqlmock.Sqlmock

func ScanColumnToStringSlice

func ScanColumnToStringSlice(rows *sql.Rows) ([]string, error)

func ScanRowToMap

func ScanRowToMap(row *sql.Row, colNames []string) (map[string]interface{}, error)

func ScanRowsToMap

func ScanRowsToMap(rows *sql.Rows, colNames []string) ([]map[string]interface{}, error)

Types

type Mock

type Mock struct {
	ExpectRows []MockRow
	ExpectErr  error
}

type MockRow

type MockRow []driver.Value

Jump to

Keyboard shortcuts

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