mysqlquery

package
v0.0.0-...-b462551 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypesMaps = map[string]string{
	"tinyint":    "int32",
	"smallint":   "int32",
	"mediumint":  "int64",
	"int":        "int64",
	"bigint":     "int64",
	"float":      "float64",
	"double":     "float64",
	"decimal":    "float64",
	"bit":        "bytes",
	"char":       "string",
	"varchar":    "string",
	"tinytext":   "string",
	"text":       "string",
	"mediumtext": "string",
	"longtext":   "string",
	"binary":     "bytes",
	"varbinary":  "bytes",
	"tinyblob":   "bytes",
	"blob":       "bytes",
	"mediumblob": "bytes",
	"longblob":   "bytes",
	"enum":       "string",
	"set":        "string",
	"date":       "date",
	"time":       "time",
	"year":       "int32",
}

Functions

func TypeConvert

func TypeConvert(val string, tipo string) (interface{}, error)

Type convert, returns the string value converted to the tipo param...

Types

type MysqlQuery

type MysqlQuery struct {
	Db     *sql.DB
	Query  string
	Cols   map[string]string
	Table  string
	Result []RRow
}

func (*MysqlQuery) GetData

func (t *MysqlQuery) GetData() error

GetData Returns an slice of RRow data, json serializable

func (*MysqlQuery) GetTypesFromTable

func (t *MysqlQuery) GetTypesFromTable() error

GetTypesFromTable scans mysql table for trying to know which types must export during json marshall

type RRow

type RRow map[string]interface{}

RRow is a rresult row

Jump to

Keyboard shortcuts

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