Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Registry = map[string]*CommandHandler{}
Functions ¶
func BuildCobraCommands ¶
func BuildCobraCommands(ctx *ExecContext) []*cobra.Command
func CloseAllDBConns ¶ added in v0.2.18
func CloseAllDBConns(ctx *ExecContext)
CloseAllDBConns closes every connection registered on ctx and clears the map. Used by the REPL on shutdown.
func Register ¶
func Register(handler *CommandHandler) error
Types ¶
type CommandHandler ¶
type CommandHandler struct {
Name string
Aliases []string
Usage string
Description string
// Forms lists the major sub-shapes of a command (one entry per shape).
// Each entry is rendered as-is under a "Forms:" header by `help <cmd>`.
// Use for commands like `ttest single|two|paired` where the bare Usage
// can't enumerate every form.
Forms []string
// Examples lists ready-to-run invocations rendered under "Examples:" by
// `help <cmd>`. Each entry should be a complete `insyra ...` line that
// the user can copy into a shell.
Examples []string
DisableFlagParsing bool
Run func(ctx *ExecContext, args []string) error
}
type DBConn ¶ added in v0.2.18
type DBConn struct {
Name string
Dialect string // "sqlite", "mysql", "postgres"
DSN string // original DSN string supplied by the user (with password masked when displayed)
DB *gorm.DB
}
DBConn represents a named database connection registered in an ExecContext.
type ExecContext ¶
type ExecContext struct {
Vars map[string]any
DBConns map[string]*DBConn
EnvName string
EnvPath string
Output io.Writer
InREPL bool
OpenREPL func(ctx *ExecContext) error
// Env is the per-session environment Manager. Commands MUST go through
// it (ctx.Env.SaveState etc.) so embedders that supply a per-workspace
// Manager don't get their writes redirected to the default ~/.insyra.
// Dispatch fills this with env.Default() if the caller left it nil.
Env *env.Manager
}
Source Files
¶
- addcol.go
- addrow.go
- ccl.go
- clean.go
- clear.go
- clone.go
- clustering.go
- col.go
- cols.go
- config.go
- convert.go
- db.go
- db_conn.go
- db_load.go
- db_save.go
- describe.go
- drop.go
- dropcol.go
- droprow.go
- encode.go
- env.go
- exit.go
- fetch.go
- fillna.go
- filter.go
- find.go
- get.go
- groupby.go
- help.go
- helpers.go
- history.go
- hypothesis.go
- knn.go
- load.go
- merge.go
- newdl.go
- newdt.go
- pca.go
- pivot.go
- plot.go
- read.go
- registry.go
- regression.go
- rename.go
- replace.go
- row.go
- rows_cmd.go
- run.go
- sample.go
- save.go
- scale.go
- set.go
- setcolnames.go
- setrownames.go
- shape.go
- show.go
- sort.go
- split.go
- stats_adv.go
- stats_dl.go
- stats_dl_extra.go
- summary.go
- swap.go
- timeseries.go
- transform.go
- transpose.go
- types.go
- vars.go
- version.go
Click to show internal directories.
Click to hide internal directories.