db

package
v0.0.0-...-e92691c Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Marshaler

type Marshaler interface {
	MarshalRow(string, ...interface{}) (interface{}, error)
	MarshalRows(string, ...interface{}) (interface{}, error)
	MarshalField(string, ...interface{}) (interface{}, error)
	MarshalFields(string, ...interface{}) (interface{}, error)
}

Marshaler interface

*
* These operations allow for basic interactions:
*  	-MarshalRow: Update or delete a row
*		-MarshalRows: Update or delete multiple rows
*	 	-MarshalField: Update or delete a single field in a row
*		-MarshalFields: Update or delete multiple fields in a row
*
*		All methods allow the option to return the overwritten value

type MySQL

type MySQL struct {
	*sql.DB
}

MySQL is a wrapper around a sql DB struct

func NewMySQL

func NewMySQL(db *sql.DB) *MySQL

NewMySQL wraps db connection

func (*MySQL) MarshalField

func (db *MySQL) MarshalField(sql string, args ...interface{}) (interface{}, error)

MarshalField updates or deletes a rows field in a mysql database

func (*MySQL) MarshalFields

func (db *MySQL) MarshalFields(sql string, args ...interface{}) (interface{}, error)

MarshalFields updates or deletes many fields in a mysql database

func (*MySQL) MarshalRow

func (db *MySQL) MarshalRow(sql string, args ...interface{}) (interface{}, error)

MarshalRow updates or deletes a row in a mysql database

func (*MySQL) MarshalRows

func (db *MySQL) MarshalRows(sql string, args ...interface{}) (interface{}, error)

MarshalRows updates or deletes many rows in a mysql database

func (*MySQL) UnmarshalField

func (db *MySQL) UnmarshalField(v interface{}, sql string, args ...interface{}) error

UnmarshalField retrieves a field from a mysql database

func (*MySQL) UnmarshalFields

func (db *MySQL) UnmarshalFields(v interface{}, sql string, args ...interface{}) error

UnmarshalFields retrieves many fields from a mysql database

func (*MySQL) UnmarshalRow

func (db *MySQL) UnmarshalRow(v interface{}, sql string, args ...interface{}) error

UnmarshalRow retrieves a row from a mysql database

func (*MySQL) UnmarshalRows

func (db *MySQL) UnmarshalRows(v interface{}, sql string, args ...interface{}) error

UnmarshalRows retrieves many rows from a mysql database

type UnmarshalMarshaler

type UnmarshalMarshaler interface {
	Unmarshaler
	Marshaler
}

UnmarshalMarshaler I'm really sorry about this name.

type Unmarshaler

type Unmarshaler interface {
	UnmarshalRow(interface{}, string, ...interface{}) error
	UnmarshalRows(interface{}, string, ...interface{}) error
	UnmarshalField(interface{}, string, ...interface{}) error
	UnmarshalFields(interface{}, string, ...interface{}) error
}

Unmarshaler interface

*
* These operations allow for basic interactions:
*  	-UnmarshalRow: Retrieve a row (usually into a struct)
*		-UnmarshalRows: Retrieve multiple rows (usually into a slice of structs or interfaces)
*	 	-UnmarshalField: Retrieve a single field in a row (usually into a single variable)
*		-UnmarshalFields: Retrieve multiple fields in a row (usually into a slice of interfaces)

Jump to

Keyboard shortcuts

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