gosql

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: GPL-3.0 Imports: 8 Imported by: 3

README

gosql

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Driver, Host, Port, User, Password, Database string
}

func (DB) Connect

func (this DB) Connect() *sql.DB

func (DB) CreateTable

func (this DB) CreateTable(tableName string, columns []string)

func (DB) DropTable

func (this DB) DropTable(tableName string)

func (DB) Exec

func (this DB) Exec(sqlQuery string)

func (DB) GetAvgRowCountPerDay

func (this DB) GetAvgRowCountPerDay(
	tableName, dateColumn string,
	startDate, endDate time.Time,
	dayCount int) (avgRowCountPerDay int)

func (DB) GetAvgRowParamsPerDay added in v0.1.2

func (this DB) GetAvgRowParamsPerDay(
	tableName, dateColumn string,
	startDate, endDate time.Time,
	dayCount int,
	quantityColumn string,
	numericColumns []string,
	groupColumn string,
	filteredGroups []interface{}) []map[string]interface{}

func (DB) GetRowCountOnDate

func (this DB) GetRowCountOnDate(tableName, dateColumn string, date time.Time) (yesterdayRowCount int)

func (DB) GetRowParamsOnDate added in v0.1.2

func (this DB) GetRowParamsOnDate(
	tableName, dateColumn string,
	date time.Time,
	quantityColumn string,
	numericColumns []string,
	groupColumn string,
	filteredGroups []interface{}) []map[string]interface{}

func (DB) InsertMultiple

func (this DB) InsertMultiple(tableName string, rows [][]interface{}, columns []string)

func (DB) QueryObjects added in v0.1.2

func (this DB) QueryObjects(sqlQuery string, values ...interface{}) (objects []map[string]interface{})

func (DB) Quote

func (this DB) Quote(statement string) string

func (DB) QuoteMultiple

func (this DB) QuoteMultiple(statements []string) (quotedStatements []string)

Jump to

Keyboard shortcuts

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