database

package
v0.0.0-...-2dea52a Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSQL

func GetSQL(SQL string, inter *struct{}, params ...interface{}) error

func InsertSQl

func InsertSQl(SQL string, params ...interface{}) (int64, error)

func New

func New()

func ParseArrayStruct

func ParseArrayStruct[T any](rows *sqlx.Rows) []T

func ParseStruct

func ParseStruct[T any](rows *sqlx.Rows) (T, error)

func ReadArray

func ReadArray[T any](SQL string, params ...interface{}) ([]T, error)

func ReadArrayStruct

func ReadArrayStruct[T any](SQL string, params ...interface{}) ([]T, error)

func ReadSql

func ReadSql(SQL string, params ...interface{}) (*sqlx.Rows, error)

func ReadStruct

func ReadStruct[T any](SQL string, params ...interface{}) (T, error)

func ReadStructEmpty

func ReadStructEmpty[T any](SQL string, params ...interface{}) T

func ReadValue

func ReadValue[T any](SQL string, params ...interface{}) (T, error)

func ReadValueEmpty

func ReadValueEmpty[T any](SQL string, params ...interface{}) T

Types

type DB

type DB struct {
	*sqlx.DB
}
var Database *DB

Jump to

Keyboard shortcuts

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