Documentation
¶
Overview ¶
Package utils contains some common utilities used by all other packages.
Index ¶
- Constants
- func EscapeMySQLType(columnType string, value any) string
- func HashKey(key []any) string
- func IntersectNonGeneratedColumns(t1, t2 *table.TableInfo) string
- func IntersectNonGeneratedColumnsAsSlice(t1, t2 *table.TableInfo) []string
- func StripPort(hostname string) string
- func UnhashKey(key string) []string
- func UnhashKeyToString(key string) string
Constants ¶
View Source
const (
PrimaryKeySeparator = "-#-" // used to hash a composite primary key
)
Variables ¶
This section is empty.
Functions ¶
func EscapeMySQLType ¶
EscapeMySQLType formats a Go value for use in SQL VALUES clause using proper SQL escaping It takes into account the MySQL column type to handle escaping appropriately
func HashKey ¶
HashKey is used to convert a composite key into a string so that it can be placed in a map.
func IntersectNonGeneratedColumns ¶
IntersectNonGeneratedColumns returns a string of columns that are in both tables The column names are in backticks and comma separated.
func IntersectNonGeneratedColumnsAsSlice ¶
IntersectNonGeneratedColumnsAsSlice returns a slice of column names that are in both tables
func UnhashKeyToString ¶
UnhashKeyToString converts a hashed key to a string that can be used in a query.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.