Documentation
¶
Index ¶
- Constants
- func GetDbName() string
- type Backend
- func (b *Backend) Close() error
- func (b *Backend) ColumnIndexTypes(namespace, table string) (map[string]string, error)
- func (b *Backend) ColumnsMeta(namespace, table string) ([]db.ColumnMeta, error)
- func (b *Backend) CurrentNamespace() string
- func (b *Backend) FetchTable(namespace, table string, limit int) (*data.Frame, error)
- func (b *Backend) Kind() string
- func (b *Backend) Namespaces() ([]string, error)
- func (b *Backend) PrimaryKeys(namespace, table string) ([]string, error)
- func (b *Backend) Run(stmt string) (db.Result, error)
- func (b *Backend) Tables(namespace string) ([]string, error)
- func (b *Backend) Title() string
- type Config
- type DB
- func (db *DB) Close() error
- func (db *DB) ColumnIndexTypes(database, table string) (map[string]string, error)
- func (db *DB) ColumnsMeta(database, table string) ([]dbapi.ColumnMeta, error)
- func (db *DB) FetchTableFields(table string) ([]string, error)
- func (db *DB) FetchTableRecords(table string) ([][]string, error)
- func (db *DB) PrimaryKeys(database, table string) ([]string, error)
- func (db *DB) RawExec(query string) (sql.Result, error)
- func (db *DB) RawQuery(query string) (fields []string, records [][]string, err error)
- func (db *DB) RawSqlCommand(query string) (rawCmdResult RawCommandResult, err error)
- func (db *DB) ShowCurrentDatabaseTables() ([]string, error)
- func (db *DB) ShowDatabaseTables(database string) ([]string, error)
- func (db *DB) ShowDatabases() ([]string, error)
- type RawCommandResult
Constants ¶
const ( // DQL SELECT = "select" SHOW = "show" DESC = "desc" DESCRB = "describe" WITH = "with" EXPLAIN = "explain" TABLE = "table" // MySQL 8: TABLE t VALUES = "values" // MySQL 8: VALUES ROW(...) // max rows fetched when browsing a table from the tree view FetchLimit = 200 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend adapts the mysql data-access layer to the db.Backend contract.
func (*Backend) ColumnIndexTypes ¶
ColumnIndexTypes returns index type labels for indexed columns of namespace.table.
func (*Backend) ColumnsMeta ¶
func (b *Backend) ColumnsMeta(namespace, table string) ([]db.ColumnMeta, error)
ColumnsMeta returns column metadata for namespace.table.
func (*Backend) CurrentNamespace ¶
CurrentNamespace reports the database this connection was opened against, so browsers can scope their listing to it (optional interface, not part of db.Backend).
func (*Backend) FetchTable ¶
FetchTable loads up to limit rows of namespace.table.
func (*Backend) Namespaces ¶
Namespaces lists the databases of the server.
func (*Backend) PrimaryKeys ¶
PrimaryKeys lists the primary-key column names of namespace.table.
func (*Backend) Run ¶
Run executes a statement, routing queries vs. mutations the same way the underlying data-access layer does. Query results come back as an all-string frame (NULL is not distinguishable from the empty string in the raw byte scan, so cells stay strings as-is).
type DB ¶
var (
DbClinet *DB
)
func (*DB) ColumnIndexTypes ¶
ColumnIndexTypes returns a column→index-type map for database.table. Priority: PK > UNIQUE > INDEX. Columns not in any index are absent from the map.
func (*DB) ColumnsMeta ¶
func (db *DB) ColumnsMeta(database, table string) ([]dbapi.ColumnMeta, error)
ColumnsMeta returns column metadata for database.table, in ordinal order. If database is empty the connection's current database is used.
func (*DB) PrimaryKeys ¶
PrimaryKeys lists the primary-key column names of database.table, in key-ordinal order. If database is empty the connection's current database is used.
func (*DB) RawSqlCommand ¶
func (db *DB) RawSqlCommand(query string) (rawCmdResult RawCommandResult, err error)