ネームスペースの表示および説明
次の方法を使用して、SQL CLIからネームスペースおよびその表を表示できます。
-
SHOW
-
DESCRIBE
次の例は、ネームスペース(ns1
)とそのネームスペース内の表(ns1:foo
)の作成、およびSHOW
ネームスペースとSHOW table ns1:foo
を使用した表階層の表示(表はns1ネームスペースで作成されている)を示しています。最後に、DESCRIBE table ns1:foo
を使用して、表の詳細をさらに確認します。
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 | |
+----+------+---------+----------+-----------+----------+------------+----------+