db

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mapper added in v1.1.0

func Mapper(i *tracer.Infos, data interface{}, to interface{}) error

Types

type Config

type Config interface {
	GetUser() string
	GetPassword() string
	GetHost() string
	GetPort() string
	GetDatabase() string
}

type Database

type Database interface {
	Connect(Config)
	Insert(*tracer.Infos, string, ...interface{}) (sql.Result, error)
	Update(*tracer.Infos, string, ...interface{}) (sql.Result, error)
	Get(*tracer.Infos, string, ...interface{}) (map[string]interface{}, error)
	Fetch(*tracer.Infos, string, ...interface{}) ([]map[string]interface{}, error)
}

type MySQL

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

func (*MySQL) Connect

func (m *MySQL) Connect(c Config)

func (*MySQL) Fetch

func (m *MySQL) Fetch(i *tracer.Infos, query string, args ...interface{}) ([]map[string]interface{}, error)

func (*MySQL) Get

func (m *MySQL) Get(i *tracer.Infos, query string, args ...interface{}) (map[string]interface{}, error)

func (*MySQL) Insert

func (m *MySQL) Insert(i *tracer.Infos, query string, args ...interface{}) (sql.Result, error)

func (*MySQL) Update

func (m *MySQL) Update(i *tracer.Infos, query string, args ...interface{}) (sql.Result, error)

Jump to

Keyboard shortcuts

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