capabilities

package
v0.19.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnspecifiedServerVersion = vterrors.Errorf(vtrpcpb.Code_INTERNAL, "server version unspecified")
)

Functions

func MySQLVersionHasCapability

func MySQLVersionHasCapability(serverVersion string, capability FlavorCapability) (bool, error)

MySQLVersionHasCapability is specific to MySQL flavors (of all versions) and answers whether the given server version has the requested capability.

func ServerVersionAtLeast

func ServerVersionAtLeast(serverVersion string, parts ...int) (bool, error)

ServerVersionAtLeast returns true if current server is at least given value. Example: if input is []int{8, 0, 23}... the function returns 'true' if we're on MySQL 8.0.23, 8.0.24, ...

Types

type CapableOf

type CapableOf func(capability FlavorCapability) (bool, error)

func MySQLVersionCapableOf

func MySQLVersionCapableOf(serverVersion string) CapableOf

MySQLVersionCapableOf returns a CapableOf function specific to MySQL flavors

type FlavorCapability

type FlavorCapability int
const (
	NoneFlavorCapability                        FlavorCapability = iota // default placeholder
	FastDropTableFlavorCapability                                       // supported in MySQL 8.0.23 and above: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-23.html
	TransactionalGtidExecutedFlavorCapability                           //
	InstantDDLFlavorCapability                                          // ALGORITHM=INSTANT general support
	InstantAddLastColumnFlavorCapability                                //
	InstantAddDropVirtualColumnFlavorCapability                         //
	InstantAddDropColumnFlavorCapability                                // Adding/dropping column in any position/ordinal.
	InstantChangeColumnDefaultFlavorCapability                          //
	InstantExpandEnumCapability                                         //
	MySQLJSONFlavorCapability                                           // JSON type supported
	MySQLUpgradeInServerFlavorCapability                                //
	DynamicRedoLogCapacityFlavorCapability                              // supported in MySQL 8.0.30 and above: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-30.html
	DisableRedoLogFlavorCapability                                      // supported in MySQL 8.0.21 and above: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-21.html
	CheckConstraintsCapability                                          // supported in MySQL 8.0.16 and above: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-16.html
	PerformanceSchemaDataLocksTableCapability
)

Jump to

Keyboard shortcuts

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