connections

package
v0.311.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatabaseEngine added in v0.308.0

func DatabaseEngine(ctx context.Context, ch *cmdutil.Helper, database string) (ps.DatabaseEngine, error)

DatabaseEngine resolves the engine backing a database so connection commands can pick the Vitess or Postgres code path.

func PrintList

func PrintList(ch *cmdutil.Helper, list live.ConnectionList, topology ListTopology) error

PrintList prints a live connection list in the configured CLI format.

func RunCancelQuery

func RunCancelQuery(ctx context.Context, ch *cmdutil.Helper, database, branch, queryID string, target ConnectionTarget) error

RunCancelQuery cancels the active query identified by a live connection query ID.

func RunCancelQueryForEngine

func RunCancelQueryForEngine(ctx context.Context, ch *cmdutil.Helper, database, branch, queryID string, engine ps.DatabaseEngine, target ConnectionTarget) error

RunCancelQueryForEngine cancels the active query and prints output for the resolved database engine.

func RunKillConnection

func RunKillConnection(ctx context.Context, ch *cmdutil.Helper, database, branch, connectionID string, target ConnectionTarget) error

RunKillConnection terminates the connection identified by a live connection_id.

func RunKillConnectionForEngine

func RunKillConnectionForEngine(ctx context.Context, ch *cmdutil.Helper, database, branch, connectionID string, engine ps.DatabaseEngine, target ConnectionTarget) error

RunKillConnectionForEngine terminates a connection and prints output for the resolved database engine.

func RunKillTransaction

func RunKillTransaction(ctx context.Context, ch *cmdutil.Helper, database, branch, transactionID string, target ConnectionTarget) error

RunKillTransaction terminates the connection identified by a live connection transaction ID.

func RunKillTransactionForEngine

func RunKillTransactionForEngine(ctx context.Context, ch *cmdutil.Helper, database, branch, transactionID string, engine ps.DatabaseEngine, target ConnectionTarget) error

RunKillTransactionForEngine terminates a transaction and prints output for the resolved database engine.

func RunList

func RunList(ctx context.Context, ch *cmdutil.Helper, database, branch string, filter ConnectionFilter, target ConnectionTarget) error

RunList fetches and prints one live connection list.

func TopCmd

func TopCmd(ch *cmdutil.Helper) *cobra.Command

func ValidateConnectionFilter

func ValidateConnectionFilter(filter ConnectionFilter) error

ValidateConnectionFilter validates mutually exclusive live connection filters.

func ValidateConnectionID

func ValidateConnectionID(id string) error

ValidateConnectionID checks the connection action identifier without making network calls.

func ValidateEngineFlags

func ValidateEngineFlags(engine ps.DatabaseEngine, filter ConnectionFilter, target ConnectionTarget) error

ValidateEngineFlags rejects flags that only apply to another database engine.

func ValidateQueryID

func ValidateQueryID(id string) error

ValidateQueryID checks the query action identifier without making network calls.

func ValidateTransactionID

func ValidateTransactionID(id string) error

ValidateTransactionID checks the transaction action identifier without making network calls.

Types

type ConnectionFilter

type ConnectionFilter struct {
	Instance string
	Role     string
}

ConnectionFilter filters live connection rows by instance or instance role.

type ConnectionTarget

type ConnectionTarget struct {
	Keyspace string
	Shard    string
}

ConnectionTarget identifies an optional Vitess target for connection commands.

type ListTopology

type ListTopology struct {
	Keyspace string `json:"keyspace,omitempty"`
	Shard    string `json:"shard,omitempty"`
	Tablet   string `json:"tablet,omitempty"`
}

ListTopology describes the Vitess tablet selected for a live connection list.

Jump to

Keyboard shortcuts

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