typeconv

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnsupportedCollate    = func(c string) ShortDesc { return fmt.Sprintf("collate %s not supported", c) }
	UnsupportedColumnType = func(c string) ShortDesc { return fmt.Sprintf("%s %s", UnsupportedColumnTypeRaw, c) }
)

Functions

This section is empty.

Types

type MySQLColumnMeta

type MySQLColumnMeta struct {
	ColumnDefault     string
	CharMaxLen        int
	CharOctetLen      int
	NumPrecision      int32
	NumScale          int32
	DatetimePrecision int32
	CharSetName       string
	CollationName     string
	ColumnType        string
	ColumnKey         string
	Extra             string
}

MySQLColumnMeta collects the information about the column in a MySQL table. This information are stored in the information_schema

func NewMySQLColumnMeta

func NewMySQLColumnMeta() *MySQLColumnMeta

NewMySQLColumnMeta returns a new MySQLColumnMeta objects with unset/default value for all fields.

func (*MySQLColumnMeta) ToDefaultCRDBType

func (cm *MySQLColumnMeta) ToDefaultCRDBType(
	dataType, colName string,
) (*types.T, []*TypeConvError)

This is based on managed-service/migration/internal/mysql/types.go.

type ShortDesc

type ShortDesc = string
const (
	InvalidDecimalArgs       ShortDesc = "Invalid decimal args"
	UnsupportedBytesMax      ShortDesc = "Bytes limit not supported"
	UnsupportedColumnTypeRaw ShortDesc = "Unsupported column type"
	UnsupportedTinyInt       ShortDesc = "TINYINT not supported"
)

type TypeConvError

type TypeConvError struct {
	// ShortDescription is a key that can be used to uniquely identify a conversion
	// failure type. It is friendly to display in frontends instead of the longer
	// Message.
	// We use this instead of an ENUM as the size can be quite large.
	ShortDescription string
	// Message denotes the message to display detailing the conversion failure.
	Message string
	// Blocking indicates whether the conversion failure blocks a statement
	// from being marked as "complete".
	Blocking bool
}

func (*TypeConvError) Error

func (e *TypeConvError) Error() string

Jump to

Keyboard shortcuts

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