columntypes

package
v0.0.0-...-4ff6b87 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TimeTypeLayout is a time layout of Redshift Time data type.
	TimeTypeLayout = "15:04:05"
	// TimeTzTypeLayout is a time layout of Redshift Time with timezone data type.
	TimeTzTypeLayout = "15:04:05Z07"
)

Variables

This section is empty.

Functions

func ConvertStructuredData

func ConvertStructuredData(
	columnTypes map[string]string,
	data sdk.StructuredData,
) (sdk.StructuredData, error)

ConvertStructuredData converts a sdk.StructuredData value to another StructuredData value but with proper database types.

func GetColumnTypes

func GetColumnTypes(ctx context.Context, db *sqlx.DB, table, schema string) (map[string]string, error)

GetColumnTypes returns a map containing all table's columns and their database types.

func TransformRow

func TransformRow(row map[string]any, columnTypes map[string]string) (map[string]any, error)

TransformRow converts row map values to appropriate Go types, based on the columnTypes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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