mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Update fbsql \d meta-command to show system tables
This commit is contained in:
parent
8f4f602ed8
commit
a68435faa6
2 changed files with 26 additions and 4 deletions
15
cli/meta.go
15
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
|
||||
|
|
|
|||
15
cli/testdata/table
vendored
15
cli/testdata/table
vendored
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue