mysql

package
v0.0.0-...-f117f35 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2018 License: GPL-3.0 Imports: 2 Imported by: 5

README

sql-helper

sql helper file for mysql/mariadb

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteInsert

func ExecuteInsert(db *sql.DB, query string, params ...interface{}) (lastInsertedID int64, err error)

ExecuteInsert - performs a insert operation and returns latest inserted id

func ExecuteReader

func ExecuteReader(db *sql.DB, query string, fn Delegate, params ...interface{}) (data *list.List, err error)

ExecuteReader - executes @query and returns results in a list

func ExecuteUpdateDelete

func ExecuteUpdateDelete(db *sql.DB, query string, params ...interface{}) (updatedRowCount int64, err error)

ExecuteUpdateDelete - performs update and returns affected row count

Types

type Delegate

type Delegate func(rows *sql.Rows, collection *list.List)

Delegate - function for parse data from sql cursor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳