dbsql

package
v0.0.0-...-d7a0030 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ISO8601 = "2006-01-02T15:04:05.99999Z07:00"

ISO format for date/time

View Source
const ISO8601output = "2006-01-02T15:04:05.99999-0700"

Variables

View Source
var DbBeginQuote = `"`
View Source
var DbEndQuote = `"`

Functions

func RowsToInterface

func RowsToInterface(rows *sql.Rows) ([]map[string]interface{}, string, int)

-------------------------------------------------------------------------------------------------

func Run1

func Run1(db *sql.DB, q string, arg ...interface{}) error

-------------------------------------------------------------------------------------------------

func SelData2

func SelData2(db *sql.DB, q string, data ...interface{}) ([]map[string]interface{}, error)

-------------------------------------------------------------------------------------------------

func SelQ

func SelQ(db *sql.DB, q string, data ...interface{}) (Rows *sql.Rows, err error)

-------------------------------------------------------------------------------------------------

Types

type MyDb

type MyDb struct {
	Db     *sql.DB
	DbType string
}

func ConnectToAnyDb

func ConnectToAnyDb(dbType string, auth string, dbName string) *MyDb

ConeectToAnyDb connects to postgres/oracle/odbc/mariadb and sets the database if applicable. "odbc" should be used for Microsoft SQL Server. Some databases, postgres for example, defer the actual connection until the first query.

Jump to

Keyboard shortcuts

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