db

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB is main class for MySQL API

func New

func New(args ...string) (*DB, error)

New is function for construct a new DB connection arg[0] - DB_USER arg[1] - DB_PASS arg[2] - DB_HOST arg[3] - DB_PORT arg[4] - DB_NAME

func (*DB) Exec

func (db *DB) Exec(query string, args ...interface{}) (result sql.Result, err error)

Exec is function for execute update and delete query type

func (*DB) MigrateDown

func (db *DB) MigrateDown(path string) (err error)

MigrateDown is function that receives path to migration dir and runs down ones

func (*DB) MigrateUp

func (db *DB) MigrateUp(path string) (err error)

MigrateUp is function that receives path to migration dir and runs up ones

func (*DB) Query

func (db *DB) Query(query string, args ...interface{}) (result []map[string]string, err error)

Query is function for execute select query type

Jump to

Keyboard shortcuts

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