ShowDatabases shows the databases of a database server.
(db *sql.Conn)
| 43 | |
| 44 | // ShowDatabases shows the databases of a database server. |
| 45 | func 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. |
| 54 | func ShowTables(db *sql.Conn) ([]string, error) { |
no test coverage detected