MCPcopy
hub / github.com/pingcap/tidb / ShowDatabases

Function ShowDatabases

dumpling/export/sql.go:45–51  ·  view source on GitHub ↗

ShowDatabases shows the databases of a database server.

(db *sql.Conn)

Source from the content-addressed store, hash-verified

43
44// ShowDatabases shows the databases of a database server.
45func ShowDatabases(db *sql.Conn) ([]string, error) {
46 var res oneStrColumnTable
47 if err := simpleQuery(db, "SHOW DATABASES", res.handleOneRow); err != nil {
48 return nil, err
49 }
50 return res.data, nil
51}
52
53// ShowTables shows the tables of a database, the caller should use the correct database.
54func ShowTables(db *sql.Conn) ([]string, error) {

Callers 1

prepareDumpingDatabasesFunction · 0.85

Calls 1

simpleQueryFunction · 0.85

Tested by

no test coverage detected