database

package
v1.16.61 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypeRegistry = make(map[string]reflect.Type)

TypeRegistry maps any field names to their expected concrete types

Functions

func FetchColumnNames

func FetchColumnNames(db *sqlx.DB, tableName string) ([]string, error)

func InsertStruct

func InsertStruct(db *sqlx.DB, tableName string, data any) error

func InsertTrxStruct added in v1.8.69

func InsertTrxStruct(db *sqlx.Tx, tableName string, data any) error

func ParseRows

func ParseRows(rows *sql.Rows, dest any) error

func PostgresConn

func PostgresConn(options ...PostgresConnOptions) (*sqlx.DB, error)

func RegisterType added in v1.15.11

func RegisterType(fieldName string, sampleValue any)

func UpdateStruct

func UpdateStruct(db *sqlx.DB, tableName string, data any, conditionField string, conditionValue any) error

func UpdateTrxStruct added in v1.8.69

func UpdateTrxStruct(db *sqlx.Tx, tableName string, data any, conditionField string, conditionValue any) error

Types

type PostgresConnOptions added in v1.12.104

type PostgresConnOptions struct {
	MaxOpenConns      *int
	MaxIdleConns      *int
	ConnMaxLifetime   *time.Duration
	DatabaseUrlPrefix string
}

Jump to

Keyboard shortcuts

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