-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[doc]add if exists in dropping schema #1511
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# DROP EDGE 语法 | ||
|
||
```ngql | ||
DROP EDGE <edge_type_name> | ||
DROP EDGE [IF EXISTS] <edge_type_name> | ||
``` | ||
|
||
仅支持有 DROP 权限的用户进行此操作。 | ||
|
||
删除边可使用 `IF EXISTS` 关键字,这个关键字会自动检测对应的边是否存在,如果存在则删除,如果不存在则直接返回。 | ||
|
||
此操作将移除指定类型的所有边。 | ||
|
||
此操作仅删除 Schema 信息,硬盘中所有文件及目录均**未被直接删除**,数据会在下次 compaction 时删除。 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
# DROP SPACE 语法 | ||
|
||
```ngql | ||
DROP SPACE <space_name<> | ||
DROP SPACE [IF EXISTS] <space_name> | ||
``` | ||
|
||
仅支持有 DROP 权限的用户进行此操作。 | ||
|
||
DROP SPACE 将删除指定 space 内的所有点和边。 | ||
|
||
删除图空间可使用 `IF EXISTS` 关键字,这个关键字会自动检测对应的图空间是否存在,如果存在则删除,如果不存在则直接返回。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 同上 |
||
|
||
其他 space 不受影响。 | ||
|
||
该语句不会立即删除存储引擎中的所有文件和目录(并释放磁盘空间)。删除操作取决于不同存储引擎的实现。 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
# DROP TAG 语法 | ||
|
||
```ngql | ||
DROP TAG <tag_name> | ||
DROP TAG [IF EXISTS] <tag_name> | ||
``` | ||
|
||
仅支持有 DROP 权限的用户进行此操作。 | ||
> 请谨慎进行此操作。 | ||
|
||
删除标签可使用 `IF EXISTS` 关键字,这个关键字会自动检测对应的标签是否存在,如果存在则删除,如果不存在则直接返回。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 同上 |
||
|
||
一个节点可以有一个或多个标签(类型)。 | ||
|
||
删除所有标签后,节点将不可访问,同时与节点连接的边也不可使用。 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# Drop Edge Syntax | ||
|
||
```ngql | ||
DROP EDGE <edge_type_name> | ||
DROP EDGE [IF EXISTS] <edge_type_name> | ||
``` | ||
|
||
You must have the DROP privilege for the edge type. | ||
|
||
You can use the `If EXISTS` keywords when dropping edges. This keyword automatically detects if the corresponding edge exists. If it exists, it will be deleted. Otherwise, no edge is deleted. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
|
||
This statement removes all the edges (connections) within the specific edge type. | ||
|
||
This operation only deletes the Schema data, all the files and directories in the disk are NOT deleted directly, data is deleted in the next compaction. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
# Drop Space Syntax | ||
|
||
```ngql | ||
DROP SPACE <space_name> | ||
DROP SPACE [IF EXISTS] <space_name> | ||
``` | ||
|
||
You must have the DROP privilege for the graph space. | ||
|
||
DROP SPACE deletes everything (all the vertices, edges, indices, and properties) in the specific space. | ||
|
||
You can use the `If EXISTS` keywords when dropping spaces. This keyword automatically detects if the corresponding space exists. If it exists, it will be deleted. Otherwise, no space is deleted. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto |
||
|
||
Other spaces remain unchanged. | ||
|
||
This statement does not immediately remove all the files and directories in the storage engine (and release disk space). The deletion depends on the implementation of different storage engines. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
# Drop Tag Syntax | ||
|
||
```ngql | ||
DROP TAG <tag_name> | ||
DROP TAG [IF EXISTS] <tag_name> | ||
``` | ||
|
||
You must have the DROP privilege for the tag. | ||
|
||
> Be careful with this statement. | ||
|
||
You can use the `If EXISTS` keywords when dropping tags. This keyword automatically detects if the corresponding tag exists. If it exists, it will be deleted. Otherwise, no tag is deleted. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
|
||
A vertex can have either only one tag (types) or multiple tags (types). | ||
|
||
In the former case, such a vertex can NOT be accessible after the statement, and edges connected with such vertex may result in DANGLING. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
强调一下不存在不会再返回错误。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得没有必要强调,直接返回就表明什么操作都不用做了。强调错误反而会让人误解。