Documentation
¶
Index ¶
- func BuildColumnMapIndex(from []string, ordinals ColumnsMap) (mapIndex []int, err error)
- func BuildInsertColumnList(columnNames []string) string
- func ConvertFromUTF8(s string, charset string) (string, error)
- func ConvertToUTF8(s string, charset string) (string, error)
- func EscapeName(name string) string
- func EscapeNameSlice(names []string) (r []string)
- type Column
- type ColumnType
- type ColumnsMap
- type ConnectionConfig
- type LowerCaseTableNamesValue
- type TimezoneConvertion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildColumnMapIndex ¶
func BuildColumnMapIndex(from []string, ordinals ColumnsMap) (mapIndex []int, err error)
func BuildInsertColumnList ¶
func ConvertToUTF8 ¶
return original string and error if charset is not recognized
func EscapeName ¶
func EscapeNameSlice ¶
Types ¶
type Column ¶
type Column struct { // Every time you set this, you must also set `EscapedName`. RawName string EscapedName string IsUnsigned bool Charset string Type ColumnType // Default is currently only used for kafka and limited to basic types. Default interface{} ColumnType string Key string TimezoneConversion *TimezoneConvertion Nullable bool Precision int // for decimal, time or datetime Scale int // for decimal }
func NewColumns ¶
func ParseColumns ¶
func (*Column) ConvertArg ¶
func (c *Column) ConvertArg(arg interface{}) interface{}
type of arg: see type.schema
type ColumnType ¶
type ColumnType int
const ( UnknownColumnType ColumnType = iota TimestampColumnType DateTimeColumnType EnumColumnType MediumIntColumnType BigIntColumnType FloatColumnType DoubleColumnType DecimalColumnType BinaryColumnType TextColumnType // 10 JSONColumnType DateColumnType TimeColumnType YearColumnType VarbinaryColumnType BitColumnType TinytextColumnType TinyintColumnType SmallintColumnType IntColumnType // 20 SetColumnType CharColumnType VarcharColumnType BlobColumnType BooleanColumnType )
type ColumnsMap ¶
ColumnsMap maps a column name onto its ordinal position
func NewColumnsMap ¶
func NewColumnsMap(orderedColumns []Column) ColumnsMap
type ConnectionConfig ¶
ConnectionConfig is the minimal configuration required to connect to a MySQL server
func (*ConnectionConfig) GetAddr ¶
func (c *ConnectionConfig) GetAddr() string
func (*ConnectionConfig) GetDBUri ¶
func (c *ConnectionConfig) GetDBUri() string
type LowerCaseTableNamesValue ¶
type LowerCaseTableNamesValue int
const ( LowerCaseTableNames0 LowerCaseTableNamesValue = iota LowerCaseTableNames1 LowerCaseTableNames2 )
type TimezoneConvertion ¶
type TimezoneConvertion struct {
ToTimezone string
}
Click to show internal directories.
Click to hide internal directories.