diff --git a/cli/meta.go b/cli/meta.go index 74d1816c7..dc22b3724 100644 --- a/cli/meta.go +++ b/cli/meta.go @@ -364,7 +364,7 @@ Input/Output \warn [-n] [STRING] write string to standard error (-n for no newline) Informational - \d list tables + \d list tables, including system tables \d NAME describe table \dt list tables \dv list views @@ -504,8 +504,17 @@ func (m *metaDescribe) execute(cmd *Command) (responseAction, error) { switch len(m.args) { case 0: // Describe with no args should list all relations (tables, views, - // etc.). For now, we're just going to list the tables. - return newMetaListTables().execute(cmd) + // etc.). For now, we're just going to list the tables, including system + // tables. + qry := []queryPart{ + newPartRaw("SHOW TABLES WITH SYSTEM"), + } + + if err := cmd.executeAndWriteQuery(qry); err != nil { + return actionNone, errors.Wrap(err, "executing query") + } + + return actionReset, nil case 1: // Describe with a single arg will assume the arg is a table name, so it diff --git a/cli/testdata/table b/cli/testdata/table index ec7a1cb01..713a4aaf8 100644 --- a/cli/testdata/table +++ b/cli/testdata/table @@ -11,6 +11,19 @@ EXPECTCOMP:WithFormat:| fb_____________________ | fb_____________________ | EXPECT:+-------------------------+-------------------------+-------+------------+----------------------+----------------------+-------+------------+-------------+ EXPECT: +// Show tables for database using \d. +SEND:\d +EXPECT:+-------------------------+-------------------------+-------+------------+----------------------+----------------------+-------+------------+-------------+ +EXPECT:| _id | name | owner | updated_by | created_at | updated_at | keys | space_used | description | +EXPECT:+-------------------------+-------------------------+-------+------------+----------------------+----------------------+-------+------------+-------------+ +EXPECTCOMP:WithFormat:| fb_____________________ | fb_____________________ | | | {timestamp} | {timestamp} | false | 0 | | +EXPECTCOMP:WithFormat:| fb_____________________ | fb_____________________ | | | {timestamp} | {timestamp} | false | 0 | | +EXPECTCOMP:WithFormat:| fb_____________________ | fb_____________________ | | | {timestamp} | {timestamp} | false | 0 | | +EXPECTCOMP:WithFormat:| fb_____________________ | fb_____________________ | | | {timestamp} | {timestamp} | false | 0 | | +EXPECTCOMP:WithFormat:| fb_____________________ | fb_____________________ | | | {timestamp} | {timestamp} | false | 0 | | +EXPECT:+-------------------------+-------------------------+-------+------------+----------------------+----------------------+-------+------------+-------------+ +EXPECT: + // Show tables for database using SHOW TABLES. SEND:SHOW TABLES; EXPECT:+-----+------+-------+------------+------------+------------+------+------------+-------------+ @@ -40,7 +53,7 @@ SEND:\dt EXPECT:+-------+-------+-------+------------+----------------------+----------------------+-------+------------+-------------+ EXPECT:| _id | name | owner | updated_by | created_at | updated_at | keys | space_used | description | EXPECT:+-------+-------+-------+------------+----------------------+----------------------+-------+------------+-------------+ -EXPECTCOMP:WithFormat:| users | users | | | 1970-01-01T00:00:00Z | 1970-01-01T00:00:00Z | false | 0 | | +EXPECTCOMP:WithFormat:| users | users | | | {timestamp} | {timestamp} | false | 0 | | EXPECT:+-------+-------+-------+------------+----------------------+----------------------+-------+------------+-------------+ EXPECT: