sql

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteWithConn

func ExecuteWithConn(conn *sql.DB, command string) error

ExecuteWithConn used to execute sql command such as insert, delete

func FetchRawGenerator

func FetchRawGenerator(conn *sql.DB, command string) <-chan *GenRow

FetchRawGenerator used to query data with a established connection

func FetchRawWithConn

func FetchRawWithConn(conn *sql.DB, command string) ([][]sql.RawBytes, error)

FetchRawWithConn (NOT SUGGEST TO USE DUE TO MEMORY BUG)used to query data with a established connection

func FetchWithConn

func FetchWithConn(conn *sql.DB, command string, rowHandel func(rowIndex int, row []sql.RawBytes) (interface{}, error)) ([]interface{}, error)

FetchWithConn used to query data with a established connection

func PushBulk

func PushBulk(conn *sql.DB, command string, items []string) error

PushBulk used to push bulk data to db

Types

type DataHandler

type DataHandler func(rowIndex int, row []sql.RawBytes) (interface{}, error)

DataHandler used process the raw data to target object

type GenRow

type GenRow struct {
	Err  error
	Data []sql.RawBytes
}

GenRow used to process the raw data GenRow

Jump to

Keyboard shortcuts

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