Documentation
¶
Overview ¶
Package relation defines canonical MySQL physical-relation identities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidIdentifier = errors.New("invalid MySQL identifier")
ErrInvalidIdentifier reports an identifier that cannot be safely used as a MySQL database or table name.
Functions ¶
func QuoteIdentifier ¶
QuoteIdentifier validates and quotes one MySQL identifier.
func QuoteQualified ¶
QuoteQualified validates and quotes a database-qualified table name.
func ValidateIdentifier ¶
ValidateIdentifier validates one non-empty MySQL database or table identifier.
Types ¶
type Canonicalizer ¶
type Canonicalizer struct {
// contains filtered or unexported fields
}
Canonicalizer applies one frozen lower_case_table_names mode.
func MustCanonicalizer ¶
func MustCanonicalizer(mode int) Canonicalizer
MustCanonicalizer constructs a canonicalizer and panics for an invalid mode.
func NewCanonicalizer ¶
func NewCanonicalizer(mode int) (Canonicalizer, error)
NewCanonicalizer constructs a canonicalizer for lower_case_table_names 0, 1, or 2.
func (Canonicalizer) Identifier ¶
func (c Canonicalizer) Identifier(name string) string
Identifier returns the canonical lookup form of an identifier.
func (Canonicalizer) Identity ¶
func (c Canonicalizer) Identity(database, table string) Identity
Identity returns canonical lookup identity while retaining display spelling.
func (Canonicalizer) Key ¶
func (c Canonicalizer) Key(database, table string) Key
Key returns a canonical physical-relation lookup key.
func (Canonicalizer) Mode ¶
func (c Canonicalizer) Mode() CaseMode
Mode returns the frozen lower_case_table_names mode.