Operate graph spaces¶
When Studio is connected to Nebula Graph, you can create or delete a graph space. You can use the Console page or the Schema page to do these operations. This article only introduces how to use the Schema page to operate graph spaces in Nebula Graph.
Studio version¶
Studio of v1.2.1-beta or later versions supports this function. To update the version, run this command.
docker-compose pull && docker-compose up -d
Prerequisites¶
To operate a graph space on the Schema page of Studio, you must do a check of these:
- The version of Studio is v1.2.1-beta or later.
- Studio is connected to Nebula Graph.
- Your account has the authority of GOD. It means that:
- If the authentication is enabled in Nebula Graph, you can use
user
andpassword
to sign in to Studio. - If the authentication is disabled in Nebula Graph, you must use
root
and its password to sign in to Studio.
- If the authentication is enabled in Nebula Graph, you can use
Create a graph space¶
To create a graph space on the Schema page, follow these steps:
- In the toolbar, click the Schema tab.
- On the Graph Space List page, click the + Create button.
-
On the Create page, do these settings:
a. Name: Specify a name to the new graph space. In this example,
mooc_actions
is used. The name must be distinct in the database.b. Optional Parameters: Set
partition_num
,replica_factor
,charset
, orcollate
. In this example, these parameters are set to10
,1
,utf8
, andutf8_bin
separately. For more information, seeCREATE SPACE
syntax.In the Equivalent to the following nGQL statement panel, you can see the statement equivalent to the preceding settings.
-
Confirm the settings and then click the + Create button. If the graph space is created successfully, you can see it on the graph space list.
Delete a graph space¶
To delete a graph space on the Schema page, follow these steps:
- In the toolbar, click the Schema tab.
-
In the graph space list, find a graph space and then the button in the Operations column.
-
On the dialog box, confirm the information and then click the OK button. When the graph space is deleted successfully, it is removed from the graph space list.
Next to do¶
After a graph space is created, you can create or edit a schema, including: