columntypes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// QueryPlaceholder is a temporary placeholder to replace with the Oracle's placeholders.
	QueryPlaceholder = ":{placeholder}"
)

Variables

This section is empty.

Functions

func FormatData

func FormatData(
	columnTypes map[string]ColumnDescription,
	key string, value any,
) (string, any, error)

FormatData formats the data into Oracle types and wraps the placeholder in a special function, if necessary.

func GetColumnTypes

func GetColumnTypes(
	ctx context.Context,
	repo *repository.Oracle,
	tableName string,
) (map[string]ColumnDescription, error)

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

func TransformRow

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

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

Types

type ColumnDescription

type ColumnDescription struct {
	Type      string
	Precision *int
	Scale     *int
}

ColumnDescription describes columns.

Jump to

Keyboard shortcuts

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