Categorygithub.com/kisielk/sqlstruct
modulepackage
0.0.0-20210630145711-dae28ed37023
Repository: https://github.com/kisielk/sqlstruct.git
Documentation: pkg.go.dev

# README

sqlstruct

sqlstruct provides some convenience functions for using structs with go's database/sql package

Documentation can be found at http://godoc.org/github.com/kisielk/sqlstruct

# Functions

Columns returns a string containing a sorted, comma-separated list of column names as defined by the type s.
ColumnsAliased works like Columns except it prefixes the resulting column name with the given alias.
Scan scans the next row from rows in to a struct pointed to by dest.
ScanAliased works like scan, except that it expects the results in the query to be prefixed by the given alias.
ToSnakeCase converts a string to snake case, words separated with underscores.

# Variables

NameMapper is the function used to convert struct fields which do not have sql tags into database column names.
TagName is the name of the tag to use on struct fields.

# Interfaces

Rows defines the interface of types that are scannable with the Scan function.