command

package
v0.11.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

Package command provides assistant commands.

Package command provides assistant commands.

Index

Constants

View Source
const ActivityCaption = "*Activity response:*\n"

ActivityCaption contains caption for rendered tables.

View Source
const CutText = "_(The text in the preview above has been cut)_"
View Source
const HypoPGCaption = "*HypoPG response:*\n"

HypoPGCaption contains caption for rendered tables.

View Source
const (
	// MsgExplainOptionReq describes an explain error.
	MsgExplainOptionReq = "Use `explain` to see the query's plan, e.g. `explain select 1`"
)
View Source
const MsgPlanOptionReq = "Use `plan` to see the query's plan without execution, e.g. `plan select 1`"

MsgPlanOptionReq describes an explain without execution error.

View Source
const PlanSize = 400
View Source
const SeparatorPlan = "\n[...SKIP...]\n"
View Source
const TerminateCaption = "*Terminate response:*\n"

TerminateCaption contains caption for rendered tables.

Variables

This section is empty.

Functions

func Explain

func Explain(ctx context.Context, msgSvc connection.Messenger, command *platform.Command, msg *models.Message,
	session usermanager.UserSession) error

Explain runs an explain query.

func ResetSession

func ResetSession(ctx context.Context, cmd *platform.Command, msg *models.Message, dbLab *dblabapi.Client,
	msgSvc connection.Messenger, session *usermanager.UserSession,
	appVersion, edition string) error

ResetSession provides a command to reset a Database Lab session.

func Transmit

func Transmit(cmd *platform.Command, msg *models.Message, msgSvc connection.Messenger, runner transmission.Runner) error

Transmit transmits to runner a psql command.

Types

type ActivityCmd

type ActivityCmd struct {
	// contains filtered or unexported fields
}

ActivityCmd defines the activity command.

func NewActivityCmd

func NewActivityCmd(cmd *platform.Command, msg *models.Message, db *pgxpool.Pool, messengerSvc connection.Messenger) *ActivityCmd

NewActivityCmd return a new exec command.

func (*ActivityCmd) Execute

func (c *ActivityCmd) Execute() error

Execute runs the activity command.

type ExecCmd

type ExecCmd struct {
	// contains filtered or unexported fields
}

ExecCmd defines the exec command.

func NewExec

func NewExec(command *platform.Command, msg *models.Message, session usermanager.UserSession,
	messengerSvc connection.Messenger) *ExecCmd

NewExec return a new exec command.

func (ExecCmd) Execute

func (cmd ExecCmd) Execute(ctx context.Context) error

Execute runs the exec command.

type HypoCmd

type HypoCmd struct {
	// contains filtered or unexported fields
}

HypoCmd defines a hypo command.

func NewHypo

func NewHypo(cmd *platform.Command, msg *models.Message, db *pgxpool.Pool, msgSvc connection.Messenger) *HypoCmd

NewHypo creates a new Hypo command.

func (*HypoCmd) Execute

func (h *HypoCmd) Execute() error

Execute runs the hypo command.

type PlanCmd

type PlanCmd struct {
	// contains filtered or unexported fields
}

PlanCmd defines the plan command.

func NewPlan

func NewPlan(cmd *platform.Command, msg *models.Message, db *pgx.Conn, messengerSvc connection.Messenger) *PlanCmd

NewPlan return a new plan command.

func (PlanCmd) Execute

func (cmd PlanCmd) Execute(ctx context.Context) error

Execute runs the plan command.

type TerminateCmd

type TerminateCmd struct {
	// contains filtered or unexported fields
}

TerminateCmd defines the terminate command.

func NewTerminateCmd

func NewTerminateCmd(cmd *platform.Command, msg *models.Message, db *pgxpool.Pool, messengerSvc connection.Messenger) *TerminateCmd

NewTerminateCmd return a new terminate command.

func (*TerminateCmd) Execute

func (c *TerminateCmd) Execute() error

Execute runs the terminate command.

Jump to

Keyboard shortcuts

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