Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrValueIsNotAString = errors.New("value is not a string") ErrCannotConvertValueToBytes = errors.New("cannot convert value to byte slice") ErrCannotConvertValueToDecimal = errors.New("cannot convert value to decimal") ErrInvalidDecimalStringPresentation = errors.New("invalid decimal string presentation") ErrCannotConvertToInt = errors.New("cannot convert value to int type") ErrInvalidTimeLayout = errors.New("invalid time layout") )
Functions ¶
func ConvertStructuredData ¶
func ConvertStructuredData( _ context.Context, columnTypes map[string]string, data sdk.StructuredData, ) (sdk.StructuredData, error)
ConvertStructuredData converts a sdk.StructureData values to a proper database types.
Types ¶
type Querier ¶
type Querier interface {
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
}
Querier is a database querier interface needed for the GetColumnTypes function.
type TableInfo ¶
type TableInfo struct { // ColumnTypes - column name with column type. ColumnTypes map[string]string // PrimaryKeys - primary keys column names. PrimaryKeys []string // ColumnLengths - column name with length. ColumnLengths map[string]int // ColumnScales - column name with scale. ColumnScales map[string]*int }
TableInfo - information about colum types, primary keys from table.
func GetTableInfo ¶
GetTableInfo returns a map containing all table's columns and their database types and returns primary columns names.
func (TableInfo) GetColumnQueryPart ¶
GetColumnQueryPart prepare query part about creation column for tracking table. For example: NAME VARCHAR(40), AGE INT, ADDRESS VARCHAR(120).
Click to show internal directories.
Click to hide internal directories.