Showing and Describing Namespaces
You can use the following ways to show namespaces and their tables from the SQL CLI:
-
SHOW
-
DESCRIBE
The next example shows creating a namespace (ns1
), a table within that namespace (ns1:foo
), and using SHOW
namespaces and SHOW table ns1:foo
to see the table hierarchy (that the table was created in the ns1 namespace). Finally, using DESCRIBE table ns1:foo
to see more table details:
sql-> create namespace ns1;
Statement completed successfully
sql-> create table ns1:foo (id integer, primary key (id));
Statement completed successfully
sql-> show namespaces;
namespaces
ns1
sysdefault
sql-> show table ns1:foo;
tableHierarchy(namespace ns1)
foo
sql-> describe table ns1:foo;
=== Information ===
+-----------+------+-----+-------+----------+----------+--------+----------+---------+-------------+
| namespace | name | ttl | owner | sysTable | r2compat | parent | children | indexes | description |
+-----------+------+-----+-------+----------+----------+--------+----------+---------+-------------+
| ns1 | foo | | | N | N | | | | |
+-----------+------+-----+-------+----------+----------+--------+----------+---------+-------------+
=== Fields ===
+----+------+---------+----------+-----------+----------+------------+----------+
| id | name | type | nullable | default | shardKey | primaryKey | identity |
+----+------+---------+----------+-----------+----------+------------+----------+
| 1 | id | Integer | N | NullValue | Y | Y | |
+----+------+---------+----------+-----------+----------+------------+----------+