Skip to content

Commit

Permalink
add charset doc (vesoft-inc#1750)
Browse files Browse the repository at this point in the history
Co-authored-by: dangleptr <[email protected]>
  • Loading branch information
amber-moe and dangleptr authored Feb 28, 2020
1 parent ecdad58 commit 4204298
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```ngql
CREATE SPACE [IF NOT EXISTS] <space_name>
[(partition_num = <part_num>, replica_factor = <raft_copy>)]
[(partition_num = <part_num>, replica_factor = <raft_copy>, charset = <charset>, collate = <collate>)]
```

以上语句用于创建一个新的图空间。不同的图空间是物理隔离的。
Expand All @@ -29,9 +29,13 @@ CREATE SPACE [IF NOT EXISTS] <space_name>

* _replica_factor_

_replica_factor_ 表示副本数量。默认值是 1,集群建议为 3
_replica_factor_ 表示副本数量。默认值是 1,集群建议为 3。
* _charset_
_charset_ 表示字符集,定义了字符以及字符的编码,默认为 utf8。
* _collate_
_collate_ 表示字符序,定义了字符的比较规则,默认为 utf8_bin。

如果没有自定义选项,**Nebula Graph** 会使用默认的值(partition_number 和 replica_factor)来创建图空间。
如果没有自定义选项,**Nebula Graph** 会使用默认的值(partition_number、replica_factor、charsetcollate)来创建图空间。

## 示例

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
```ngql
SHOW {SPACES | TAGS | EDGES | HOSTS | PARTS }
SHOW PARTS <part_id>
SHOW CREATE {TAG | EDGE} {<tag_name> | <edge_name>}
SHOW CREATE { SPACE | TAG | EDGE} {<space_name> | <tag_name> | <edge_name>}
SHOW {TAG | EDGE} INDEXES
SHOW CONFIGS [graph|meta|storage]
SHOW SNAPSHOTS
SHOW CHARSET
SHOW COLLATION
```

`SHOW SPACES` 列出 **Nebula Graph** 集群中的所有图空间。

`SHOW TAGS``SHOW EDGES` 则返回当前图空间中被定义的 tag 和 edge type。

`SHOW CREATE SPACE` 返回指定 space 及其创建语法。如果 space 包含默认值,则同时返回默认值。
`SHOW CREATE TAG``SHOW CREATE EDGE` 返回当前图空间中指定的 tag、edge type 及其创建语法。如果 tag 或 edge type 包含默认值,则同时返回默认值。

`SHOW INDEXES` 用于列出已创建完成的标签或边类型的索引信息。
Expand All @@ -24,6 +28,12 @@ SHOW CONFIGS [graph|meta|storage]

更多关于 `SHOW CONFIGS [graph|meta|storage]` 的信息,参见 [configs syntax](../../../3.build-develop-and-administration/3.deploy-and-administrations/server-administration/configuration-statements/configs-syntax.md)

`SHOW SNAPSHOTS` 返回所有快照。

`SHOW CHARSET` 返回所有支持的字符集。

`SHOW COLLATION` 返回支持的排序规则。

## 示例

```ngql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```ngql
CREATE SPACE [IF NOT EXISTS] <space_name>
[(partition_num = <part_num>, replica_factor = <raft_copy>)]
[(partition_num = <part_num>, replica_factor = <raft_copy>, charset = <charset>, collate = <collate>)]
```

This statement creates a new space with the given name. SPACE is a region that provides physically isolated graphs in **Nebula Graph**. An error occurs if the database exists.
Expand Down Expand Up @@ -30,8 +30,12 @@ When creating a space, the following two customized options can be given:
* _replica_factor_

_replica_factor_ specifies the number of replicas in the cluster. The default replica factor is 1. The suggested number is 3 in cluster.
* _charset_
_charset_ is short for character set. A character set is a set of symbols and encodings. The default value is utf8.
* _collate_
A _collation_ is a set of rules for comparing characters in a character set. The default value is utf8_bin.

However, if no option is given, **Nebula Graph** will create the space with the default partition number and replica factor.
However, if no option is given, **Nebula Graph** will create the space with the default partition number, replica factor, charset and collate.

## Example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# Show Syntax

```ngql
SHOW {SPACES | TAGS | EDGES | HOSTS | PARTS}
SHOW {SPACES | TAGS | EDGES | HOSTS | PARTS }
SHOW PARTS <part_id>
SHOW CREATE {TAG | EDGE} {<tag_name> | <edge_name>}
SHOW CREATE { SPACE | TAG | EDGE} {<space_name> | <tag_name> | <edge_name>}
SHOW {TAG | EDGE} INDEXES
SHOW CONFIGS [graph|meta|storage]
SHOW SNAPSHOTS
SHOW CHARSET
SHOW COLLATION
```

`SHOW SPACES` lists the SPACES on the **Nebula Graph** cluster.

`SHOW TAGS` and `SHOW EDGES` return the defined tags and edge types in a given space, respectively.

`SHOW CREATE SPACE` returns the specified graph space and its creation syntax. If the graph space contains a default value, the default value is also returned.

`SHOW CREATE TAG` and `SHOW CREATE EDGE` return the specified tag or edge type and their creation syntax in a given space. If the tag or edge type contains a default value, the default value is also returned.

`SHOW INDEXES` returns the defined tag/edg-type index information.
Expand All @@ -24,6 +29,12 @@ SHOW CONFIGS [graph|meta|storage]

For more information about `SHOW CONFIGS [graph|meta|storage]`, please refer to [configs syntax](../../../3.build-develop-and-administration/3.deploy-and-administrations/server-administration/configuration-statements/configs-syntax.md).

`SHOW SNAPSHOTS` lists all the snapshots.

`SHOW CHARSET` displays the available character sets.

`SHOW COLLATION` lists the display collations for a character set.

## Example

```ngql
Expand Down

0 comments on commit 4204298

Please sign in to comment.