drysql

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MIT Imports: 4 Imported by: 0

README

drysql

Drysql is simple iimplementation that reduces required boilerplate around maintianing go sql connections

AT the most basic level, you can pass in a pointer to a sql.DB connection to the method GetDrySqlImplementation. IT will return and instance of drysql that you can start writing queries for.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DrySql

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

func GetDrySqlImplementation

func GetDrySqlImplementation(sqlImpl SqlInterface) DrySql

func (DrySql) ExecWithoutPrepare

func (drysql DrySql) ExecWithoutPrepare(query string, args ...interface{}) (result sql.Result, err error)

func (DrySql) PreparedExec

func (drysql DrySql) PreparedExec(query string, inputs []interface{}) (sql.Result, error)

func (DrySql) PreparedQuery

func (drysql DrySql) PreparedQuery(query string, inputs []interface{}, scanner func(rows *sql.Rows) error) error

func (DrySql) QueryRow

func (drysql DrySql) QueryRow(query string, inputs []interface{}, outputs []interface{}) error

func (DrySql) QueryWithoutPrepare

func (drysql DrySql) QueryWithoutPrepare(query string, scanner func(rows *sql.Rows) error) (err error)

func (DrySql) UpdateTableRowFromStruct

func (drysql DrySql) UpdateTableRowFromStruct(tableName string, rowIdentifierTag string, updateStruct interface{}, optionalConditional string) (err error)

type SqlInterface

type SqlInterface interface {
	Prepare(query string) (*sql.Stmt, error)
	Query(query string, args ...interface{}) (*sql.Rows, error)
	Exec(query string, args ...interface{}) (sql.Result, error)
}

Jump to

Keyboard shortcuts

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