mysql

package
v0.0.0-...-ee62de9 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DQL
	SELECT = "select"
	SHOW   = "show"
)

Variables

View Source
var LoginErrOut *tview.TextView
View Source
var RootTreeNode *tview.TreeNode
View Source
var TableRecords *tview.Table

Functions

func ClearTableRecords

func ClearTableRecords()

func ConnectCallback

func ConnectCallback(form *tview.Form) func()

func FillTableWithQueryResult

func FillTableWithQueryResult(fields []string, result [][]string)

func GetDbName

func GetDbName() string

func Init

func Init()

func PrintfTextView

func PrintfTextView(format string, a ...any)

This wiil be used when the inputField capture the enter key

func PrintlnTextView

func PrintlnTextView(a ...any)

func QuitCallback

func QuitCallback() func()

func RenderDashBoardPage

func RenderDashBoardPage() *tview.Flex

func RenderInputFiedl

func RenderInputFiedl() *tview.InputField

func RenderLoginPage

func RenderLoginPage() *tview.Flex

func RenderQueryWidget

func RenderQueryWidget() *tview.Flex

func RenderTable

func RenderTable() *tview.Table

func RenderTextView

func RenderTextView() *tview.TextView

func RenderTreeView

func RenderTreeView() *tview.TreeView

func SaveCallback

func SaveCallback(form *tview.Form) func()

func SetBorderStyle

func SetBorderStyle() *struct {
	Horizontal  rune
	Vertical    rune
	TopLeft     rune
	TopRight    rune
	BottomLeft  rune
	BottomRight rune

	LeftT   rune
	RightT  rune
	TopT    rune
	BottomT rune
	Cross   rune

	HorizontalFocus  rune
	VerticalFocus    rune
	TopLeftFocus     rune
	TopRightFocus    rune
	BottomLeftFocus  rune
	BottomRightFocus rune
}

set new border style and return old one

func SetCell

func SetCell(row int, column int, text string, color tcell.Color)

func SetRootTreeNodeName

func SetRootTreeNodeName(dbName string)

Types

type DB

type DB struct {
	*sql.DB
	// contains filtered or unexported fields
}
var (
	DbClinet *DB
)

func GetDB

func GetDB() *DB

func NewDB

func NewDB(dsn string) (*DB, error)

func (*DB) Close

func (db *DB) Close()

func (*DB) FetchTableFields

func (db *DB) FetchTableFields(table string) ([]string, error)

func (*DB) FetchTableRecords

func (db *DB) FetchTableRecords(table string) ([][]string, error)

func (*DB) RawExec

func (db *DB) RawExec(query string) (sql.Result, error)

func (*DB) RawQuery

func (db *DB) RawQuery(query string) (fields []string, records [][]string, err error)

func (*DB) RawSqlCommand

func (db *DB) RawSqlCommand(query string) (rawCmdResult RawCommandResult, err error)

func (*DB) ShowCurrentDatabaseTables

func (db *DB) ShowCurrentDatabaseTables() ([]string, error)

func (*DB) ShowDatabaseTables

func (db *DB) ShowDatabaseTables(database string) ([]string, error)

func (*DB) ShowDatabases

func (db *DB) ShowDatabases() ([]string, error)

type RawCommandResult

type RawCommandResult struct {
	Fields  []string
	Records [][]string
	Result  sql.Result
	IsDQL   bool
}

Jump to

Keyboard shortcuts

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